Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 221121 - x11-drivers/xf86-video-i810 linked bind NOW instead LAZY
Summary: x11-drivers/xf86-video-i810 linked bind NOW instead LAZY
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Rémi Cardona (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-05-09 18:52 UTC by Gordon Malm (RETIRED)
Modified: 2008-05-20 08:27 UTC (History)
1 user (show)

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


Attachments
x11-drivers-xf86-video-i810-2.1.1-now.log (x11-drivers-xf86-video-i810-2.1.1-now.log,74.08 KB, text/plain)
2008-05-12 22:18 UTC, Gordon Malm (RETIRED)
Details
x11-drivers-xf86-video-i810-2.1.1-lazy.log (x11-drivers-xf86-video-i810-2.1.1-lazy.log,74.24 KB, text/plain)
2008-05-12 22:20 UTC, Gordon Malm (RETIRED)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Gordon Malm (RETIRED) gentoo-dev 2008-05-09 18:52:32 UTC
Sorry I am late with this bug, I got busy and forgot to file it.  Using hardened kernel/profile.  I recently swapped my hd/install from one laptop using the xf86-video-savage to another with Intel X3100 using xf86-video-i810.  X dies on startup with dlopen() errors.  Xorg.0.log output:

(II) Loading /usr/lib/xorg/modules/drivers//intel_drv.so
dlopen: /usr/lib/xorg/modules/drivers//intel_drv.so: undefined symbol: ExaOffscreenMarkUsed
(EE) Failed to load /usr/lib/xorg/modules/drivers//intel_drv.so

XXXXXX ~ # scanelf -a /usr/lib/xorg/modules/drivers/savage_drv.so
 TYPE    PAX   PERM ENDIAN STK/REL/PTL TEXTREL RPATH BIND FILE
ET_DYN ---xe- 0755 LE RW- R-- RW-    -      -   LAZY /usr/lib/xorg/modules/drivers/savage_drv.so

XXXXXX ~ # scanelf -a /usr/lib/xorg/modules/drivers/i810_drv.so
 TYPE    PAX   PERM ENDIAN STK/REL/PTL TEXTREL RPATH BIND FILE
ET_DYN ---xe- 0755 LE RW- R-- RW-    -      -   NOW /usr/lib/xorg/modules/drivers/i810_drv.so

LDFLAGS="-Wl,-z,lazy" emerge xf86-video-i810

XXXXXX ~ # scanelf -a /usr/lib/xorg/modules/drivers/i810_drv.so
 TYPE    PAX   PERM ENDIAN STK/REL/PTL TEXTREL RPATH BIND FILE
ET_DYN ---xe- 0755 LE RW- R-- RW-    -      -   LAZY /usr/lib/xorg/modules/drivers/i810_drv.so

Now X starts normally w/o errors.

Version used: x11-drivers/xf86-video-i810-2.1.1

http://archives.gentoo.org/gentoo-hardened/msg_06f2f741ab3e8fa7bbcb88fb85baa3ec.xml
http://archives.gentoo.org/gentoo-hardened/msg_1a0c7ecb930a7de89d95498941537c80.xml
http://archives.gentoo.org/gentoo-hardened/msg_2134167156515b0016553e300cc213d9.xml

emerge --info:
Portage 2.1.4.4 (hardened/x86/2.6, gcc-3.4.6-hardenednossp, glibc-2.6.1-r0, 2.6.24-hardened-r1-2008043001 i686)
=================================================================
System uname: 2.6.24-hardened-r1-2008043001 i686 Intel(R) Core(TM)2 Duo CPU T9300 @ 2.50GHz
Timestamp of tree: Fri, 02 May 2008 00:20:01 +0000
distcc 2.18.3 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [enabled]
app-shells/bash:     3.2_p17-r1
dev-java/java-config: 1.3.7, 2.1.4
dev-lang/python:     2.4.4-r9
dev-python/pycrypto: 2.0.1-r6
sys-apps/baselayout: 1.12.11.1
sys-apps/sandbox:    1.2.18.1-r2
sys-devel/autoconf:  2.13, 2.61-r1
sys-devel/automake:  1.5, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10.1
sys-devel/binutils:  2.18-r1
sys-devel/gcc-config: 1.4.0-r4
sys-devel/libtool:   1.5.26
virtual/os-headers:  2.6.23-r3
ACCEPT_KEYWORDS="x86"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-march=nocona -O2 -fomit-frame-pointer -fno-ident -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/config /var/lib/hsqldb"
CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/revdep-rebuild /etc/terminfo /etc/texmf/web2c /etc/udev/rules.d"
CXXFLAGS="-march=nocona -O2 -fomit-frame-pointer -fno-ident -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="distcc distlocks parallel-fetch sandbox sfperms strict unmerge-orphans userfetch userpriv usersandbox"
GENTOO_MIRRORS="http://gentoo.mirrors.tds.net/gentoo/ http://gentoo.mirrors.easynews.com/linux/gentoo/ http://mirror.datapipe.net/gentoo/ http://gentoo.chem.wisc.edu/gentoo/ http://mirror.phy.olemiss.edu/mirror/gentoo/ http://gentoo.netnitco.net/ http://gentoo.mirrors.pair.com/ http://mirror.usu.edu/mirrors/gentoo/ http://open-systems.ufl.edu/mirrors/gentoo/"
LDFLAGS="-Wl,-O1"
LINGUAS="en en_US en_GB"
MAKEOPTS="-j8"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_EXTRA_OPTS="--progress --exclude-from=/etc/portage/rsync_excludes"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/portage/local/layman/sunrise"
SYNC="rsync://*yoink*(private)/gentoo-portage"
USE="X Xaw3d a52 aac aalib acl acpi adns alsa apache2 apm audiofile avi bash-completion bcmath berkdb bidi bluetooth bonobo bzip2 cairo calendar canna caps cdb cdparanoia cdr cracklib crypt cscope ctype cups curl curlwrappers dba dbm dbus dbx dedicated dga dio directfb doc dri dv dvb dvd dvdr dvdread encode ethereal evo exif expat fam fastcgi fbcon ffmpeg fftw firefox flac flash flatfile foomaticdb fortran freetds freewnn ftp gb gcj gd gdbm geoip ggi gif ginac glut gmp gnome gnutls gphoto2 gpm gps gstreamer gtk gtkhtml guile hal hardened iconv ieee1394 imagemagick imap imlib inifile ipv6 jack java javascript jikes joystick jpeg junit kde ladcca lapack lcms ldap lesstif libcaca libg++ libgda libsamplerate libwww lirc lm_sensors mad maildir mailwrapper matroska mbox mcal mcve memlimit mhash midi mikmod milter mime ming mmap mmx mng mnogosearch mono motif mp3 mpeg mpi mplayer msession nas ncurses neXt netboot netcdf nis nls nptl nptlonly nsplugin ocaml offensive ofx ogg openal opengl osc oss pam pcmcia pcntl pcre pda pdf perl pic plotutils png portaudio posix ppds python qdbm qt3 qt4 quicktime radius readline recode ruby samba sasl scanner sdl seamonkey session sharedext sharedmem shorten simplexml slang slp smartcard sndfile snmp soap sockets socks5 sox speex spell spl sse sse2 ssl svg svga sysvipc szip tcl tcpd tetex theora threads tidy tiff tk tokenizer truetype unicode urandom usb v4l vcd vhosts videos vorbis wddx wifi win32codecs wmf x86 xface xine xinerama xml xml2 xmlrpc xorg xosd xpm xprint xsl xv xvid yaz zeo zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1 emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" ELIBC="glibc" INPUT_DEVICES="evdev keyboard mouse synaptics" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en en_US en_GB" USERLAND="GNU" VIDEO_CARDS="apm dummy fbdev i810 savage v4l vesa vga"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS

Reproducible: Always
Comment 1 Rémi Cardona (RETIRED) gentoo-dev 2008-05-10 15:37:29 UTC
(In reply to comment #0)
> http://archives.gentoo.org/gentoo-hardened/msg_06f2f741ab3e8fa7bbcb88fb85baa3ec.xml
> http://archives.gentoo.org/gentoo-hardened/msg_1a0c7ecb930a7de89d95498941537c80.xml
> http://archives.gentoo.org/gentoo-hardened/msg_2134167156515b0016553e300cc213d9.xml

To be honest, I don't know the semantics of ELF libraries well enough to have a faint idea about :

1) what the overall objective is
2) what the problem is (specific to Xorg and i810)
3) what should be fixed

Thanks
Comment 2 Gordon Malm (RETIRED) gentoo-dev 2008-05-10 19:33:50 UTC
We could always append-ldflags -Wl,-z,lazy/filter-ldflags -Wl,-z,now.  However, I'm pretty sure this is supposed to be taken care of in an eclass (though I have not checked yet).  I think someone on irc said they were having the same problem with another driver so the problem could be more widespread if it is in fact an eclass issue.
Comment 3 Gordon Malm (RETIRED) gentoo-dev 2008-05-10 19:49:28 UTC
We're in the same boat - my understanding of ELF headers, layout, etc. is only general/higher-level as read elsewhere/explained by others maintaining a low-level understanding.  There's some more info regarding dlopen() issues here: 

http://www.gentoo.org/proj/en/hardened/hardenedxorg.xml
Comment 4 Donnie Berkholz (RETIRED) gentoo-dev 2008-05-11 04:06:32 UTC
x-modular.eclass should be taking care of this during x-modular_src_unpack() by calling x-modular_specs_check().
Comment 5 Rémi Cardona (RETIRED) gentoo-dev 2008-05-11 08:55:54 UTC
Gordon, could you provide a full build log? That'd be a big help.

Thanks
Comment 6 Gordon Malm (RETIRED) gentoo-dev 2008-05-12 22:18:59 UTC
Created attachment 152985 [details]
x11-drivers-xf86-video-i810-2.1.1-now.log

Build log for:

FEATURES="-distcc" MAKEOPTS="-j3" emerge -1 xf86-video-i810:

XXXXXXX ~ # scanelf -a /usr/lib/xorg/modules/drivers/i810_drv.so
 TYPE    PAX   PERM ENDIAN STK/REL/PTL TEXTREL RPATH BIND FILE
ET_DYN ---xe- 0755 LE RW- R-- RW-    -      -   NOW /usr/lib/xorg/modules/drivers/i810_drv.so
Comment 7 Gordon Malm (RETIRED) gentoo-dev 2008-05-12 22:20:21 UTC
Created attachment 152989 [details]
x11-drivers-xf86-video-i810-2.1.1-lazy.log

Build log for:

FEATURES="-distcc" MAKEOPTS="-j3" LDFLAGS="-Wl,-O1 -Wl,-z,lazy" emerge -1 xf86-video-i810:

XXXXXXX ~ # scanelf -a /usr/lib/xorg/modules/drivers/i810_drv.so
 TYPE    PAX   PERM ENDIAN STK/REL/PTL TEXTREL RPATH BIND FILE
ET_DYN ---xe- 0755 LE RW- R-- RW-    -      -   LAZY /usr/lib/xorg/modules/drivers/i810_drv.so
Comment 8 Rémi Cardona (RETIRED) gentoo-dev 2008-05-15 13:39:32 UTC
Could you try with 2.3.0? scanelf on my amd64 system shows that it's been linked as lazy.

Thanks
Comment 9 Gordon Malm (RETIRED) gentoo-dev 2008-05-15 16:26:17 UTC
Finally took some time to look at the eclasses & ebuilds.  The eclass is fine the problem is in the xf86-video-i810-2.1.1.ebuild.  The ebuild overrides the eclass' x-modular_src_unpack() redefinition of src_unpack() with its own and only calls x-modular_unpack_source within.  Adding x-modular_specs_check will fix the problem and should also be called any time this is done in one of the xf86 driver ebuilds.

Excerpt from xf86-video-i810-2.1.1 ebuild:
src_unpack() {
       x-modular_unpack_source
       epatch "${FILESDIR}/${PN}-2.1.1-fix_build_without_dri.patch"
}

As to the overall issue, I don't understand and can't explain it nearly as well as pageexec in the ML postings I linked.  But it basically boils down to @ attempted driver load Xorg's loader is trying to resolve all symbols in the i810_drv.so (linked bind NOW).  In this case it is trying to resolve EXA module/sub-module functions, which don't exist, even though they will never be used.  When linked bind LAZY, the symbols are resolved as needed at runtime, rather than during attempted loading of the shared object.  So if there exists an undefined symbol - its not a problem unless you actually try to use the fuction.
Comment 10 Gordon Malm (RETIRED) gentoo-dev 2008-05-15 16:29:47 UTC
(In reply to comment #8)
> Could you try with 2.3.0? scanelf on my amd64 system shows that it's been
> linked as lazy.
> 
> Thanks
> 

Which is the correct/expected result as the 2.3.0 ebuild doesn't override src_unpack(). :)
Comment 11 Donnie Berkholz (RETIRED) gentoo-dev 2008-05-16 17:01:06 UTC
(In reply to comment #9)
> Finally took some time to look at the eclasses & ebuilds.  The eclass is fine
> the problem is in the xf86-video-i810-2.1.1.ebuild.  The ebuild overrides the
> eclass' x-modular_src_unpack() redefinition of src_unpack() with its own and
> only calls x-modular_unpack_source within.  Adding x-modular_specs_check will
> fix the problem and should also be called any time this is done in one of the
> xf86 driver ebuilds.
> 
> Excerpt from xf86-video-i810-2.1.1 ebuild:
> src_unpack() {
>        x-modular_unpack_source
>        epatch "${FILESDIR}/${PN}-2.1.1-fix_build_without_dri.patch"
> }

Hmm, it should just do PATCHES="${FILESDIR}/${PN}-2.1.1-fix_build_without_dri.patch" and skip the src_unpack.
Comment 12 Rémi Cardona (RETIRED) gentoo-dev 2008-05-20 08:27:21 UTC
I've dropped the silly src_unpack from portage. Everything should be fine now.

Thanks