diff options
author | fluffy <fluffy@FreeBSD.org> | 2020-01-02 13:44:14 +0800 |
---|---|---|
committer | fluffy <fluffy@FreeBSD.org> | 2020-01-02 13:44:14 +0800 |
commit | 5c985724b1547ab1e25eecfa8e4d05279ab745b6 (patch) | |
tree | d842378416e3a9b29b4f346340cdcf3fa3b0b3f7 | |
parent | c46488740f911a3f981ecc228f27757e08705943 (diff) | |
download | freebsd-ports-gnome-5c985724b1547ab1e25eecfa8e4d05279ab745b6.tar.gz freebsd-ports-gnome-5c985724b1547ab1e25eecfa8e4d05279ab745b6.tar.zst freebsd-ports-gnome-5c985724b1547ab1e25eecfa8e4d05279ab745b6.zip |
databases/percona57-*: Fix build for i386
Make build-script assume that FreeBSD's Clang doesn't
have "atomic_*" functions builtin implemented on i386
While here, allow to build on DragonFly BSD and
drop "-fabi-version=2" from C/CXX flags
Reported by: pkg-fallout
MFH: 2020Q1
9 files changed, 198 insertions, 4 deletions
diff --git a/databases/percona57-client/files/patch-cmake_build__configurations_compiler__options.cmake b/databases/percona57-client/files/patch-cmake_build__configurations_compiler__options.cmake new file mode 100644 index 000000000000..713c197992bc --- /dev/null +++ b/databases/percona57-client/files/patch-cmake_build__configurations_compiler__options.cmake @@ -0,0 +1,20 @@ +--- cmake/build_configurations/compiler_options.cmake.orig 2016-08-25 11:52:06 UTC ++++ cmake/build_configurations/compiler_options.cmake +@@ -29,7 +29,7 @@ IF(UNIX) + + # Default GCC flags + IF(CMAKE_COMPILER_IS_GNUCC) +- SET(COMMON_C_FLAGS "-g -fabi-version=2 -fno-omit-frame-pointer -fno-strict-aliasing") ++ SET(COMMON_C_FLAGS "-g -fno-omit-frame-pointer -fno-strict-aliasing") + # Disable inline optimizations for valgrind testing to avoid false positives + IF(WITH_VALGRIND) + SET(COMMON_C_FLAGS "-fno-inline ${COMMON_C_FLAGS}") +@@ -42,7 +42,7 @@ IF(UNIX) + SET(CMAKE_C_FLAGS_RELWITHDEBINFO "-O3 ${COMMON_C_FLAGS}") + ENDIF() + IF(CMAKE_COMPILER_IS_GNUCXX) +- SET(COMMON_CXX_FLAGS "-g -fabi-version=2 -fno-omit-frame-pointer -fno-strict-aliasing") ++ SET(COMMON_CXX_FLAGS "-g -fno-omit-frame-pointer -fno-strict-aliasing") + # GCC 6 has C++14 as default, set it explicitly to the old default. + EXECUTE_PROCESS(COMMAND ${CMAKE_CXX_COMPILER} -dumpversion + OUTPUT_VARIABLE GXX_VERSION) diff --git a/databases/percona57-client/files/patch-cmake_os_DragonFly.cmake b/databases/percona57-client/files/patch-cmake_os_DragonFly.cmake new file mode 100644 index 000000000000..83c154ee3bcf --- /dev/null +++ b/databases/percona57-client/files/patch-cmake_os_DragonFly.cmake @@ -0,0 +1,27 @@ +--- cmake/os/DragonFly.cmake.orig 2016-04-14 10:16:17 UTC ++++ cmake/os/DragonFly.cmake +@@ -0,0 +1,24 @@ ++INCLUDE(CheckCSourceRuns) ++ ++# We require at least GCC 4.4 or Clang 3.3. ++IF(NOT FORCE_UNSUPPORTED_COMPILER) ++ IF(CMAKE_COMPILER_IS_GNUCC) ++ EXECUTE_PROCESS(COMMAND ${CMAKE_C_COMPILER} -dumpversion ++ OUTPUT_VARIABLE GCC_VERSION) ++ IF(GCC_VERSION VERSION_LESS 4.4) ++ MESSAGE(FATAL_ERROR "GCC 4.4 or newer is required!") ++ ENDIF() ++ ELSEIF(CMAKE_C_COMPILER_ID MATCHES "Clang") ++ CHECK_C_SOURCE_RUNS(" ++ int main() ++ { ++ return (__clang_major__ < 3) || ++ (__clang_major__ == 3 && __clang_minor__ < 3); ++ }" HAVE_SUPPORTED_CLANG_VERSION) ++ IF(NOT HAVE_SUPPORTED_CLANG_VERSION) ++ MESSAGE(FATAL_ERROR "Clang 3.3 or newer is required!") ++ ENDIF() ++ ELSE() ++ MESSAGE(FATAL_ERROR "Unsupported compiler!") ++ ENDIF() ++ENDIF() diff --git a/databases/percona57-client/files/patch-cmake_os_FreeBSD.cmake b/databases/percona57-client/files/patch-cmake_os_FreeBSD.cmake index 9746d92fdfde..9e9043f341ae 100644 --- a/databases/percona57-client/files/patch-cmake_os_FreeBSD.cmake +++ b/databases/percona57-client/files/patch-cmake_os_FreeBSD.cmake @@ -1,11 +1,25 @@ ---- cmake/os/FreeBSD.cmake.orig 2018-09-27 09:15:26 UTC +--- cmake/os/FreeBSD.cmake.orig 2018-10-04 05:48:22 UTC +++ cmake/os/FreeBSD.cmake -@@ -30,8 +30,6 @@ IF(NOT FORCE_UNSUPPORTED_COMPILER) +@@ -37,8 +37,20 @@ IF(NOT FORCE_UNSUPPORTED_COMPILER) IF(NOT HAVE_SUPPORTED_CLANG_VERSION) MESSAGE(FATAL_ERROR "Clang 3.3 or newer is required!") ENDIF() - ELSE() - MESSAGE(FATAL_ERROR "Unsupported compiler!") ++ CHECK_C_SOURCE_RUNS(" ++ int main() ++ { ++ return (__clang_major__ >= 4); ++ }" I386_ATOMIC_BUILTINS) ++ IF((CMAKE_SYSTEM_PROCESSOR MATCHES "i386") AND (NOT I386_ATOMIC_BUILTINS)) ++ SET(HAVE_GCC_ATOMIC_BUILTINS CACHE INTERNAL "") ++ ENDIF() ++ ELSEIF(CMAKE_COMPILER_IS_GNUCC) ++ EXECUTE_PROCESS(COMMAND ${CMAKE_C_COMPILER} -dumpversion ++ OUTPUT_VARIABLE GCC_VERSION) ++ IF(GCC_VERSION VERSION_LESS 4.4) ++ MESSAGE(FATAL_ERROR "GCC 4.4 or newer is required!") ++ ENDIF() ENDIF() ENDIF() diff --git a/databases/percona57-pam-for-mysql/files/patch-cmake_build__configurations_compiler__options.cmake b/databases/percona57-pam-for-mysql/files/patch-cmake_build__configurations_compiler__options.cmake new file mode 100644 index 000000000000..713c197992bc --- /dev/null +++ b/databases/percona57-pam-for-mysql/files/patch-cmake_build__configurations_compiler__options.cmake @@ -0,0 +1,20 @@ +--- cmake/build_configurations/compiler_options.cmake.orig 2016-08-25 11:52:06 UTC ++++ cmake/build_configurations/compiler_options.cmake +@@ -29,7 +29,7 @@ IF(UNIX) + + # Default GCC flags + IF(CMAKE_COMPILER_IS_GNUCC) +- SET(COMMON_C_FLAGS "-g -fabi-version=2 -fno-omit-frame-pointer -fno-strict-aliasing") ++ SET(COMMON_C_FLAGS "-g -fno-omit-frame-pointer -fno-strict-aliasing") + # Disable inline optimizations for valgrind testing to avoid false positives + IF(WITH_VALGRIND) + SET(COMMON_C_FLAGS "-fno-inline ${COMMON_C_FLAGS}") +@@ -42,7 +42,7 @@ IF(UNIX) + SET(CMAKE_C_FLAGS_RELWITHDEBINFO "-O3 ${COMMON_C_FLAGS}") + ENDIF() + IF(CMAKE_COMPILER_IS_GNUCXX) +- SET(COMMON_CXX_FLAGS "-g -fabi-version=2 -fno-omit-frame-pointer -fno-strict-aliasing") ++ SET(COMMON_CXX_FLAGS "-g -fno-omit-frame-pointer -fno-strict-aliasing") + # GCC 6 has C++14 as default, set it explicitly to the old default. + EXECUTE_PROCESS(COMMAND ${CMAKE_CXX_COMPILER} -dumpversion + OUTPUT_VARIABLE GXX_VERSION) diff --git a/databases/percona57-pam-for-mysql/files/patch-cmake_os_DragonFly.cmake b/databases/percona57-pam-for-mysql/files/patch-cmake_os_DragonFly.cmake new file mode 100644 index 000000000000..83c154ee3bcf --- /dev/null +++ b/databases/percona57-pam-for-mysql/files/patch-cmake_os_DragonFly.cmake @@ -0,0 +1,27 @@ +--- cmake/os/DragonFly.cmake.orig 2016-04-14 10:16:17 UTC ++++ cmake/os/DragonFly.cmake +@@ -0,0 +1,24 @@ ++INCLUDE(CheckCSourceRuns) ++ ++# We require at least GCC 4.4 or Clang 3.3. ++IF(NOT FORCE_UNSUPPORTED_COMPILER) ++ IF(CMAKE_COMPILER_IS_GNUCC) ++ EXECUTE_PROCESS(COMMAND ${CMAKE_C_COMPILER} -dumpversion ++ OUTPUT_VARIABLE GCC_VERSION) ++ IF(GCC_VERSION VERSION_LESS 4.4) ++ MESSAGE(FATAL_ERROR "GCC 4.4 or newer is required!") ++ ENDIF() ++ ELSEIF(CMAKE_C_COMPILER_ID MATCHES "Clang") ++ CHECK_C_SOURCE_RUNS(" ++ int main() ++ { ++ return (__clang_major__ < 3) || ++ (__clang_major__ == 3 && __clang_minor__ < 3); ++ }" HAVE_SUPPORTED_CLANG_VERSION) ++ IF(NOT HAVE_SUPPORTED_CLANG_VERSION) ++ MESSAGE(FATAL_ERROR "Clang 3.3 or newer is required!") ++ ENDIF() ++ ELSE() ++ MESSAGE(FATAL_ERROR "Unsupported compiler!") ++ ENDIF() ++ENDIF() diff --git a/databases/percona57-pam-for-mysql/files/patch-cmake_os_FreeBSD.cmake b/databases/percona57-pam-for-mysql/files/patch-cmake_os_FreeBSD.cmake new file mode 100644 index 000000000000..9e9043f341ae --- /dev/null +++ b/databases/percona57-pam-for-mysql/files/patch-cmake_os_FreeBSD.cmake @@ -0,0 +1,25 @@ +--- cmake/os/FreeBSD.cmake.orig 2018-10-04 05:48:22 UTC ++++ cmake/os/FreeBSD.cmake +@@ -37,8 +37,20 @@ IF(NOT FORCE_UNSUPPORTED_COMPILER) + IF(NOT HAVE_SUPPORTED_CLANG_VERSION) + MESSAGE(FATAL_ERROR "Clang 3.3 or newer is required!") + ENDIF() +- ELSE() +- MESSAGE(FATAL_ERROR "Unsupported compiler!") ++ CHECK_C_SOURCE_RUNS(" ++ int main() ++ { ++ return (__clang_major__ >= 4); ++ }" I386_ATOMIC_BUILTINS) ++ IF((CMAKE_SYSTEM_PROCESSOR MATCHES "i386") AND (NOT I386_ATOMIC_BUILTINS)) ++ SET(HAVE_GCC_ATOMIC_BUILTINS CACHE INTERNAL "") ++ ENDIF() ++ ELSEIF(CMAKE_COMPILER_IS_GNUCC) ++ EXECUTE_PROCESS(COMMAND ${CMAKE_C_COMPILER} -dumpversion ++ OUTPUT_VARIABLE GCC_VERSION) ++ IF(GCC_VERSION VERSION_LESS 4.4) ++ MESSAGE(FATAL_ERROR "GCC 4.4 or newer is required!") ++ ENDIF() + ENDIF() + ENDIF() + diff --git a/databases/percona57-server/files/patch-cmake_build__configurations_compiler__options.cmake b/databases/percona57-server/files/patch-cmake_build__configurations_compiler__options.cmake new file mode 100644 index 000000000000..713c197992bc --- /dev/null +++ b/databases/percona57-server/files/patch-cmake_build__configurations_compiler__options.cmake @@ -0,0 +1,20 @@ +--- cmake/build_configurations/compiler_options.cmake.orig 2016-08-25 11:52:06 UTC ++++ cmake/build_configurations/compiler_options.cmake +@@ -29,7 +29,7 @@ IF(UNIX) + + # Default GCC flags + IF(CMAKE_COMPILER_IS_GNUCC) +- SET(COMMON_C_FLAGS "-g -fabi-version=2 -fno-omit-frame-pointer -fno-strict-aliasing") ++ SET(COMMON_C_FLAGS "-g -fno-omit-frame-pointer -fno-strict-aliasing") + # Disable inline optimizations for valgrind testing to avoid false positives + IF(WITH_VALGRIND) + SET(COMMON_C_FLAGS "-fno-inline ${COMMON_C_FLAGS}") +@@ -42,7 +42,7 @@ IF(UNIX) + SET(CMAKE_C_FLAGS_RELWITHDEBINFO "-O3 ${COMMON_C_FLAGS}") + ENDIF() + IF(CMAKE_COMPILER_IS_GNUCXX) +- SET(COMMON_CXX_FLAGS "-g -fabi-version=2 -fno-omit-frame-pointer -fno-strict-aliasing") ++ SET(COMMON_CXX_FLAGS "-g -fno-omit-frame-pointer -fno-strict-aliasing") + # GCC 6 has C++14 as default, set it explicitly to the old default. + EXECUTE_PROCESS(COMMAND ${CMAKE_CXX_COMPILER} -dumpversion + OUTPUT_VARIABLE GXX_VERSION) diff --git a/databases/percona57-server/files/patch-cmake_os_DragonFly.cmake b/databases/percona57-server/files/patch-cmake_os_DragonFly.cmake new file mode 100644 index 000000000000..83c154ee3bcf --- /dev/null +++ b/databases/percona57-server/files/patch-cmake_os_DragonFly.cmake @@ -0,0 +1,27 @@ +--- cmake/os/DragonFly.cmake.orig 2016-04-14 10:16:17 UTC ++++ cmake/os/DragonFly.cmake +@@ -0,0 +1,24 @@ ++INCLUDE(CheckCSourceRuns) ++ ++# We require at least GCC 4.4 or Clang 3.3. ++IF(NOT FORCE_UNSUPPORTED_COMPILER) ++ IF(CMAKE_COMPILER_IS_GNUCC) ++ EXECUTE_PROCESS(COMMAND ${CMAKE_C_COMPILER} -dumpversion ++ OUTPUT_VARIABLE GCC_VERSION) ++ IF(GCC_VERSION VERSION_LESS 4.4) ++ MESSAGE(FATAL_ERROR "GCC 4.4 or newer is required!") ++ ENDIF() ++ ELSEIF(CMAKE_C_COMPILER_ID MATCHES "Clang") ++ CHECK_C_SOURCE_RUNS(" ++ int main() ++ { ++ return (__clang_major__ < 3) || ++ (__clang_major__ == 3 && __clang_minor__ < 3); ++ }" HAVE_SUPPORTED_CLANG_VERSION) ++ IF(NOT HAVE_SUPPORTED_CLANG_VERSION) ++ MESSAGE(FATAL_ERROR "Clang 3.3 or newer is required!") ++ ENDIF() ++ ELSE() ++ MESSAGE(FATAL_ERROR "Unsupported compiler!") ++ ENDIF() ++ENDIF() diff --git a/databases/percona57-server/files/patch-cmake_os_FreeBSD.cmake b/databases/percona57-server/files/patch-cmake_os_FreeBSD.cmake index 69ba328de060..9e9043f341ae 100644 --- a/databases/percona57-server/files/patch-cmake_os_FreeBSD.cmake +++ b/databases/percona57-server/files/patch-cmake_os_FreeBSD.cmake @@ -1,11 +1,25 @@ ---- cmake/os/FreeBSD.cmake.orig 2018-12-16 19:27:57 UTC +--- cmake/os/FreeBSD.cmake.orig 2018-10-04 05:48:22 UTC +++ cmake/os/FreeBSD.cmake -@@ -30,8 +30,6 @@ IF(NOT FORCE_UNSUPPORTED_COMPILER) +@@ -37,8 +37,20 @@ IF(NOT FORCE_UNSUPPORTED_COMPILER) IF(NOT HAVE_SUPPORTED_CLANG_VERSION) MESSAGE(FATAL_ERROR "Clang 3.3 or newer is required!") ENDIF() - ELSE() - MESSAGE(FATAL_ERROR "Unsupported compiler!") ++ CHECK_C_SOURCE_RUNS(" ++ int main() ++ { ++ return (__clang_major__ >= 4); ++ }" I386_ATOMIC_BUILTINS) ++ IF((CMAKE_SYSTEM_PROCESSOR MATCHES "i386") AND (NOT I386_ATOMIC_BUILTINS)) ++ SET(HAVE_GCC_ATOMIC_BUILTINS CACHE INTERNAL "") ++ ENDIF() ++ ELSEIF(CMAKE_COMPILER_IS_GNUCC) ++ EXECUTE_PROCESS(COMMAND ${CMAKE_C_COMPILER} -dumpversion ++ OUTPUT_VARIABLE GCC_VERSION) ++ IF(GCC_VERSION VERSION_LESS 4.4) ++ MESSAGE(FATAL_ERROR "GCC 4.4 or newer is required!") ++ ENDIF() ENDIF() ENDIF() |