llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
29.17k stars 12.03k forks source link

LLD 17.0.6 does not set VERDEF when linking ELF libraries #83614

Open GoGoOtaku opened 8 months ago

GoGoOtaku commented 8 months ago

I tested both with and without LTO. I used clang to compile objects and the entire LLVM toolchain is on 17.0.6. This affects every shared object I tested this on.

For reference: Gentoo Linux on x86_64 Version 17.0.6 None specific LD flags used: -Wl,-O3 -Wl,--as-needed -fuse-ld=lld

Gentoo does not inject any patches. LLD is build with NDEBUG set and ZSTD support. I did rebuild LLD just to see if anything went wrong on the build process. LLD was build using Clang and LLD.

All build libraries still work but the dynamic linker is obviously not happy about this and sends messages like: /usr/bin/cmake: //usr/lib64/libgnutls.so.30: no version information available (required by /usr/lib64/libcurl.so.4)

I tested both gold and mold (with clang LTO objects) and both link just fine with VERDEF set.

llvmbot commented 8 months ago

@llvm/issue-subscribers-lld-elf

Author: GoGo de Sica (GoGoOtaku)

I tested both with and without LTO. I used clang to compile objects and the entire LLVM toolchain is on 17.0.6. This affects every shared object I tested this on. For reference: Gentoo Linux on x86_64 Version 17.0.6 None specific LD flags used: `-Wl,-O3 -Wl,--as-needed -fuse-ld=lld` Gentoo does not inject any patches. LLD is build with NDEBUG set and ZSTD support. I did rebuild LLD just to see if anything went wrong on the build process. LLD was build using Clang and LLD. All build libraries still work but the dynamic linker is obviously not happy about this and sends messages like: `/usr/bin/cmake: //usr/lib64/libgnutls.so.30: no version information available (required by /usr/lib64/libcurl.so.4)` I tested both gold and mold (with clang LTO objects) and both link just fine with VERDEF set.