]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
cmake: should check the availability of aligned_alloc() by running the test 18645/head
authorKefu Chai <kchai@redhat.com>
Tue, 31 Oct 2017 09:39:02 +0000 (17:39 +0800)
committerKefu Chai <kchai@redhat.com>
Tue, 31 Oct 2017 09:39:09 +0000 (17:39 +0800)
this mimics the failure of rocksdb without a working
aligned_alloc()/free().

Signed-off-by: Kefu Chai <kchai@redhat.com>
cmake/modules/BuildRocksDB.cmake

index da6e18d04e0878029439555867c189f853538eec..d62f7458058ee9e8943a1b2675a6144ab2e1f50e 100644 (file)
@@ -1,4 +1,4 @@
-include(CheckCXXSourceCompiles)
+include(CheckCXXSourceRuns)
 
 function(do_build_rocksdb)
     set(ROCKSDB_CMAKE_ARGS -DCMAKE_POSITION_INDEPENDENT_CODE=ON)
@@ -42,13 +42,13 @@ endfunction()
 
 function(check_aligned_alloc)
   set(SAVE_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS})
-  set(CMAKE_REQUIRED_FLAGS "-std=c++11 -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free -nostdlib")
+  set(CMAKE_REQUIRED_FLAGS "-std=c++11 -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free")
   if(LINUX)
     set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -D_GNU_SOURCE")
   endif()
   set(SAVE_CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES})
   set(CMAKE_REQUIRED_LIBRARIES ${GPERFTOOLS_TCMALLOC_LIBRARY})
-  CHECK_CXX_SOURCE_COMPILES("
+  CHECK_CXX_SOURCE_RUNS("
 #include <stdlib.h>
 
 int main()