The current stable version of wxGTK (2.6.2-r1) builds cleanly when compiled with LDFLAGS="--as-needed" but has unresolved symbols e.g. in /usr/lib/libwx_baseu_net-2.6.so.0 This can be seen when launching amule (for other examples see http://forums.gentoo.org/viewtopic-t-316445-highlight-asneeded.html) yields to the error message: amule: symbol lookup error: /usr/lib/libwx_baseu_net-2.6.so.0: undefined symbol: _ZNK11wxClassInfo8IsKindOfEPKS_ I guess that this library does for some (upstream) reason not link correctly to a needed dependency (see for an analogous example http://bugs.gentoo.org/show_bug.cgi?id=131843). I filed a bug about this upstream, but I don't expect a quick fix so I modified the wxGTK ebuild so that it strips this LDFLAG and bumped the revision to -r2. See the diff for the exact procedure. I would consider doing this for all wx* packages, but I don't have the time to test wheter all wx* packages fail with --as-needed.
Created attachment 86015 [details] fixed ebuild momsen@Banach ~ $ diff wxGTK-2.6.2-r1.ebuild wxGTK-2.6.2-r2.ebuild 5c5 < inherit wxlib gnuconfig --- > inherit wxlib gnuconfig flag-o-matic 40a41,44 > # This LDFLAG breaks wxGTK > filter-ldflags "-Wl,--as-needed" > filter-cflags "-Wl,--as-needed" >
(In reply to comment #0) > the wxGTK ebuild so that it strips this LDFLAG and bumped the revision to -r2. > See the diff for the exact procedure. I would consider doing this for all wx* > packages, but I don't have the time to test wheter all wx* packages fail with > --as-needed. Erm, no... that's a wrong solution to the problem.
> Erm, no... that's a wrong solution to the problem. Well I know that it is quick'n'dirty, but I think its a better workarround than waiting for upstream and leaving this package broken (even if --as-needed is unsupported atm), isn't it?
Please look at the as-needed guide at http://www.gentoo.org/proj/en/qa/asneeded.xml Especially the part where it says you need to have at least binutils-2.16.92 for solving wxGTK problems, and if the last snapshot doesn't work to post with as much details as possible. If you do have binutils-2.16.92, then we need a lot more details. Emerge info would be a good starting point.
Oh I'm very sorry, I didn't see that. I'm running x86 so I don't have latest binutils. In this case I will mark this bug as INVALID
Well, I now tried binutils-2.16.92, and I still have the same undefined symbols, e.g Banach momsen # ldd -u -r /usr/lib/libwx_baseu_net-2.6.so 1003: /usr/lib/libwx_baseu_net-2.6.so: error: symbol lookup error: undefined symbol: _ZNK11wxClassInfo8IsKindOfEPKS_ (continued) undefined symbol: _ZNK11wxClassInfo8IsKindOfEPKS_ (/usr/lib/libwx_baseu_net-2.6.so) 1003: /usr/lib/libwx_baseu_net-2.6.so: error: symbol lookup error: undefined symbol: _ZN8wxObject19ReservedObjectFunc1Ev (continued) undefined symbol: _ZN8wxObject19ReservedObjectFunc1Ev (/usr/lib/libwx_baseu_net-2.6.so) 1003: /usr/lib/libwx_baseu_net-2.6.so: error: symbol lookup error: undefined symbol: _ZN8wxObject19ReservedObjectFunc2Ev (continued) undefined symbol: _ZN8wxObject19ReservedObjectFunc2Ev (/usr/lib/libwx_baseu_net-2.6.so) 1003: /usr/lib/libwx_baseu_net-2.6.so: error: symbol lookup error: undefined symbol: _ZN8wxObject19ReservedObjectFunc3Ev (continued) undefined symbol: _ZN8wxObject19ReservedObjectFunc3Ev (/usr/lib/libwx_baseu_net-2.6.so) 1003: /usr/lib/libwx_baseu_net-2.6.so: error: symbol lookup error: undefined symbol: _ZN8wxObject19ReservedObjectFunc4Ev (continued) undefined symbol: _ZN8wxObject19ReservedObjectFunc4Ev (/usr/lib/libwx_baseu_net-2.6.so) 1003: /usr/lib/libwx_baseu_net-2.6.so: error: symbol lookup error: undefined symbol: _ZN8wxObject19ReservedObjectFunc5Ev (continued) undefined symbol: _ZN8wxObject19ReservedObjectFunc5Ev (/usr/lib/libwx_baseu_net-2.6.so) 1003: /usr/lib/libwx_baseu_net-2.6.so: error: symbol lookup error: undefined symbol: _ZN8wxObject19ReservedObjectFunc6Ev (continued) But, when I disabled -fvisibility-inlines-hidden, everything went fine! I yet have to try to compile wxGTK with binutils-2.16.1 and -fvisibility-inlines-hidden disabled, but so far I can tell that the bug is more due to the combination of --as-needed and -fvisibility-inlines-hidden than --as-needed itself! I guess this is an upstream problem, but I don't know whether it's a binutils, wxGTk or even gcc problem... What about a warning in the ebuild that the combination of -fvisibility and --as-needed doesn't work? My emerge --info is Portage 2203-svn (default-linux/x86/2006.0, gcc-3.4.5, glibc-2.3.6-r3, 2.6.16.11 i686) ================================================================= System uname: 2.6.16.11 i686 AMD Duron(tm) processor Gentoo Base System version 1.6.14 dev-lang/python: 2.4.2 dev-python/pycrypto: [Not Present] dev-util/ccache: [Not Present] dev-util/confcache: [Not Present] sys-apps/sandbox: 1.2.12 sys-devel/autoconf: 2.13, 2.59-r7 sys-devel/automake: 1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r1 sys-devel/binutils: 2.16.1, 2.16.92 sys-devel/libtool: 1.5.22 virtual/os-headers: 2.6.11-r2 ACCEPT_KEYWORDS="x86" AUTOCLEAN="yes" CBUILD="i686-pc-linux-gnu" CFLAGS="-O2 -march=athlon-tbird -fomit-frame-pointer -pipe" CHOST="i686-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.4/env /usr/kde/3.4/share/config /usr/kde/3.4/shutdown /usr/kde/ /share/config /usr/lib/X11/xkb /usr/share/config /usr/share/texmf/dvipdfm/config/ /usr/share/texmf/dvips/config/ /usr/s are/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/ /usr/share/texmf/xdvi/ /var/qmail/control" CONFIG_PROTECT_MASK="/etc/eselect/compiler /etc/gconf /etc/terminfo /etc/env.d" CXXFLAGS="-O2 -march=athlon-tbird -fomit-frame-pointer -pipe -fvisibility-inlines-hidden" DISTDIR="/usr/portage/distfiles" FEATURES="autoconfig distlocks sandbox sfperms strict" GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo" LANG="en_US.UTF-8" LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,--sort-common" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/local/portage" SYNC="rsync://rsync.gentoo.org/gentoo-portage" USE="x86 3dnow mmx pic unicode usepackagedmakefiles userland_GNU kernel_linux elibc_glibc" Unset: ASFLAGS, CTARGET, INSTALL_MASK, LC_ALL, LINGUAS, MAKEOPTS, PORTAGE_RSYNC_EXTRA_OPTS, PORTAGE_RSYNC_OPTS
-fvisibility-inlines-hidden is completely unsupported, don't use it.
I have always had -fvisibility-inlines-hidden work fine on wxGTK, including lately in combination with --as-needed. I wonder if gcc-3.4.5 might generate bad things for these (useless) virtual inline methods - I'm using gcc-4.1 on a P4. I'd prefer -fvisibility-inlines-hidden to always work upstream (which I'm a part of), but --as-needed has (unrelated) issues to have solved (it ends up in wx-config --libs).
Just for the record: wxGTK-2.6.2-r1 compiles and works fine with --as-needed and binutils-2.16.1, if you disable -fvisibility-inlines-hidden. To be honest this problem therefore is due to -fvisibility-inlines-hidden and not --as-needed