Issue 139771
Summary [Runtimes] -nostdlib++ and -nostdinc++ in CMAKE_REQUIRED_FLAGS breaks systems introspection
Labels new issue
Assignees rnk, mstorsjo, petrhosek, MaskRay, ldionne, vitalybuka
Reporter Meinersbur
    The flags `-nostdlib++` and `-nostdinc++` are added to CMAKE_REQUIRED_FLAGS whenever supported by the compiler:

https://github.com/llvm/llvm-project/blob/dcd5e476d91da267f49b837c07a84df43b1800cd/runtimes/CMakeLists.txt#L161
https://github.com/llvm/llvm-project/blob/dcd5e476d91da267f49b837c07a84df43b1800cd/runtimes/CMakeLists.txt#L157

For a normal bootstrapping build the compiler is Clang, so it will always be added. It inherits to all runtimes libraries.

While it may make sense for libc++ to not depend on itself or another C++ standard library, the assumption breaks for any other LLVM runtime library that use C++, which included any GTest-based unittests. Tracking its history, it seems to have first been added in d3ebe7126bbff92bb6d9d2c6ed563316e5816f0b, but just temporarily. The temporary part was dropped at some point. The flags should only be added in those libraries that need it. 

Adding those flags globally for all runtimes causes problems in system introspection. e.g.:
 * OpenMP: #90332
 * Flang-RT: #139712
 * Flang-RT: #131010
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to