[llvm] [runtimes] Append `-nostd*++` flags only if necessary (PR #151930)
Michał Górny via llvm-commits
llvm-commits at lists.llvm.org
Mon Aug 4 06:14:26 PDT 2025
mgorny wrote:
That's my understanding — we're adding them, so CMake checks don't fail prior to the runtimes being built.
Unfortunately, looks like my idea breaks some stuff still. That said, I'm not 100% convinced it just doesn't reveal an existing bug:
```
Performing C++ SOURCE FILE Test CXX_SUPPORTS_NOSTDINCXX_FLAG failed with the following output:
Change Dir: /home/runner/_work/llvm-project/llvm-project/build/generic-asan/CMakeFiles/CMakeTmp
Run Build Command(s):/usr/local/bin/ninja cmTC_779c6 && [1/2] Building CXX object CMakeFiles/cmTC_779c6.dir/src.cxx.o
[2/2] Linking CXX executable cmTC_779c6
FAILED: cmTC_779c6
: && /usr/bin/clang++-21 -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fno-omit-frame-pointer -fsanitize=address -fdiagnostics-color -ffunction-sections -fdata-sections --start-no-unused-arguments --unwindlib=none --end-no-unused-arguments CMakeFiles/cmTC_779c6.dir/src.cxx.o -o cmTC_779c6 && :
/usr/bin/ld: /usr/lib/llvm-21/lib/clang/21/lib/linux/libclang_rt.asan-x86_64.a(sanitizer_unwind_linux_libcdep.cpp.o): undefined reference to symbol '_Unwind_Backtrace@@GCC_3.3'
/usr/bin/ld: /lib/x86_64-linux-gnu/libgcc_s.so.1: error adding symbols: DSO missing from command line
clang++-21: error: linker command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed.
```
I'm guessing that the code relied on `-nostdlib++` just hiding the issue.
https://github.com/llvm/llvm-project/pull/151930
More information about the llvm-commits
mailing list