[PATCH] D57142: [CMake] Use __libc_start_main rather than fopen when checking for C library

Petr Hosek via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jan 27 20:13:07 PST 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rL352341: [CMake] Use __libc_start_main rather than fopen when checking for C library (authored by phosek, committed by ).
Herald added subscribers: llvm-commits, delcypher.

Changed prior to commit:
  https://reviews.llvm.org/D57142?vs=183783&id=183794#toc

Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D57142/new/

https://reviews.llvm.org/D57142

Files:
  compiler-rt/trunk/cmake/config-ix.cmake
  libcxx/trunk/cmake/config-ix.cmake
  libcxxabi/trunk/cmake/config-ix.cmake
  libunwind/trunk/cmake/config-ix.cmake
  llvm/trunk/runtimes/CMakeLists.txt


Index: compiler-rt/trunk/cmake/config-ix.cmake
===================================================================
--- compiler-rt/trunk/cmake/config-ix.cmake
+++ compiler-rt/trunk/cmake/config-ix.cmake
@@ -12,7 +12,7 @@
   cmake_pop_check_state()
 endfunction()
 
-check_library_exists(c fopen "" COMPILER_RT_HAS_LIBC)
+check_library_exists(c __libc_start_main "" COMPILER_RT_HAS_LIBC)
 if (COMPILER_RT_USE_BUILTINS_LIBRARY)
   include(HandleCompilerRT)
   find_compiler_rt_library(builtins COMPILER_RT_BUILTINS_LIBRARY)
Index: libcxx/trunk/cmake/config-ix.cmake
===================================================================
--- libcxx/trunk/cmake/config-ix.cmake
+++ libcxx/trunk/cmake/config-ix.cmake
@@ -7,7 +7,7 @@
   # let the default linking take care of that.
   set(LIBCXX_HAS_C_LIB NO)
 else()
-  check_library_exists(c fopen "" LIBCXX_HAS_C_LIB)
+  check_library_exists(c __libc_start_main "" LIBCXX_HAS_C_LIB)
 endif()
 
 if (NOT LIBCXX_USE_COMPILER_RT)
Index: llvm/trunk/runtimes/CMakeLists.txt
===================================================================
--- llvm/trunk/runtimes/CMakeLists.txt
+++ llvm/trunk/runtimes/CMakeLists.txt
@@ -98,7 +98,7 @@
   include(CheckLibraryExists)
   include(CheckCCompilerFlag)
 
-  check_library_exists(c fopen "" LLVM_HAS_C_LIB)
+  check_library_exists(c __libc_start_main "" LLVM_HAS_C_LIB)
   check_c_compiler_flag(-nodefaultlibs LLVM_HAS_NODEFAULTLIBS_FLAG)
   if(LLVM_HAS_NODEFAULTLIBS_FLAG)
     set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -nodefaultlibs")
Index: libcxxabi/trunk/cmake/config-ix.cmake
===================================================================
--- libcxxabi/trunk/cmake/config-ix.cmake
+++ libcxxabi/trunk/cmake/config-ix.cmake
@@ -2,7 +2,7 @@
 include(CheckCCompilerFlag)
 include(CheckCXXCompilerFlag)
 
-check_library_exists(c fopen "" LIBCXXABI_HAS_C_LIB)
+check_library_exists(c __libc_start_main "" LIBCXXABI_HAS_C_LIB)
 if (NOT LIBCXXABI_USE_COMPILER_RT)
   check_library_exists(gcc_s __gcc_personality_v0 "" LIBCXXABI_HAS_GCC_S_LIB)
 endif ()
Index: libunwind/trunk/cmake/config-ix.cmake
===================================================================
--- libunwind/trunk/cmake/config-ix.cmake
+++ libunwind/trunk/cmake/config-ix.cmake
@@ -3,7 +3,7 @@
 include(CheckCXXCompilerFlag)
 include(CheckLibraryExists)
 
-check_library_exists(c fopen "" LIBUNWIND_HAS_C_LIB)
+check_library_exists(c __libc_start_main "" LIBUNWIND_HAS_C_LIB)
 
 if (NOT LIBUNWIND_USE_COMPILER_RT)
   check_library_exists(gcc_s __gcc_personality_v0 "" LIBUNWIND_HAS_GCC_S_LIB)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D57142.183794.patch
Type: text/x-patch
Size: 2564 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190128/e3f44d41/attachment.bin>


More information about the llvm-commits mailing list