Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 274802 - dev-tex/luatex-0.40.5 fails to build (undefined reference to `mainbody')
Summary: dev-tex/luatex-0.40.5 fails to build (undefined reference to `mainbody')
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: TeX project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-06-20 12:44 UTC by Davide Pesavento
Modified: 2009-06-25 14:15 UTC (History)
2 users (show)

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


Attachments
build.log (build.log,158.68 KB, text/plain)
2009-06-20 12:46 UTC, Davide Pesavento
Details
my emerge --info (emerge--info,4.25 KB, text/plain)
2009-06-20 12:48 UTC, Davide Pesavento
Details
output of emerge --info (emerge_info.txt,4.29 KB, text/plain)
2009-06-22 06:48 UTC, Michael Schachtebeck
Details
emerge --info (emerge_info,4.21 KB, text/plain)
2009-06-22 22:15 UTC, Marco Leogrande
Details
build.log (build.log,133.10 KB, text/plain)
2009-06-23 07:08 UTC, Michael Schachtebeck
Details
build.log (build.log,132.81 KB, text/plain)
2009-06-24 08:37 UTC, Michael Schachtebeck
Details
${WORKDIR}/luatex-beta-0.40.5/source/texk/web2c/libtool (libtool,260.56 KB, text/plain)
2009-06-24 19:16 UTC, Davide Pesavento
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Davide Pesavento gentoo-dev 2009-06-20 12:44:10 UTC
/bin/sh ./libtool --tag=CC   --mode=link x86_64-pc-linux-gnu-gcc  -O2 -march=core2 -ggdb -pipe  -Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu -o ctangleboot ctangleboot.o cwebboot.o lib/lib.a /var/tmp/portage/dev-tex/luatex-0.40.5/work/luatex-beta-0.40.5/source/texk/kpathsea/libkpathsea.la -lm   
x86_64-pc-linux-gnu-ranlib liblua51.a 
eval: 1: libtool_args+=: not found    
eval: 1: compile_command+=: not found 
eval: 1: finalize_command+=: not found
eval: 1: libtool_args+=: not found    
eval: 1: compile_command+=: not found 
eval: 1: finalize_command+=: not found
eval: 1: libtool_args+=: not found    
eval: 1: compile_command+=: not found 
eval: 1: finalize_command+=: not found
eval: 1: libtool_args+=: not found    
eval: 1: compile_command+=: not found 
eval: 1: finalize_command+=: not found
eval: 1: libtool_args+=: not found    
eval: 1: compile_command+=: not found 
eval: 1: finalize_command+=: not found
eval: 1: libtool_args+=: not found     
eval: 1: libtool_args+=: not found    
eval: 1: compile_command+=: not found 
eval: 1: finalize_command+=: not found
eval: 1: libtool_args+=: not found    
eval: 1: compile_command+=: not found 
eval: 1: finalize_command+=: not found
eval: 1: libtool_args+=: not found    
eval: 1: compile_command+=: not found 
eval: 1: finalize_command+=: not found
eval: 1: libtool_args+=: not found    
eval: 1: compile_command+=: not found 
eval: 1: finalize_command+=: not found
eval: 1: libtool_args+=: not found    
eval: 1: compile_command+=: not found 
eval: 1: finalize_command+=: not found
eval: 1: libtool_args+=: not found    
eval: 1: libtool_args+=: not found    
eval: 1: libtool_args+=: not found    
x86_64-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I./.. -I/var/tmp/portage/dev-tex/luatex-0.40.5/work/luatex-beta-0.40.5/source/texk -I/var/tmp/portage/dev-tex/luatex-0.40.5/work/luatex-beta-0.40.5/source/texk  -I./luatexdir/lua51 -I./luatexdir/zziplib   -O2 -march=core2 -ggdb -pipe -MT libluamisc_a-lfs.o -MD -MP -MF .deps/libluamisc_a-lfs.Tpo -c -o libluamisc_a-lfs.o `test -f 'luatexdir/luafilesystem/src/lfs.c' || echo './'`luatexdir/luafilesystem/src/lfs.c 
libtool: link: x86_64-pc-linux-gnu-gcc  -Wl,--as-needed lib/lib.a /var/tmp/portage/dev-tex/luatex-0.40.5/work/luatex-beta-0.40.5/source/texk/kpathsea/.libs/libkpathsea.a -lm   
lib/lib.a(main.o): In function `main':
/var/tmp/portage/dev-tex/luatex-0.40.5/work/luatex-beta-0.40.5/source/texk/web2c/lib/main.c:25: undefined reference to `mainbody'   
collect2: ld returned 1 exit status   
make[4]: *** [ctangleboot] Error 1    
make[4]: *** Waiting for unfinished jobs....  
mv -f .deps/libluamisc_a-lfs.Tpo .deps/libluamisc_a-lfs.Po
mv -f .deps/tangleboot.Tpo .deps/tangleboot.Po
make[4]: Leaving directory `/var/tmp/portage/dev-tex/luatex-0.40.5/work/luatex-beta-0.40.5/source/texk/web2c'     
make[3]: *** [all-recursive] Error 1  
make[3]: Leaving directory `/var/tmp/portage/dev-tex/luatex-0.40.5/work/luatex-beta-0.40.5/source/texk/web2c'     
make[2]: *** [all] Error 2
make[2]: Leaving directory `/var/tmp/portage/dev-tex/luatex-0.40.5/work/luatex-beta-0.40.5/source/texk/web2c'     
make[1]: *** [subtexk] Error 1  
make[1]: Leaving directory `/var/tmp/portage/dev-tex/luatex-0.40.5/work/luatex-beta-0.40.5/source/texk'   
make: *** [all-recursive] Error 1     
 *
 * ERROR: dev-tex/luatex-0.40.5 failed. 
 * Call stack:
 *   ebuild.sh, line   49:  Called src_compile
 * environment, line 2744:  Called die  
 * The specific snippet of code:
 * emake || die "failed to build luatex"
 *  The die message:
 *   failed to build luatex
Comment 1 Davide Pesavento gentoo-dev 2009-06-20 12:46:01 UTC
Created attachment 195272 [details]
build.log
Comment 2 Davide Pesavento gentoo-dev 2009-06-20 12:48:10 UTC
Created attachment 195274 [details]
my emerge --info
Comment 3 Michael Schachtebeck 2009-06-22 06:47:50 UTC
Same here with a different CPU and different profile, CFLAGS, and LDFLAGS (see attachment).
Comment 4 Michael Schachtebeck 2009-06-22 06:48:30 UTC
Created attachment 195423 [details]
output of emerge --info
Comment 5 Alexis Ballier gentoo-dev 2009-06-22 20:52:52 UTC
actually this should be fixed by the hard dep on libtool 2.2.6
Comment 6 Davide Pesavento gentoo-dev 2009-06-22 22:02:29 UTC
(In reply to comment #5)
> actually this should be fixed by the hard dep on libtool 2.2.6
> 

Doesn't seem so. I already have libtool-2.2.6a installed (check my emerge --info).
Comment 7 Marco Leogrande 2009-06-22 22:08:13 UTC
I do have sys-devel/libtool-2.2.6a and dev-tex/luatex-0.40.5 compiles fine now, so it must be something else.
Comment 8 Marco Leogrande 2009-06-22 22:15:26 UTC
Created attachment 195521 [details]
emerge --info

Actually, I do have stray files from a previous installation of sys-devel/libtool-1.5.26, as I'm in the middle of a @preserved-rebuild emerge.
Comment 9 Michael Schachtebeck 2009-06-23 06:24:12 UTC
I already have sys-devel/libtool-2.2.6a installed (look at the output of emerge --info) and also tried to rebuild it before emerging luatex - but it does not work.

Please let me know if you need further input.
Comment 10 Alexis Ballier gentoo-dev 2009-06-23 07:01:44 UTC
(In reply to comment #9)
> Please let me know if you need further input.


the full build log and the output of ./libtool --version in /var/tmp/portage/dev-tex/luatex-0.40.5/work/luatex-beta-0.40.5/source/texk/kpathsea/

(assuming its the same bug as the original reporter...)
Comment 11 Michael Schachtebeck 2009-06-23 07:08:51 UTC
Created attachment 195532 [details]
build.log
Comment 12 Michael Schachtebeck 2009-06-23 07:09:31 UTC
segfault ~ # cd /var/tmp/portage/dev-tex/luatex-0.40.5/work/luatex-beta-0.40.5/source/texk/kpathsea/
segfault kpathsea # ./libtool --version
ltmain.sh (GNU libtool) 2.2.6
Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996

Copyright (C) 2008 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Comment 13 Alexis Ballier gentoo-dev 2009-06-24 08:24:29 UTC
please post a full build log with MAKEOPTS="-j1" because I cant reproduce it and have really no clue what could be the problem...
Comment 14 Michael Schachtebeck 2009-06-24 08:36:45 UTC
For the build log attached, I already had commented out the MAKEOPTS part from make.conf, so it should be the same as setting it to 1 - however, I explicitly set it as desired, here is the output...
Comment 15 Michael Schachtebeck 2009-06-24 08:37:30 UTC
Created attachment 195641 [details]
build.log
Comment 16 Alexis Ballier gentoo-dev 2009-06-24 09:20:25 UTC
(In reply to comment #15)
> Created an attachment (id=195641) [edit]
> build.log


Thanks; this seems to be the libtool in /var/tmp/portage/dev-tex/luatex-0.40.5/work/luatex-beta-0.40.5/source/texk/web2c that is broken somehow.

Could you please give me the './libtool --version' output from that directory after a failure?
Comment 17 Michael Schachtebeck 2009-06-24 09:35:53 UTC
It does not look strange:



segfault ~ # cd /var/tmp/portage/dev-tex/luatex-0.40.5/work/luatex-beta-0.40.5/source/texk/web2c
segfault web2c # ./libtool --version
ltmain.sh (GNU libtool) 2.2.6
Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996

Copyright (C) 2008 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.



Even

for DIR in $(find /var/tmp/portage/dev-tex/luatex-0.40.5/work/luatex-beta-0.40.5/source -name libtool -exec dirname {} \;); do cd "${DIR}"; ././libtool --version; done

does not show anything strange.
Comment 18 Alexis Ballier gentoo-dev 2009-06-24 18:16:45 UTC
(In reply to comment #17)
> segfault ~ # cd
> /var/tmp/portage/dev-tex/luatex-0.40.5/work/luatex-beta-0.40.5/source/texk/web2c
> segfault web2c # ./libtool --version

weird, could you please attach it?

this libtool seems broken since:
/bin/sh ./libtool --tag=CC   --mode=link i686-pc-linux-gnu-gcc  -O2 -march=native -fomit-frame-pointer -pipe  -Wl,-O1 -o tangleboot tangleboot.o lib/lib.a /var/tmp/portage/dev-tex/luatex-0.40.5/work/luatex-beta-0.40.5/source/texk/kpathsea/libkpathsea.la -lm 


becomes:
libtool: link: i686-pc-linux-gnu-gcc  lib/lib.a /var/tmp/portage/dev-tex/luatex-0.40.5/work/luatex-beta-0.40.5/source/texk/kpathsea/.libs/libkpathsea.a -lm


with some errors, and obviously, since tangleboot.o was dropped, you get this failure.
Comment 19 Davide Pesavento gentoo-dev 2009-06-24 19:16:15 UTC
Created attachment 195681 [details]
${WORKDIR}/luatex-beta-0.40.5/source/texk/web2c/libtool
Comment 20 Davide Pesavento gentoo-dev 2009-06-24 19:52:57 UTC
libtool is executed under the /bin/sh interpreter (dash on my system), but at least the following function uses a non-posix construct (+=), which is not supported by dash.

func_append ()
{
  eval "$1+=\$2"
}

Running libtool with bash does solve the issue. I don't know what the root cause is though: either libtool should request bash, or that code shouldn't be there.
Comment 21 Alexis Ballier gentoo-dev 2009-06-24 20:30:14 UTC
indeed, i can reproduce the failure with sh as dash, though configure outputs this:

checking whether the shell understands "+="... yes


and... well... this check is intended for using += or not in libtool... and the check seems to be lying...
Comment 22 Michael Schachtebeck 2009-06-24 20:32:17 UTC
I have dash, too - so this really seems to be the problem.
Comment 23 Davide Pesavento gentoo-dev 2009-06-24 21:42:03 UTC
(In reply to comment #21)
> and... well... this check is intended for using += or not in libtool... and the
> check seems to be lying...
> 

But the configure script is run by bash...

make[1]: Entering directory `/var/tmp/portage/dev-tex/luatex-0.40.5/work/luatex-beta-0.40.5/source/texk'
=== configuring in web2c (/var/tmp/portage/dev-tex/luatex-0.40.5/work/luatex-beta-0.40.5/source/texk/web2c)
make: running /bin/bash ./configure
Comment 24 Davide Pesavento gentoo-dev 2009-06-24 21:54:46 UTC
This should be solved by running an econf in "${S}"/texk/web2c or by patching texk/Makefile.am
Comment 25 Michael Schachtebeck 2009-06-25 07:17:23 UTC
I can confirm that setting /bin/sh as a symlink to /bin/bash solves the problem for me.
Comment 26 Alexis Ballier gentoo-dev 2009-06-25 09:37:35 UTC
okey, now if I do: CONFIG_SHELL=/bin/sh emerge -1 luatex, this works even with dash as /bin/sh. It is still unclear to me why luatex autofoo uses bash as CONFIG_SHELL which causes these issues...
Comment 27 Alexis Ballier gentoo-dev 2009-06-25 14:15:22 UTC
should be fixed by configuring and building in the texk/web2c subdir as it was done in older ebuilds.