Trying to link a binary against libc++ will result in a linker error due to missing libunwind: ``` # echo "int main(){return 0 ;}" | clang++ -x c++ --stdlib=libc++ -o test - /usr/bin/ld: cannot find -lunwind: No such file or directory clang++: error: linker command failed with exit code 1 (use -v to see invocation) ``` However libunwind.so.1 is installed and resolved by ldd: ``` # ldd /usr/lib64/libc++.so.1 linux-vdso64.so.1 (0x000003ffcdbfe000) libc++abi.so.1 => /lib64/libc++abi.so.1 (0x000003ffad280000) libunwind.so.1 => /lib64/libunwind.so.1 (0x000003ffad200000) libc.so.6 => /lib64/libc.so.6 (0x000003ffad000000) /lib/ld64.so.1 (0x000003ffad500000) # rpm -qf /lib64/libunwind.so.1 llvm-libunwind-18.1.0~rc4-1.fc41.s390x ``` If installing `llvm-libunwind-devel` (not installed through deps of libcxx), and we pass the lib directory that it provides, the linkage succeeds: ``` # echo "int main(){return 0 ;}" | clang++ -L/usr/lib64/llvm-unwind -x c++ --stdlib=libc++ -o test - # rpm -qf /usr/lib64/llvm-unwind/libunwind.so llvm-libunwind-devel-18.1.0~rc4-1.fc41.s390x ``` Reproducible: Always Steps to Reproduce: 1. dnf install clang libcxx-devel 2. echo "int main(){return 0 ;}" | clang++ -v -x c++ --stdlib=libc++ -o test - Actual Results: /usr/bin/ld: cannot find -lunwind: No such file or directory clang++: error: linker command failed with exit code 1 (use -v to see invocation) Expected Results: Link successfully Reproduced in x86_64 and s390x, not tested in aarch64 and ppc64le. Installed packages: # rpm -q clang libcxx llvm-libunwind clang-18.1.0~rc4-2.fc41.s390x libcxx-18.1.0~rc4-1.fc41.s390x llvm-libunwind-18.1.0~rc4-1.fc41.s390x
I believe that https://src.fedoraproject.org/rpms/libcxx/pull-request/49 should fix this.
FEDORA-2024-afa3476463 (libcxx-18.1.0~rc4-2.fc41) has been submitted as an update to Fedora 41. https://bodhi.fedoraproject.org/updates/FEDORA-2024-afa3476463
FEDORA-2024-afa3476463 (libcxx-18.1.0~rc4-2.fc41) has been pushed to the Fedora 41 stable repository. If problem still persists, please make note of it in this bug report.