Commit 68916bca authored by Sergei Golubchik's avatar Sergei Golubchik

workaround for xtradb on gcc 4.1.2 RHEL5/x86, gcc atomic ops only work under -march=i686

parent a5fdd759
...@@ -59,6 +59,12 @@ CHECK_FUNCTION_EXISTS(sched_getcpu HAVE_SCHED_GETCPU) ...@@ -59,6 +59,12 @@ CHECK_FUNCTION_EXISTS(sched_getcpu HAVE_SCHED_GETCPU)
IF(NOT MSVC) IF(NOT MSVC)
# either define HAVE_IB_GCC_ATOMIC_BUILTINS or not # either define HAVE_IB_GCC_ATOMIC_BUILTINS or not
IF(NOT CMAKE_CROSSCOMPILING) IF(NOT CMAKE_CROSSCOMPILING)
# workaround for gcc 4.1.2 RHEL5/x86, gcc atomic ops only work under -march=i686
IF(CMAKE_SYSTEM_PROCESSOR STREQUAL "i686" AND CMAKE_COMPILER_IS_GNUCC AND
CMAKE_C_COMPILER_VERSION VERSION_LESS "4.1.3")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -march=i686")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=i686")
ENDIF()
CHECK_C_SOURCE_RUNS( CHECK_C_SOURCE_RUNS(
" "
int main() int main()
......
...@@ -65,6 +65,12 @@ CHECK_FUNCTION_EXISTS(sched_getcpu HAVE_SCHED_GETCPU) ...@@ -65,6 +65,12 @@ CHECK_FUNCTION_EXISTS(sched_getcpu HAVE_SCHED_GETCPU)
IF(NOT MSVC) IF(NOT MSVC)
# either define HAVE_IB_GCC_ATOMIC_BUILTINS or not # either define HAVE_IB_GCC_ATOMIC_BUILTINS or not
IF(NOT CMAKE_CROSSCOMPILING) IF(NOT CMAKE_CROSSCOMPILING)
# workaround for gcc 4.1.2 RHEL5/x86, gcc atomic ops only work under -march=i686
IF(CMAKE_SYSTEM_PROCESSOR STREQUAL "i686" AND CMAKE_COMPILER_IS_GNUCC AND
CMAKE_C_COMPILER_VERSION VERSION_LESS "4.1.3")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -march=i686")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=i686")
ENDIF()
CHECK_C_SOURCE_RUNS( CHECK_C_SOURCE_RUNS(
" "
int main() int main()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment