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
This commit is contained in:
Dima Panov 2020-01-02 05:44:14 +00:00
parent c9be63707f
commit 88879d0ad8
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=521796
9 changed files with 198 additions and 4 deletions

View file

@ -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)

View file

@ -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()

View file

@ -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()

View file

@ -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)

View file

@ -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()

View file

@ -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()

View file

@ -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)

View file

@ -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()

View file

@ -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()