(In reply to Richard Biener from comment #12) > For sure in case the shared object dlopens plugins for example that use > pthreads > it's wrong to elide -lpthread. --as-needed is prone to breaking this kind > of special links. All right, I've made a submit request that does that. > > Note that libpthread is actually a linker script: > > /* GNU ld script > Use the shared library, but some functions are only in > the static library, so try that secondarily. */ > OUTPUT_FORMAT(elf64-x86-64) > GROUP ( /lib64/libpthread.so.0 /usr/lib64/libpthread_nonshared.a ) > > so it should eventually be possible to elide --as-needed here in the script > in some way? > > Or simply add SUSE_ASNEEDED=0 in the spec file (or drop this long-standing > patch). Do you mean dropping the binutils-build-as-needed.diff patch completely? Btw. why did we start using it? What was the motivation, a smaller number of package dependencies? Looking at openSUSE:Factory, the number of packages that disable the feature is following: $ grep ASNEEDED * | wc -l 87