Skip to content

--icf=safe warnings when using sanitizers on Ubuntu due to strip #98354

Open
@Trass3r

Description

@Trass3r
LDFLAGS="-fsanitize=leak -fuse-ld=lld -Xlinker --icf=safe"
clang++ -o ...
ld.lld: warning: /usr/lib/llvm-18/lib/clang/18/lib/linux/libclang_rt.lsan-x86_64.a(interception_linux.cpp.o):
        --icf=safe conservatively ignores SHT_LLVM_ADDRSIG [index 10] with sh_link=0 (likely created using objcopy or ld -r)

It's not objcopy/ld -r, Ubuntu strips the library:
https://launchpadlibrarian.net/724504654/buildlog_ubuntu-noble-amd64.llvm-toolchain-18_1%3A18.1.3-1_BUILDING.txt.gz

strip --strip-debug --remove-section=.comment --remove-section=.note --enable-deterministic-archives -R .gnu.lto_\* -R .gnu.debuglto_\* -N __gnu_lto_slim -N __gnu_lto_v1 debian/libclang-rt-18-dev/usr/lib/llvm-18/lib/clang/18/lib/linux/libclang_rt.lsan-x86_64.a

That destroys the sh_link.
Question is if this is a bug. llvm-strip seems to do the same thing.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions