Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 381975

Summary: sys-libs/libsmbios fails to build tests
Product: Gentoo Linux Reporter: Markus Meier <maekke>
Component: Current packagesAssignee: Lars Wendler (Polynomial-C) (RETIRED) <polynomial-c>
Status: RESOLVED FIXED    
Severity: normal    
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: sys-libs:libsmbios-2.2.28:20110905-191711.log
patch to expose set_basedir() in libsmbios_c so that tests can link to it

Description Markus Meier gentoo-dev 2011-09-05 20:12:15 UTC
Created attachment 285665 [details]
sys-libs:libsmbios-2.2.28:20110905-191711.log

2.2.26 and 2.2.28 fail to build in src_test.

 * libsmbios-2.2.28.tar.bz2 RMD160 SHA1 SHA256 size ;-) ... [ ok ]
 * checking ebuild checksums ;-) ... [ ok ]
 * checking auxfile checksums ;-) ... [ ok ]
 * checking miscfile checksums ;-) ... [ ok ]
 * checking libsmbios-2.2.28.tar.bz2 ;-) ... [ ok ]
>>> Unpacking source...

...snip...

libtool: link: i686-pc-linux-gnu-g++ -Wall -O2 -march=i686 -pipe -Wl,--no-undefined -Wl,-as-needed -Wl,-O1 -Wl,--hash-style=gnu -o out/testC_token src/cppunit/out_testC_token-testC_token.o  -L./out/ -Wl,--as-needed out/.libs/libxmlutil.a /usr/lib/libxml2.so -L/usr/lib -lm -licui18n -licuuc -licudata -lpthread -lz out/.libs/libtestmain.a /usr/lib/libcppunit.so -ldl /var/tmp/portage/sys-libs/libsmbios-2.2.28/work/libsmbios-2.2.28/out/.libs/libsmbios.so /var/tmp/portage/sys-libs/libsmbios-2.2.28/work/libsmbios-2.2.28/out/.libs/libsmbios_c.so -Wl,-rpath -Wl,/var/tmp/portage/sys-libs/libsmbios-2.2.28/work/libsmbios-2.2.28/out/.libs
i686-pc-linux-gnu-g++ -DHAVE_CONFIG_H -I. -I./out/include   -I./out/include -I./src/include -DLIBSMBIOS_LOCALEDIR=\"/usr/share/locale\" -DBUILD_LINUX   -Wall -O2 -march=i686 -pipe -MT src/cppunit/out_testC_smi-testC_smi.o -MD -MP -MF src/cppunit/.deps/out_testC_smi-testC_smi.Tpo -c -o src/cppunit/out_testC_smi-testC_smi.o `test -f 'src/cppunit/testC_smi.cpp' || echo './'`src/cppunit/testC_smi.cpp
mv -f src/cppunit/.deps/out_testC_smi-testC_smi.Tpo src/cppunit/.deps/out_testC_smi-testC_smi.Po
/bin/sh ./libtool --tag=CXX   --mode=link i686-pc-linux-gnu-g++ -Wall -O2 -march=i686 -pipe -L./out/ -Wl,--no-undefined -Wl,-as-needed  -static -Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu -o out/testC_smi src/cppunit/out_testC_smi-testC_smi.o out/libtestmain.la  
libtool: link: i686-pc-linux-gnu-g++ -Wall -O2 -march=i686 -pipe -Wl,--no-undefined -Wl,-as-needed -Wl,-O1 -Wl,--hash-style=gnu -o out/testC_smi src/cppunit/out_testC_smi-testC_smi.o  -L./out/ -Wl,--as-needed out/.libs/libtestmain.a /usr/lib/libcppunit.so -ldl /var/tmp/portage/sys-libs/libsmbios-2.2.28/work/libsmbios-2.2.28/out/.libs/libsmbios.so /var/tmp/portage/sys-libs/libsmbios-2.2.28/work/libsmbios-2.2.28/out/.libs/libsmbios_c.so -Wl,-rpath -Wl,/var/tmp/portage/sys-libs/libsmbios-2.2.28/work/libsmbios-2.2.28/out/.libs
src/cppunit/out_testC_smi-testC_smi.o: In function `testCsmi::testLinuxSmi()':
testC_smi.cpp:(.text+0x4ac): undefined reference to `set_basedir'
collect2: ld returned 1 exit status
make[2]: *** [out/testC_smi] Error 1
make[2]: Leaving directory `/var/tmp/portage/sys-libs/libsmbios-2.2.28/work/libsmbios-2.2.28'
make[1]: *** [check-am] Error 2
make[1]: Leaving directory `/var/tmp/portage/sys-libs/libsmbios-2.2.28/work/libsmbios-2.2.28'
make: *** [check-recursive] Error 1
 * ERROR: sys-libs/libsmbios-2.2.28 failed (test phase):
 *   Make check failed. See above for details.
 * 
 * Call stack:
 *     ebuild.sh, line   56:  Called src_test
 *   environment, line 5719:  Called _eapi0_src_test
 *     ebuild.sh, line  642:  Called die
 * The specific snippet of code:
 *                      has test $FEATURES && die "Make check failed. See above for details."


Portage 2.1.10.11 (default/linux/x86/10.0/desktop, gcc-4.4.5, glibc-2.12.2-r0, 2.6.39.3 i686)
=================================================================
System uname: Linux-2.6.39.3-i686-Intel-R-_Core-TM-2_Duo_CPU_T8300_@_2.40GHz-with-gentoo-2.0.3
Timestamp of tree: Mon, 05 Sep 2011 18:00:01 +0000
distcc 3.1 i686-pc-linux-gnu [disabled]
app-shells/bash:          4.1_p9
dev-java/java-config:     2.1.11-r3
dev-lang/python:          2.4.6, 2.5.4-r4, 2.6.6-r2, 2.7.1-r1, 3.1.3-r1
dev-util/cmake:           2.8.4-r1
dev-util/pkgconfig:       0.26
sys-apps/baselayout:      2.0.3
sys-apps/openrc:          0.8.3-r1
sys-apps/sandbox:         2.4
sys-devel/autoconf:       2.13, 2.68
sys-devel/automake:       1.4_p6-r1, 1.5-r1, 1.7.9-r2, 1.8.5-r4, 1.9.6-r3, 1.10.3, 1.11.1
sys-devel/binutils:       2.20.1-r1
sys-devel/gcc:            4.4.5
sys-devel/gcc-config:     1.4.1-r1
sys-devel/libtool:        2.4-r1
sys-devel/make:           3.82
sys-kernel/linux-headers: 2.6.36.1 (virtual/os-headers)
sys-libs/glibc:           2.12.2
Repositories: gentoo
ACCEPT_KEYWORDS="x86"
ACCEPT_LICENSE="*"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=i686 -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /opt/openjms/config /usr/lib/fax /usr/share/config /usr/share/gnupg/qualified.txt /usr/share/openvpn/easy-rsa /var/bind /var/lib/hsqldb /var/spool/fax/etc /var/spool/torque"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.2/ext-active/ /etc/php/apache2-php5.3/ext-active/ /etc/php/cgi-php5.2/ext-active/ /etc/php/cgi-php5.3/ext-active/ /etc/php/cli-php5.2/ext-active/ /etc/php/cli-php5.3/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 -march=i686 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="assume-digests binpkg-logs distlocks ebuild-locks fail-clean fixlafiles fixpackages news parallel-fetch protect-owned sandbox sfperms strict test unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox"
FFLAGS=""
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="en_GB.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu"
LINGUAS="en en_GB de"
MAKEOPTS="-j2"
PKGDIR="/mnt/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"
PORTDIR_OVERLAY=""
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X a52 aac acl acpi alsa apache2 avahi berkdb bluetooth branding bzip2 cairo cdda cdr cli consolekit cracklib crypt cups cxx dbus dri dts dvd dvdr emboss encode examples exif fam firefox flac fortran gdbm gdu gif gnome gpm gtk iconv ipv6 jpeg kde lcms ldap libnotify mad mng modules mp3 mp4 mpeg mudflap ncurses nls nptl nptlonly objc objc++ ogg opengl openmp pam pango pcre pdf perl png policykit ppds pppd python qt3support qt4 readline sdl semantic-desktop session source spell ssl startup-notification svg sysfs tcpd test threads tiff truetype udev unicode usb vorbis x264 x86 xcb xml xorg xulrunner 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" CALLIGRA_FEATURES="kexi words flow plan stage tables krita karbon braindump" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en en_GB de" PHP_TARGETS="php5-3" RUBY_TARGETS="ruby18 jruby ree18" USERLAND="GNU" VIDEO_CARDS="fbdev glint intel mach64 mga neomagic nouveau nv r128 radeon savage sis tdfx trident vesa via vmware dummy v4l" 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, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Ian Stakenvicius (RETIRED) gentoo-dev 2012-06-21 19:07:22 UTC
Created attachment 315931 [details, diff]
patch to expose set_basedir() in libsmbios_c so that tests can link to it

This fix works for me.

The issue seems to relate to -fvisibility=hidden being set when building libsmbios_c , which if I've read the gcc manpage properly means that anything not attributed with "default" aka public visibility will be invisible at link time.  Since the tests are linking to libsmbios_c like any other lib, this function needs to be exposed with "default" availability.

Th above patch does that using the same #define as is used with the rest of the code.
Comment 2 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2012-06-21 19:24:44 UTC
+  21 Jun 2012; Lars Wendler <polynomial-c@gentoo.org> libsmbios-2.2.28.ebuild,
+  +files/libsmbios-2.2.28-cppunit-tests.patch:
+  Fixed test runs. Thanks to Markus Meier for reporting this in bug #381975 and
+  big kudos to Ian Stakenvicius for looking into this problem and providing a
+  working patch.
+