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

Bug 336167

Summary: dev-lang/lua uses system libtool when it should use a local one
Product: Gentoo Linux Reporter: Justin Lecher (RETIRED) <jlec>
Component: Current packagesAssignee: Matti Bickel (RETIRED) <mabi>
Status: RESOLVED FIXED    
Severity: normal CC: ajungren, flameeyes, hans, rafaelmartins
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: /var/log/portage/build/dev-lang/lua-5.1.4-r6:20100906-062204.log
Build log

Description Justin Lecher (RETIRED) gentoo-dev 2010-09-06 06:25:44 UTC
libtool --quiet --tag=CC --mode=compile x86_64-pc-linux-gnu-gcc -c  -DLUA_USE_LINUX -O2 -pipe -march=core2 -frecord-gcc-switches -mssse3 -mcx16 -mmmx -g -Wimplicit-function-declaration -Wmissing-prototypes -o luac.lo luac.c
libtool --quiet --tag=CC --mode=compile x86_64-pc-linux-gnu-gcc -c  -DLUA_USE_LINUX -O2 -pipe -march=core2 -frecord-gcc-switches -mssse3 -mcx16 -mmmx -g -Wimplicit-function-declaration -Wmissing-prototypes -o print.lo print.c
libtool --quiet --tag=CC --mode=link x86_64-pc-linux-gnu-gcc -static -Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu,--sort-common -o luac luac.lo print.lo liblua.la
.libs/luac.o: In function `combine':
/var/tmp/portage/dev-lang/lua-5.1.4-r6/work/lua-5.1.4/src/luac.c:126: undefined reference to `luaF_newproto'
/var/tmp/portage/dev-lang/lua-5.1.4-r6/work/lua-5.1.4/src/luac.c:128: undefined reference to `luaS_newlstr'
/var/tmp/portage/dev-lang/lua-5.1.4-r6/work/lua-5.1.4/src/luac.c:131: undefined reference to `luaM_realloc_'
/var/tmp/portage/dev-lang/lua-5.1.4-r6/work/lua-5.1.4/src/luac.c:133: undefined reference to `luaM_realloc_'
.libs/luac.o: In function `pmain':
/var/tmp/portage/dev-lang/lua-5.1.4-r6/work/lua-5.1.4/src/luac.c:178: undefined reference to `luaU_dump'
.libs/luac.o: In function `combine':
/var/tmp/portage/dev-lang/lua-5.1.4-r6/work/lua-5.1.4/src/luac.c:127: undefined reference to `luaD_growstack'
/var/tmp/portage/dev-lang/lua-5.1.4-r6/work/lua-5.1.4/src/luac.c:131: undefined reference to `luaM_toobig'
/var/tmp/portage/dev-lang/lua-5.1.4-r6/work/lua-5.1.4/src/luac.c:133: undefined reference to `luaM_toobig'
.libs/print.o: In function `printf':
/usr/include/bits/stdio2.h:105: undefined reference to `luaP_opnames'
.libs/print.o: In function `PrintCode':
/var/tmp/portage/dev-lang/lua-5.1.4-r6/work/lua-5.1.4/src/print.c:91: undefined reference to `luaP_opmodes'
/usr/lib/gcc/x86_64-pc-linux-gnu/4.4.4/../../../../x86_64-pc-linux-gnu/bin/ld: luac: hidden symbol `luaM_realloc_' isn't defined
/usr/lib/gcc/x86_64-pc-linux-gnu/4.4.4/../../../../x86_64-pc-linux-gnu/bin/ld: final link failed: Nonrepresentable section on output
collect2: ld returned 1 exit status
make: *** [luac] Error 1
emake failed
 * ERROR: dev-lang/lua-5.1.4-r6 failed:
 *   emake failed
 * 
 * Call stack:



$ emerge --ignore-default-opts --info =dev-lang/lua-5.1.4-r6
Portage 2.2_rc75 (default/linux/amd64/10.0, gcc-4.4.4-asneeded, glibc-2.12.1-r1, 2.6.35-gentoo-r5 x86_64)
=================================================================
                        System Settings
=================================================================
System uname: Linux-2.6.35-gentoo-r5-x86_64-Intel-R-_Core-TM-2_Quad_CPU_Q6600_@_2.40GHz-with-gentoo-2.0.1
Timestamp of tree: Sun, 05 Sep 2010 15:30:02 +0000
distcc 3.1 x86_64-pc-linux-gnu [disabled]
ccache version 2.4 [enabled]
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/ccache:     2.4-r8
dev-util/cmake:      2.8.1-r2
sys-apps/baselayout: 2.0.1
sys-apps/openrc:     0.6.3
sys-apps/sandbox:    2.3-r1
sys-devel/autoconf:  2.13, 2.65-r1
sys-devel/automake:  1.6.3-r1, 1.9.6-r3, 1.10.3, 1.11.1
sys-devel/binutils:  2.20.1-r1
sys-devel/gcc:       4.4.4-r1
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.10
sys-devel/make:      3.81-r2
virtual/os-headers:  2.6.35 (sys-kernel/linux-headers)
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -march=core2 -frecord-gcc-switches -mssse3 -mcx16 -mmmx -g -Wimplicit-function-declaration -Wmissing-prototypes"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/X11/xkb /usr/share/hddtemp/ /usr/share/nano /var/lib/hsqldb"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/portage /etc/revdep-rebuild /etc/sandbox.d /etc/splash /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-O2 -pipe -march=core2 -frecord-gcc-switches -mssse3 -mcx16 -mmmx -g -Wenum-compare -Wno-invalid-offsetof"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--verbose --jobs=12 --load-average=8 --keep-going -t"
FEATURES="assume-digests buildsyspkg ccache collision-protect distlocks fixlafiles fixpackages multilib-strict news noinfo parallel-fetch preserve-libs protect-owned sandbox sfperms sign split-log splitdebug strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync"
FFLAGS="-O2 -pipe -march=core2 -frecord-gcc-switches -mssse3 -mcx16 -mmmx -g"
GENTOO_MIRRORS=" 	ftp://ftp.gentoo.mesh-solutions.com/gentoo/ 	ftp://ftp.tu-clausthal.de/pub/linux/gentoo/ 	ftp://de-mirror.org/distro/gentoo/ 	ftp://linux.rz.ruhr-uni-bochum.de/gentoo-mirror/"
LANG="en_GB.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu,--sort-common"
LINGUAS="en"
MAKEOPTS="-j6 -l8"
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"
PORTDIR_OVERLAY="/data/layman/sunrise /data/layman/science /data/local/portage-overlay /data/local/dummy"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="7zip X acl acpi additions alsa amd64 apbs automount bash-completion berkdb blas branding bzip2 cairo cblas cleartype cli cracklib cups custom-optimization cxx dbus deprecated discouraged double-precision dri dts dvdr emboss fastcgi fbcon fbcondecor fbsplash fftw fortran gd gdbm gecko gif glibc-omitfp gmp gnome gnome-keyring gpm grub gtk hddtemp icc iconv ifc imlib java javascript jpeg lapack largefile ldap libsexy libv4l2 lm_sensors md5sum mmap mmx mmxext modules mp3 mudflap multicall multilib multiprocess multiuser nano-syntax ncurses network-cron networking nls nptl nptlonly nsplugin numpy nvidia opengl openmp openssl optimize-cflags pam pcre perl png pppd pymol python qt-static qt3support readline reflection rrdcgi rtsp sdl sensord session smp spl sse sse2 ssl ssse3 startup-notification svg svgz swat sysfs system-sqlite tcpd tiff truetype type1 unicode v4l v4l2 vorbis x264 xcb xcomposite xinerama xorg xulrunner zlib" ALSA_CARDS="hda-intel" 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 evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en" QEMU_SOFTMMU_TARGETS="i386 x86_64" QEMU_USER_TARGETS="i386 x86_64" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="nvidia 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, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Justin Lecher (RETIRED) gentoo-dev 2010-09-06 06:26:00 UTC
Created attachment 246223 [details]
/var/log/portage/build/dev-lang/lua-5.1.4-r6:20100906-062204.log

build.log
Comment 2 Justin Lecher (RETIRED) gentoo-dev 2010-09-10 14:44:26 UTC
*** Bug 336706 has been marked as a duplicate of this bug. ***
Comment 3 Matti Bickel (RETIRED) gentoo-dev 2010-09-16 11:35:33 UTC
That's strange. Can you please attach the output of
grep '#include' /var/tmp/portage/dev-lang/lua-5.1.4-r6/work/lua-5.1.4/src/luac.c
The includes and function definitions it is complaining about should be there and I can't reproduce the bug here with my CFLAGS. Will now try with yours.
Comment 4 Justin Lecher (RETIRED) gentoo-dev 2010-09-18 15:21:33 UTC
# grep '#include' /var/tmp/portage/dev-lang/lua-5.1.4-r6/work/lua-5.1.4/src/luac.c
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "lua.h"
#include "lauxlib.h"
#include "ldo.h"
#include "lfunc.h"
#include "lmem.h"
#include "lobject.h"
#include "lopcodes.h"
#include "lstring.h"
#include "lundump.h"
Comment 5 Justin Lecher (RETIRED) gentoo-dev 2010-09-18 15:25:15 UTC
It magically disappeared now. Don't know what I changed. Perhaps we should close w/ INVALID.
Comment 6 Diego Elio Pettenò (RETIRED) gentoo-dev 2010-10-26 17:12:33 UTC
Created attachment 252045 [details]
Build log
Comment 7 Diego Elio Pettenò (RETIRED) gentoo-dev 2010-10-26 17:13:45 UTC
Probably a parallel make problem?
Comment 8 Diego Elio Pettenò (RETIRED) gentoo-dev 2011-05-20 11:22:34 UTC
Not a paralell make bug, and I'm hitting this as well now in my hardened vservers chroot.
Comment 9 Diego Elio Pettenò (RETIRED) gentoo-dev 2011-05-20 11:37:34 UTC
Justin did you play with libtool's econf line by chance? I hit this because I built my libtool with --disable-static.
Comment 10 Justin Lecher (RETIRED) gentoo-dev 2011-05-20 11:42:53 UTC
(In reply to comment #9)
> Justin did you play with libtool's econf line by chance? I hit this because I
> built my libtool with --disable-static.

Its an old bug, but I will test it again.
Comment 11 Justin Lecher (RETIRED) gentoo-dev 2011-05-20 11:46:01 UTC
I cannot reproduce it anymore.
Comment 12 Justin Lecher (RETIRED) gentoo-dev 2011-05-20 11:48:23 UTC
EXTRA_ECONF="--disable-static" iemerge -1 =dev-lang/lua-5.1.4 libtool

Makes it fail.
Comment 13 Diego Elio Pettenò (RETIRED) gentoo-dev 2011-05-20 14:00:43 UTC
I guess we can consider this as WORKSFORME or INVALID then, but at least we know what causes it.

On the other hand I think that lua's build system is crazy, but that's beside the point I guess.
Comment 14 Justin Lecher (RETIRED) gentoo-dev 2011-05-20 14:12:37 UTC
Works for everyone who doesn't fiddle around with libtool.
Comment 15 Rafael Martins (RETIRED) gentoo-dev 2011-05-20 14:21:29 UTC
For a long time I'm planning to port the Lua build system for autotools and throw these handwritten Makefiles away, but looking at the lua mailing list archives I saw that other people already tried something like that without success.
Comment 16 Rafael Martins (RETIRED) gentoo-dev 2011-05-20 14:22:36 UTC
(In reply to comment #15)
> For a long time I'm planning to port the Lua build system for autotools and
> throw these handwritten Makefiles away, but looking at the lua mailing list
> archives I saw that other people already tried something like that without
> success.

I mean the upstream rejected the patches.
Comment 17 Ayron Jungren 2011-10-18 16:32:26 UTC
I get the same error now emerging dev-lang/lua. I have never touched libtool, and in fact, I tried emerge -1 libtool lua to rebuild libtool, and that did nothing. I've also tried disabling parallel make, which didn't do anything.

# emerge --ignore-default-opts --info =dev-lang/lua-5.1.4-r7
Portage 2.1.10.27 (default/linux/x86/10.0/desktop, gcc-4.5.3, glibc-2.13-r4, 3.0.6-gentoo i686)
=================================================================
                        System Settings
=================================================================
System uname: Linux-3.0.6-gentoo-i686-Intel-R-_Atom-TM-_CPU_N270_@_1.60GHz-with-gentoo-2.1
Timestamp of tree: Mon, 17 Oct 2011 03:00:01 +0000
app-shells/bash:          4.2_p10
dev-lang/python:          2.7.2-r3, 3.2.2
dev-util/pkgconfig:       0.26
sys-apps/baselayout:      2.1
sys-apps/openrc:          0.9.4
sys-apps/sandbox:         2.5
sys-devel/autoconf:       2.68
sys-devel/automake:       1.11.1-r1
sys-devel/binutils:       2.21.1-r1
sys-devel/gcc:            4.5.3-r1
sys-devel/gcc-config:     1.4.1-r1
sys-devel/libtool:        2.4-r3
sys-devel/make:           3.82-r3
sys-kernel/linux-headers: 2.6.39 (virtual/os-headers)
sys-libs/glibc:           2.13-r4
Repositories: gentoo
ACCEPT_KEYWORDS="x86 ~x86"
ACCEPT_LICENSE="* -@EULA"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-ggdb -march=native -O2 -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-ggdb -march=native -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="assume-digests binpkg-logs distlocks ebuild-locks fixlafiles news parallel-fetch protect-owned sandbox sfperms splitdebug strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"
FFLAGS=""
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="en"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_COMPRESS="xz"
PORTAGE_COMPRESS_FLAGS="-9eq"
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 acpi alsa bash-completion bluetooth branding bzip2 cairo cdda cdr cli consolekit cracklib crypt cscope cups curl cxx dbus dri dts dvd dvdr emboss encode exif fam firefox flac fortran gdu gif gmp gpm gtk icu ipv6 jpeg lcms libnotify lua lzma mad mmx mng modules mp3 mp4 mpeg mudflap ncurses nptl nptlonly offensive ogg opengl openmp pam pango pcre pdf perl png policykit ppds pppd python readline sdl session spell sse sse2 sse3 ssl ssse3 startup-notification svg sysfs threads tiff truetype udev unicode usb vim-syntax vorbis x264 x86 xcb xml xorg xulrunner xv xvid zlib" ALSA_CARDS="hda-intel" 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="evdev keyboard mouse synaptics wacom" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en" PHP_TARGETS="php5-3" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="intel" 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, LANG, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_RSYNC_EXTRA_OPTS
Comment 18 Diego Elio Pettenò (RETIRED) gentoo-dev 2011-10-18 17:11:09 UTC
That's because the static-libs USE flag in current libtool ebuild does the same as my stupid hack before. So we're back to square one.
Comment 19 Ayron Jungren 2011-10-18 17:16:30 UTC
Yep, I can confirm that adding "sys-devel/libtool static-libs" to package.use makes dev-lang/lua build fine. Are there any bad side effects to adding the static-libs USE flag?
Comment 20 SpanKY gentoo-dev 2011-10-20 03:15:07 UTC
this looks like a failing in lua to me.  it shouldn't be using the system libtool and any package doing so are broken.

in this case, it builds its "luac" binary and statically links against liblua.a instead of using the dynamic liblua.so.  the luac binary uses symbols which are marked hidden in liblua.so.  you can reproduce the issue regardless of how system libtool is built by removing -static from the Makefile link steps.

the system libtool itself does change behavior (see build_old_libs=no/yes in /usr/bin/libtool).  so it only outputs PIC objects *by default*.  i'll probably tweak this in a newer libtool, but lua is still broken and needs addressing.
Comment 21 Matti Bickel (RETIRED) gentoo-dev 2012-01-24 21:57:55 UTC
The point is that lua never had a local libtool. I hacked the build process so we could get dynamic libs in the first place.

@spanky: What do you suggest, shipping a fixed libtool via custom patchset? I thought libtool was there for Makefiles to call it?
Comment 22 Matti Bickel (RETIRED) gentoo-dev 2012-03-04 23:01:38 UTC
I've introduced a minimal configure.in to generate a local libtool. Since I touch autotools with a 5" pole, can somebody check that I didn't break lua in the process?
Comment 23 Ulenrich 2012-03-05 19:10:19 UTC
Is this lua-5.2 local libtool provoking 
https://bugs.gentoo.org/show_bug.cgi?id=406985
?
Comment 24 Matti Bickel (RETIRED) gentoo-dev 2012-03-17 21:35:07 UTC
The bug is probably not related to libtool (since it should have happened with my libtooled 5.1, too).

I'm closing this as nobody commented on the actual merit of the patch and so I assume it's doing what it's supposed to do.

Let's get on with fixing the lua-5.2 upgrade headaches :)