-Wl,--as-needed -Wl,-O1 devilries
Several FTBFS are currently caused on at least sparc and alpha with the
current toolchain in packages using -Wl,--as-needed. It seems -Wl,-O1
is now used by default, so as soon as you use -Wl,--as-needed, you're
likely to hit this toolchain bug. The toolchain maintainers were
informed of this issue.
-Wl,--as-needed is handy to reduce dependencies of packages, but if you
don't particularly need it and if it's not too much work to remove its
usage, you'd better go without it. In general, it causes a lot of
breakages, such as in dlopened() plugins.
It seems that current upstream libtool and current upstream pkg-config
could possibly be changed to reduce dependencies too, but this is won't
happen in the short-term. The libtool patch will probably be sent
You might want to relibtoolize against Debian's libtool, as it is
specially patched and will reduce dependencies. Of course, this is
more work, and requires intervention for each new upstream release.
Please see #319162 for a sample FTBFS on sparc. Please see
<https://bugzilla.ubuntu.com/show_bug.cgi?id=12822> for a short test
case trigerring the bug.
PS: other arches may be affected than sparc and alpha. Also,
--as-needed or -O1 alone might cause harm too.
Loïc Minier <email@example.com>
Come, your destiny awaits!