Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 132045 - wxGTK-2.6.2-r1 fails to run with --as-needed
Summary: wxGTK-2.6.2-r1 fails to run with --as-needed
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo wxWidgets project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: as-needed
  Show dependency tree
 
Reported: 2006-05-02 12:48 UTC by smrspam88
Modified: 2006-05-14 10:09 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
fixed ebuild (wxGTK-2.6.2-r2.ebuild,1.65 KB, text/plain)
2006-05-02 12:52 UTC, smrspam88
Details

Note You need to log in before you can comment on or make changes to this bug.
Description smrspam88 2006-05-02 12:48:15 UTC
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.
Comment 1 smrspam88 2006-05-02 12:52:05 UTC
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"
>
Comment 2 Jakub Moc (RETIRED) gentoo-dev 2006-05-02 12:55:18 UTC
(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. 
Comment 3 smrspam88 2006-05-02 13:00:08 UTC
> 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?

Comment 4 Mart Raudsepp gentoo-dev 2006-05-02 13:03:33 UTC
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.
Comment 5 smrspam88 2006-05-02 13:07:21 UTC
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
Comment 6 smrspam88 2006-05-14 04:47:29 UTC
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
Comment 7 Jakub Moc (RETIRED) gentoo-dev 2006-05-14 05:01:28 UTC
-fvisibility-inlines-hidden is completely unsupported, don't use it.
Comment 8 Mart Raudsepp gentoo-dev 2006-05-14 08:33:16 UTC
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).
Comment 9 smrspam88 2006-05-14 10:09:27 UTC
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