Index: llvm/trunk/cmake/config-ix.cmake =================================================================== --- llvm/trunk/cmake/config-ix.cmake +++ llvm/trunk/cmake/config-ix.cmake @@ -17,7 +17,7 @@ if( UNIX AND NOT (BEOS OR HAIKU) ) # Used by check_symbol_exists: - set(CMAKE_REQUIRED_LIBRARIES m) + list(APPEND CMAKE_REQUIRED_LIBRARIES "m") endif() # x86_64 FreeBSD 9.2 requires libcxxrt to be specified explicitly. if( CMAKE_SYSTEM MATCHES "FreeBSD-9.2-RELEASE" AND Index: llvm/trunk/cmake/modules/CheckAtomic.cmake =================================================================== --- llvm/trunk/cmake/modules/CheckAtomic.cmake +++ llvm/trunk/cmake/modules/CheckAtomic.cmake @@ -8,7 +8,7 @@ function(check_working_cxx_atomics varname) set(OLD_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS}) - set(CMAKE_REQUIRED_FLAGS "-std=c++11") + set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -std=c++11") CHECK_CXX_SOURCE_COMPILES(" #include std::atomic x; Index: llvm/trunk/cmake/modules/CheckCompilerVersion.cmake =================================================================== --- llvm/trunk/cmake/modules/CheckCompilerVersion.cmake +++ llvm/trunk/cmake/modules/CheckCompilerVersion.cmake @@ -28,7 +28,7 @@ # bug in libstdc++4.6 that is fixed in libstdc++4.7. set(OLD_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS}) set(OLD_CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES}) - set(CMAKE_REQUIRED_FLAGS "-std=c++0x") + set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -std=c++0x") check_cxx_source_compiles(" #include std::atomic x(0.0f);