[libcxx-commits] [PATCH] D95875: [SystemZ][ZOS] Prefer -nostdlib++ as opposed to -nodefaultlibs when building c++ libraries
Harald van Dijk via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Sun Oct 17 05:44:18 PDT 2021
hvdijk added a comment.
In D95875#2565670 <https://reviews.llvm.org/D95875#2565670>, @ldionne wrote:
> I think this is good for libunwind too
It's not, depending on how clang is configured this can cause the libunwind build to fail because clang now tries to link libunwind against itself. `-nodefaultlibs` prevents that, `-nostdlib++` does not.
/usr/bin/clang -m64 -fPIC -O2 --target=x86_64-unknown-linux-gnu -DNDEBUG --target=x86_64-unknown-linux-gnu -rtlib=compiler-rt -nostdlib++ -Wl,-O1 -Wl,--as-needed -s -shared -Wl,-soname,libunwind.so.1 -o ../lib/x86_64-linux-gnu/libunwind.so.1.0 CMakeFiles/unwind_shared.dir/libunwind.cpp.o CMakeFiles/unwind_shared.dir/Unwind-EHABI.cpp.o CMakeFiles/unwind_shared.dir/Unwind-seh.cpp.o CMakeFiles/unwind_shared.dir/UnwindLevel1.c.o CMakeFiles/unwind_shared.dir/UnwindLevel1-gcc-ext.c.o CMakeFiles/unwind_shared.dir/Unwind-sjlj.c.o CMakeFiles/unwind_shared.dir/UnwindRegistersRestore.S.o CMakeFiles/unwind_shared.dir/UnwindRegistersSave.S.o -lc /usr/lib/clang/13.0.0/lib/linux/libclang_rt.builtins-x86_64.a -ldl -lpthread
ld.lld: error: unable to find library -l:libunwind.so
ld.lld: error: unable to find library -l:libunwind.so
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Would there be any objections to reverting this change for libunwind, or do you prefer to fix this some other way?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D95875/new/
https://reviews.llvm.org/D95875
More information about the libcxx-commits
mailing list