Bug 166221 - dev-python/gst-python broken with "-z, now"
Bug#: 166221 Product:  Gentoo Linux Version: 2006.1 Platform: All
OS/Version: Linux Status: RESOLVED Severity: minor Priority: P2
Resolution: FIXED Assigned To: gstreamer@gentoo.org Reported By: nareshov@gmail.com
Component: Library
URL:  http://bugzilla.gnome.org/show_bug.cgi?id=473234
Summary: dev-python/gst-python broken with "-z, now"
Keywords:  
Status Whiteboard: 
Opened: 2007-02-10 16:45 0000
Description:   Opened: 2007-02-10 16:45 0000
LDFLAGS --as-needed one.
The whole system except dev-python/gst-python works :)

------- Comment #1 From Naresh V 2007-02-10 16:46:56 0000 -------
CFLAGS="-march=k8 -O2 -pipe" 
CHOST="x86_64-pc-linux-gnu"
CXXFLAGS="${CFLAGS}"
#LDFLAGS="-Wl, -O1 -Wl, --as-needed -Wl,-z,now"  <-- quodlibet broke here -
because of gst-python
LDFLAGS="-Wl,-O1 -Wl,--enable-new-dtags -Wl,--sort-common -s -Wl,--as-needed
-Wl,-z,now" <-- and broke here too

SYNC="rsync://navya/gentoo-portage/"
GENTOO_MIRRORS="ftp://navya/gentoo http://gentoo.osuosl.org"

ACCEPT_KEYWORDS="~amd64"

USE="3dnow 3dnowext aac aalib acl acpi -arts avahi bash-completion beagle bzip2
cjk cscope directfb -eds -evo examples ffmpeg flac imagemagick jpeg2k -kde
libnotify mmxext offensive ogg openal openexr pdf -pppd -qt -qt3 -qt4 ruby
samba scope svg svga theora threads vim-syntax x264 xvid"
LINGUAS="en_US ja kn_IN"

VIDEO_CARDS="fbdev nv nvidia vesa"
ALSA_CARDS="via82xx"

FEATURES="sandbox collision-protect distlocks parallel-fetch strict userfetch
userpriv usersandbox"

PORTAGE_ELOG_CLASSES="info warn error log"
PORTAGE_ELOG_SYSTEM="save"
#

------- Comment #2 From Jakub Moc (RETIRED) 2007-02-10 17:05:18 0000 -------
No pastebins, please. Post/attach all relevant info, reopen then.

------- Comment #3 From Naresh V 2007-02-10 17:18:24 0000 -------
after chatting with aballier on #gentoo-amd64 we pin-point at "-z, now"
it wasn't "--as-needed"

------- Comment #4 From Naresh V 2007-02-10 17:19:13 0000 -------
nareshov@clueless /mnt/sda7/Music_G/H.I.M $ quodlibet 
Traceback (most recent call last):
  File "/usr/share/quodlibet/formats/__init__.py", line 22, in ?
    try: format = __import__(name, {}, {}, self)
  File "/usr/share/quodlibet/formats/xiph.py", line 9, in ?
    import gst
  File "/usr/lib/python2.4/site-packages/gst-0.10/gst/__init__.py", line 108,
in ?
    from _gst import *
ImportError: /usr/lib64/python2.4/site-packages/gst-0.10/gst/_gst.so: undefined
symbol: libxml_xmlDocPtrWrap
Traceback (most recent call last):
  File "/usr/share/quodlibet/formats/__init__.py", line 22, in ?
    try: format = __import__(name, {}, {}, self)
  File "/usr/share/quodlibet/formats/trueaudio.py", line 9, in ?
    import gst
  File "/usr/lib/python2.4/site-packages/gst-0.10/gst/__init__.py", line 108,
in ?
    from _gst import *
ImportError: /usr/lib64/python2.4/site-packages/gst-0.10/gst/_gst.so: undefined
symbol: libxml_xmlDocPtrWrap
Traceback (most recent call last):
  File "/usr/share/quodlibet/formats/__init__.py", line 22, in ?
    try: format = __import__(name, {}, {}, self)
  File "/usr/share/quodlibet/formats/mp3.py", line 9, in ?
    import gst
  File "/usr/lib/python2.4/site-packages/gst-0.10/gst/__init__.py", line 108,
in ?
    from _gst import *
ImportError: /usr/lib64/python2.4/site-packages/gst-0.10/gst/_gst.so: undefined
symbol: libxml_xmlDocPtrWrap
Traceback (most recent call last):
  File "/usr/share/quodlibet/formats/__init__.py", line 22, in ?
    try: format = __import__(name, {}, {}, self)
  File "/usr/share/quodlibet/formats/mp4.py", line 13, in ?
    import gst
  File "/usr/lib/python2.4/site-packages/gst-0.10/gst/__init__.py", line 108,
in ?
    from _gst import *
ImportError: /usr/lib64/python2.4/site-packages/gst-0.10/gst/_gst.so: undefined
symbol: libxml_xmlDocPtrWrap
Traceback (most recent call last):
  File "/usr/share/quodlibet/formats/__init__.py", line 22, in ?
    try: format = __import__(name, {}, {}, self)
  File "/usr/share/quodlibet/formats/mod.py", line 11, in ?
    import gst
  File "/usr/lib/python2.4/site-packages/gst-0.10/gst/__init__.py", line 108,
in ?
    from _gst import *
ImportError: /usr/lib64/python2.4/site-packages/gst-0.10/gst/_gst.so: undefined
symbol: libxml_xmlDocPtrWrap
Traceback (most recent call last):
  File "/usr/share/quodlibet/formats/__init__.py", line 22, in ?
    try: format = __import__(name, {}, {}, self)
  File "/usr/share/quodlibet/formats/mpc.py", line 11, in ?
    import gst
  File "/usr/lib/python2.4/site-packages/gst-0.10/gst/__init__.py", line 108,
in ?
    from _gst import *
ImportError: /usr/lib64/python2.4/site-packages/gst-0.10/gst/_gst.so: undefined
symbol: libxml_xmlDocPtrWrap
Traceback (most recent call last):
  File "/usr/share/quodlibet/formats/__init__.py", line 22, in ?
    try: format = __import__(name, {}, {}, self)
  File "/usr/share/quodlibet/formats/wav.py", line 12, in ?
    import gst
  File "/usr/lib/python2.4/site-packages/gst-0.10/gst/__init__.py", line 108,
in ?
    from _gst import *
ImportError: /usr/lib64/python2.4/site-packages/gst-0.10/gst/_gst.so: undefined
symbol: libxml_xmlDocPtrWrap
Traceback (most recent call last):
  File "/usr/share/quodlibet/formats/__init__.py", line 22, in ?
    try: format = __import__(name, {}, {}, self)
  File "/usr/share/quodlibet/formats/wavpack.py", line 9, in ?
    import gst
  File "/usr/lib/python2.4/site-packages/gst-0.10/gst/__init__.py", line 108,
in ?
    from _gst import *
ImportError: /usr/lib64/python2.4/site-packages/gst-0.10/gst/_gst.so: undefined
symbol: libxml_xmlDocPtrWrap
Supported formats: formats.mod, formats.mp3, formats.mp4, formats.mpc,
formats.trueaudio, formats.wav, formats.wavpack, formats.xiph
Traceback (most recent call last):
  File "/usr/bin/quodlibet", line 301, in ?
    main()
  File "/usr/bin/quodlibet", line 33, in main
    library = load_library()
  File "/usr/bin/quodlibet", line 255, in load_library
    lib = library.init(const.LIBRARY)
  File "/usr/share/quodlibet/library/__init__.py", line 38, in init
    library.load(cache_fn, skip=True)
  File "/usr/share/quodlibet/library/_library.py", line 124, in load
    try: items = pickle.load(fileobj)
  File "/usr/share/quodlibet/formats/mp3.py", line 9, in ?
    import gst
  File "/usr/lib/python2.4/site-packages/gst-0.10/gst/__init__.py", line 108,
in ?
    from _gst import *
ImportError: /usr/lib64/python2.4/site-packages/gst-0.10/gst/_gst.so: undefined
symbol: libxml_xmlDocPtrWrap

------- Comment #5 From Jakub Moc (RETIRED) 2007-02-10 17:30:00 0000 -------
So don't use such flags.

------- Comment #6 From Naresh V 2007-02-10 17:35:08 0000 -------
(In reply to comment #5)
> So don't use such flags.
> 

Right now that's what I'm doing.
LDFLAGS="dancy stuff except <-z, now>" in
/etc/portage/env/dev-python/gst-python

Thanks anyway.

------- Comment #7 From SpanKY 2007-08-25 10:50:08 0000 -------
Created an attachment (id=129136) [details]
gst-dlopen-now.c

this should exhibit the same problem on any system

------- Comment #8 From SpanKY 2007-08-25 11:02:27 0000 -------
(From update of attachment 129136 [details])
actually, i lied ... ignore this

------- Comment #9 From SpanKY 2007-08-25 12:07:21 0000 -------
ugh, looking through gst's python code, it looks like the way they've written
their module loading code requires everything be delayed

you should get upstream to have configure test and append -Wl,-z,nonow to
LDFLAGS when possible

------- Comment #10 From SpanKY 2007-08-26 12:15:06 0000 -------
-z nonow doesnt seem to properly invert -z now ... -z lazy should work fine

------- Comment #11 From Samuli Suominen 2007-09-01 06:30:33 0000 -------
You shouldn't be using such flags.. seriously. Anyway,

+  01 Sep 2007; Samuli Suominen <drac@gentoo.org> gst-python-0.10.8.ebuild:
+  Filter some ricing LDFLAGS wrt #168326.

------- Comment #12 From SpanKY 2007-09-01 15:12:07 0000 -------
me thinks you dont understand what -z,now actually does ... all hardened
systems utilize it ... in fact, anyone who wants to be a ricer wouldnt actually
utilize these flags as they cause a startup performance problem as a trade off
at runtime

filtering does not actually solve the problem, you still need to do what i
suggested: append -Wl,-z,lazy and get upstream to do the same in the configure
script so we dont need to workaround with flag appending

------- Comment #13 From Samuli Suominen 2007-09-03 16:42:10 0000 -------
Created an attachment (id=129928) [details]
gst-python-0.10.8-lazy.patch

Patch checking if -Wl,-z,lazy is accepted by ld, if yes, then use it.

vapier, looks better? ;)

------- Comment #14 From Samuli Suominen 2007-09-03 16:58:33 0000 -------
If someone can be more verbose, for upstream, that'd be nice. URL attached.

------- Comment #15 From Samuli Suominen 2007-09-03 17:16:39 0000 -------
For reference, gst-python built with -z,now:

drac@unique ~ $ exaile
Traceback (most recent call last):
  File "exaile.py", line 69, in <module>
    from xl import *
  File "//usr/share/exaile/xl/tracks.py", line 18, in <module>
    import common, media, db, config, trackslist
  File "//usr/share/exaile/xl/media/__init__.py", line 4, in <module>
    import gst
  File "/usr/lib/python2.5/site-packages/gst-0.10/gst/__init__.py", line 108,
in <module>
    from _gst import *
ImportError: /usr/lib/python2.5/site-packages/gst-0.10/gst/_gst.so: undefined
symbol: libxml_xmlDocPtrWrap

------- Comment #16 From Samuli Suominen 2007-09-03 17:42:17 0000 -------
Upstream is now well aware of the problem and has test it himself.

For now, he requested me to modify them inside ebuild 'till the bug in URL is
solved.

20:30 < bilboed> drac, modify the LDFLAGS in the ebuild

+  03 Sep 2007; Samuli Suominen <drac@gentoo.org> gst-python-0.10.8.ebuild:
+  Instead of filtering -z,now, append -z,lazy wrt #166221.

------- Comment #17 From SpanKY 2007-09-03 21:39:13 0000 -------
weird, i only got about half the comments posted here via e-mail ...

the configure patch posted is fugly (but pretty much every ld check ive seen in
a configure script was fugly :D), so if it works i'd roll with it

------- Comment #18 From Samuli Suominen 2007-11-28 16:54:14 0000 -------
(In reply to comment #17)
> weird, i only got about half the comments posted here via e-mail ...
> 
> the configure patch posted is fugly (but pretty much every ld check ive seen in
> a configure script was fugly :D), so if it works i'd roll with it
> 

While version bumping, I've applied it in 0.10.9 as upstream is not very
responsive wrt this issue. WFM.