[PATCH] D58013: [compiler-rt] Build custom libcxx with libcxxabi

Petr Hosek via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Feb 17 14:50:40 PST 2019


phosek added a comment.

I found the issue, but I don't know how to easily solve this. The problem is that when being built in standalone mode, libc++abi and libc++ includes LLVM's `HandleLLVMOptions` which uses checks that try to link C++ library, but that may not be ready yet in case of the runtimes build. In runtimes build I solve this by adding `-nostdlib++` to required flags <https://github.com/llvm/llvm-project/blob/master/llvm/runtimes/CMakeLists.txt#L100>. I can do that because in case of runtimes build I know that we'll be always using the just built Clang that supports that flag. I could address this issue by also including `-nostdlib++` in required flags in `compiler-rt/cmake/Modules/CustomLibcxx/CMakeLists.txt` but that's not a general solution because that file in theory also supports other compilers that may not have this flag (older Clang versions, GCC). We could try and use `-nostdlib` and then include builtins manually but that's a lot of extra code that would need to be duplicated <https://github.com/llvm/llvm-project/blob/master/compiler-rt/cmake/config-ix.cmake#L18> to handle cases like compiler-rt builtins and libgcc.

The general solution is to stop relying on checks that assume working C++ library from runtimes (it's where we're building C++ library after all, we should assume a working C++ library), but that's going to require more significant refactor and I'd like to unbreak our bots ASAP so we'll need some other solution.


Repository:
  rCRT Compiler Runtime

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

https://reviews.llvm.org/D58013





More information about the llvm-commits mailing list