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

Marshall Clow via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 28 14:47:18 PST 2019


mclow.lists added a comment.

This change breaks building on Mac OS X - at least for libc++.
The user visible failure is:

  -- Performing Test LIBCXX_SUPPORTS_STD_EQ_CXX11_FLAG
  -- Performing Test LIBCXX_SUPPORTS_STD_EQ_CXX11_FLAG - Failed
  -- Performing Test LIBCXX_SUPPORTS_STD_COLON_CXX11_FLAG
  -- Performing Test LIBCXX_SUPPORTS_STD_COLON_CXX11_FLAG - Failed
  CMake Error at CMakeLists.txt:526 (message):
    C++11 or greater is required but the compiler does not support c++11

and in the log, I see:

  Performing C++ SOURCE FILE Test LIBCXX_SUPPORTS_STD_EQ_CXX11_FLAG failed with the following output:
  Change Dir: /Sources/LLVM/build/test-libcxx/CMakeFiles/CMakeTmp
  
  Run Build Command:"/usr/local/bin/ninja" "cmTC_4ab59"
  [1/2] Building CXX object CMakeFiles/cmTC_4ab59.dir/src.cxx.o
  [2/2] Linking CXX executable cmTC_4ab59
  FAILED: cmTC_4ab59 
  : && /Sources/LLVM/bin/bin/clang++  -DLIBCXX_SUPPORTS_STD_EQ_CXX11_FLAG  -nodefaultlibs -Wl,-search_paths_first -Wl,-headerpad_max_install_names  CMakeFiles/cmTC_4ab59.dir/src.cxx.o  -o cmTC_4ab59   && :
  ld: dynamic main executables must link with libSystem.dylib for architecture x86_64
  clang-9: error: linker command failed with exit code 1 (use -v to see invocation)
  ninja: build stopped: subcommand failed.
  
  Source file was:
  int main() { return 0; }


Repository:
  rL LLVM

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

https://reviews.llvm.org/D57142





More information about the llvm-commits mailing list