Created attachment 882395 [details] source code clang++-17 -o t1.so -shared -stdlib=libc++ -static-libstdc++ t1.cpp fails with /usr/bin/x86_64-pc-linux-gnu-ld.bfd: /usr/lib/gcc/x86_64-pc-linux-gnu/11/../../../../lib64/libc++abi.a(stdlib_typeinfo.cpp.o): warning: relocation against `_ZTVSt8bad_cast' in read-only section `.text._ZNSt8bad_castC2Ev' /usr/bin/x86_64-pc-linux-gnu-ld.bfd: /usr/lib/gcc/x86_64-pc-linux-gnu/11/../../../../lib64/libc++abi.a(private_typeinfo.cpp.o): relocation R_X86_64_PC32 against symbol `_ZTIN10__cxxabiv116__shim_type_infoE' can not be used when making a shared object; recompile with -fPIC /usr/bin/x86_64-pc-linux-gnu-ld.bfd: final link failed: bad value clang++-17: error: linker command failed with exit code 1 (use -v to see invocation) Apparently, static libcxx and libcxxabi are built without -fPIC. Omitting either -stdlib=libc++ or -static-libstdc++ makes the problem go away, but I need both.
*** Bug 918946 has been marked as a duplicate of this bug. ***