When emerging media-libs/openinventor-2.1.5.10-r3 Undefined reference to `glwMDrawingAreaWidgetClass' when compiling inventor/apps/samples/widgets/componentTest.c++ Mesa has been compiled with the +motif flag set, as this is required by openinventor. make[4]: Entering directory `/var/tmp/portage/media-libs/openinventor-2.1.5.10-r3/work/inventor/apps/samples/widgets' i686-pc-linux-gnu-g++ -O1 -mtune=i686 -pipe -I/usr/X11R6/include -I. -I../../../lib/database/include -I../../../lib/interaction/include -I../../../lib/nodekits/include -I../../../libSoXt/include -fPIC -DIVPREFIX=\"/usr\" -c componentTest.c++ i686-pc-linux-gnu-g++ -L/var/tmp/portage/media-libs/openinventor-2.1.5.10-r3/work/inventor/lib -L/var/tmp/portage/media-libs/openinventor-2.1.5.10-r3/work/inventor/libSoXt -L//usr/lib -L/usr/X11R6/lib componentTest.o libInventorWidget.a -lInventor -lInventorXt -lGLw -o componentTest libInventorWidget.a(MyTextureEd.o): In function `MyTextureEditor::openImageDialog()': MyTextureEd.c++:(.text+0x19ae): undefined reference to `glwMDrawingAreaWidgetClass' libInventorWidget.a(MyTextureEd.o): In function `MyTextureEditor::buildTexturePaletteWidget(_WidgetRec*)': MyTextureEd.c++:(.text+0x4014): undefined reference to `glwMDrawingAreaWidgetClass' collect2: ld returned 1 exit status make[4]: *** [componentTest] Error 1 # pwd /var/tmp/portage/media-libs/mesa-7.8.2/image/usr/lib # nm -D libGLw.so.1.0.0 | grep DrawingArea 00002ab0 T GLwCreateMDrawingArea ... note the lack of glwMDrawingAreaWidgetClass Reverting to mesa-7.7.1 fixes problem. pwd /var/tmp/portage/media-libs/mesa-7.7.1/image/usr/lib cohetes lib # nm -D libGLw.so.1.0.0 | grep DrawingArea 00002c80 T GLwCreateMDrawingArea 00002110 T GLwDrawingAreaMakeCurrent 000020e0 T GLwDrawingAreaSwapBuffers 00005120 D glwDrawingAreaClassRec 00005198 D glwDrawingAreaWidgetClass 000055a0 D glwMDrawingAreaClassRec 00005634 D glwMDrawingAreaWidgetClass Interestingly, a symbol for glwMDrawingAreaWidgetClass does exist in the data area of libGLw.so.1.0.0 in mesa-7.8.2, though this normally gets stripped during installation. In mesa-7.8.2 cohetes lib # nm libGLw.so.1.0.0 | grep DrawingArea 00002ab0 T GLwCreateMDrawingArea 00001f40 t GLwDrawingAreaMakeCurrent 00001f10 t GLwDrawingAreaSwapBuffers 00004120 d glwDrawingAreaClassRec 00004198 d glwDrawingAreaWidgetClass 000045a0 d glwMDrawingAreaClassRec 00004634 d glwMDrawingAreaWidgetClass In mesa-7.7.1 cohetes lib # nm libGLw.so.1.0.0 | grep glwMDrawingAreaWidgetClass 00005634 D glwMDrawingAreaWidgetClass I haven't dug through mesa build to see where the difference arises between the two. Hopefully someone more familiar with mesa can do this. The difference between 'd' and 'D' in the symbol definition is local versus global. Maybe this is a hint to the problem. Use flags and emerge --info follow. Thanks! cohetes media-libs # equery uses mesa [ Searching for packages matching mesa... ] [ Colour Code : set unset ] [ Legend : Left column (U) - USE flags from make.conf ] [ : Right column (I) - USE flags packages was installed with ] [ Found these USE variables for media-libs/mesa-7.8.2 ] U I - - debug : Enable extra debug codepaths, like asserts and extra output. If you want to get meaningful backtraces see http://www.gentoo.org/proj/en/qa/backtraces.xml - - gallium : Gallium3D is new architecture for building 3D graphics drivers. - - kernel_FreeBSD : KERNEL setting for system using the FreeBSD kernel + + motif : Adds support for the Motif toolkit + + nptl : Enable support for Native POSIX Threads Library, the new threading module (requires linux-2.6 or better usually) - - pic : disable optimized assembly code that is not PIC friendly - - selinux : !!internal use only!! Security Enhanced Linux support, this must be set by the selinux profile or breakage will occur - - video_cards_intel : VIDEO_CARDS setting to build driver for Intel video cards - - video_cards_mach64 : VIDEO_CARDS setting to build driver for mach64 video cards - - video_cards_mga : VIDEO_CARDS setting to build driver for mga video cards - - video_cards_none : VIDEO_CARDS setting to build no drivers (useful when using binary drivers) - - video_cards_nouveau : VIDEO_CARDS setting to build reverse-engineered driver for nvidia cards - - video_cards_r128 : VIDEO_CARDS setting to build driver for ATI r128 video cards + + video_cards_radeon : VIDEO_CARDS setting to build driver for ATI radeon video cards - - video_cards_radeonhd : VIDEO_CARDS setting to build driver for ATI radeon HD video cards (radeon also works) + + video_cards_savage : VIDEO_CARDS setting to build driver for savage video cards - - video_cards_sis : VIDEO_CARDS setting to build driver for SiS video cards - - video_cards_svga : VIDEO_CARDS setting to build driver for svga (VMware Virtual GPU) via Gallium - - video_cards_tdfx : VIDEO_CARDS setting to build driver for tdfx video cards - - video_cards_via : VIDEO_CARDS setting to build driver for via video cards - + xcb : Support the X C-language Binding, a replacement for Xlib Reproducible: Always Steps to Reproduce: 1. emerge =media-libs/mesa-7.8.2 openinventor ... fails 2. emerge =media-libs/mesa-7.7.1 openinventor ... succeeds $ emerge --info Portage 2.1.8.3 (default/linux/x86/10.0, gcc-4.4.3, glibc-2.11.2-r0, 2.6.31-gentoo-r6 i686) ================================================================= System uname: Linux-2.6.31-gentoo-r6-i686-Intel-R-_Pentium-R-_4_CPU_3.06GHz-with-gentoo-1.12.13 Timestamp of tree: Sun, 22 Aug 2010 00:00:01 +0000 app-shells/bash: 4.0_p37 dev-java/java-config: 2.1.11 dev-lang/python: 2.5.4-r4, 2.6.5-r3, 3.1.2-r4 dev-util/cmake: 2.8.1-r2 sys-apps/baselayout: 1.12.13 sys-apps/sandbox: 1.6-r2 sys-devel/autoconf: 2.13, 2.65 sys-devel/automake: 1.10.3, 1.11.1 sys-devel/binutils: 2.20.1-r1 sys-devel/gcc: 4.4.3-r2 sys-devel/gcc-config: 1.4.1 sys-devel/libtool: 2.2.6b sys-devel/make: 3.81-r2 virtual/os-headers: 2.6.30-r1 ACCEPT_KEYWORDS="x86" ACCEPT_LICENSE="* -@EULA" CBUILD="i686-pc-linux-gnu" CFLAGS="-O2 -mtune=i686 -pipe" CHOST="i686-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/share/X11/xkb" CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/eselect/postgresql /etc/fonts/fonts.conf /etc/gconf /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c" CXXFLAGS="-O2 -mtune=i686 -pipe" DISTDIR="/usr/portage/distfiles" FEATURES="assume-digests distlocks fixpackages news parallel-fetch protect-owned sandbox sfperms strict unmerge-logs unmerge-orphans userfetch" GENTOO_MIRRORS="ftp://mirror.mcs.anl.gov/pub/gentoo ftp://mirror.iawnet.sandia.gov/pub/gentoo/ ftp://ftp.ucsb.edu/pub/mirrors/linux/gentoo/" LANG="C" LDFLAGS="-Wl,-O1 -Wl,--as-needed" MAKEOPTS="-j3" PKGDIR="/usr/portage/packages" PORTAGE_CONFIGROOT="/" 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" SYNC="rsync://rsync.gentoo.org/gentoo-portage" USE="X acl acpi alsa apache2 berkdb blas bzip2 cairo cli cracklib crypt cups cxx dri fftw firefox fortran gdbm gif glut gnome gpm gsteamer gtk iconv imagemagick imap imlib ipod ipv6 java javascript jpeg jpeg2k kerberos lapack ldap modules motif mp3 mpeg mplayer mudflap ncurses nls nptl nptlonly offensive opengl openmp pam pcre pdf perl php plotutils png postgres pppd python qt3 qt3support qt4 quicktime readline reflection ruby samba sasl session sockets spell spl ssl svg sysfs tcl tcpd tetex tiff tk unicode usb vhosts vorbis wifi win32codecs wmf x86 xine xinerama xinetd xml xorg xpm xscreensaver xv xvid 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 mmap_emul 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 cgi cgid 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="keyboard mouse wacom" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="radeon savage vesa" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account" Unset: CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LC_ALL, LINGUAS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PORTDIR_OVERLAY
I'd say no-one really tests motif support anymore. You might want to file a bug upstream [1] and see what they have to say. If you do file a bug, please add "remi@gentoo.org" as a CC on the bug so I can track the issue. Thanks [1] https://bugs.freedesktop.org/enter_bug.cgi?product=Mesa
Upstream bug filed.
It has to be in the build system, as the code didn't change from 7.7 to 7.8.
(In reply to comment #2) > Upstream bug filed. > Hi Justin, Can you provide a link to the upstream bug report?
(In reply to comment #4) > (In reply to comment #2) > > Upstream bug filed. > > > > Hi Justin, > Can you provide a link to the upstream bug report? > see the URL field.
I think I found the problem: At some point mesa started to use the --visibilizy=hidden attribute if gcc supports it. Since in mesa libGLw is build by default as a static library this is of no consequence when linking. But in Gentoo the library is build as a shared library, and hence the visibility is important. By adding GLAPI to the function declaration in question, the problem should go away.
Created attachment 275607 [details, diff] Add GLAPI to the two functions in question This patch fixed it for me (amd64, gcc 4.5.2).
Could you also attach the patch at the upstream bug?
Created attachment 277319 [details, diff] possibly more complete patch that needs testing You need motif or lesstif to check this? I don't use those it applied fine for me but did not get called. the option would be '--enable-glw' was not on my system.
The patch works here.
Fixed in mesa-7.11_rc1