Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 350532 - app-editors/emacs-23.2-r2 wrong multilib ABI for crt1.o
Summary: app-editors/emacs-23.2-r2 wrong multilib ABI for crt1.o
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: High normal (vote)
Assignee: Emacs project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-01-04 13:15 UTC by Niklas Johansson
Modified: 2011-01-30 09:14 UTC (History)
1 user (show)

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


Attachments
emerge --info =app-editors/emacs-23.2-r2 (A,4.23 KB, text/plain)
2011-01-04 13:16 UTC, Niklas Johansson
Details
emerge -pqv =app-editors/emacs-23.2-r2 (B,219 bytes, text/plain)
2011-01-04 13:16 UTC, Niklas Johansson
Details
build.log (C,81.44 KB, text/plain)
2011-01-04 13:16 UTC, Niklas Johansson
Details
environment (D,138.08 KB, text/plain)
2011-01-04 13:17 UTC, Niklas Johansson
Details
Patch for src/s/gnu-linux.h (emacs-23.2-gnu-linux-crt-dir.patch,759 bytes, patch)
2011-01-25 21:25 UTC, Ulrich Müller
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Niklas Johansson 2011-01-04 13:15:00 UTC
src -D_BSD_SOURCE -I/remote/filer.gx/user.active/njohan/gentoo_prefix/usr/include -I/remote/filer.gx/user.active/njohan/gentoo_prefix/usr/include/alsa    -O2 -pipe -I/remote/filer.gx/user.active/njohan/gentoo_prefix/usr/include -MMD -MF deps/prefix-args.d prefix-args.c
touch stamp-oldxmenu
i686-pc-linux-gnu-gcc -c -D_BSD_SOURCE   -Demacs -DHAVE_CONFIG_H  -I. -I/remote/filer.gx/user.active/njohan/gentoo_prefix/var/tmp/portage/app-editors/emacs-23.2-r2/work/emacs-23.2/src -D_BSD_SOURCE -I/remote/filer.gx/user.active/njohan/gentoo_prefix/usr/include -I/remote/filer.gx/user.active/njohan/gentoo_prefix/usr/include/alsa    -O2 -pipe -I/remote/filer.gx/user.active/njohan/gentoo_prefix/usr/include -MMD -MF deps/doc.d doc.c
i686-pc-linux-gnu-gcc -Wl,-O1 -Wl,-znocombreloc   prefix-args.o -o prefix-args
i686-pc-linux-gnu-gcc -nostdlib `./prefix-args -Xlinker  -z nocombreloc` -Wl,-O1 -Wl,-znocombreloc   -o temacs pre-crt0.o /usr/lib/crt1.o /usr/lib/crti.o dispnew.o frame.o scroll.o xdisp.o menu.o xmenu.o window.o charset.o coding.o category.o ccl.o character.o chartab.o cm.o term.o terminal.o xfaces.o xterm.o xfns.o xselect.o xrdb.o fontset.o xsmfns.o fringe.o image.o xsettings.o xgselect.o   emacs.o keyboard.o macros.o keymap.o sysdep.o buffer.o filelock.o insdel.o marker.o minibuf.o fileio.o dired.o filemode.o cmds.o casetab.o casefiddle.o indent.o search.o regex.o undo.o alloc.o data.o doc.o editfns.o callint.o eval.o floatfns.o fns.o font.o print.o lread.o syntax.o unexelf.o bytecode.o process.o callproc.o region-cache.o sound.o atimer.o doprnt.o strftime.o intervals.o textprop.o composite.o md5.o    xfont.o terminfo.o lastfile.o   vm-limit.o     ../oldXMenu/libXMenu11.a   -lSM -lICE -ltiff -ljpeg -lpng -lz -lm -lgif -lXpm -lX11  -L/remote/filer.gx/user.active/njohan/gentoo_prefix/usr/lib -lasound   -lncurses   -L/remote/filer.gx/user.active/njohan/gentoo_prefix/usr/lib -lfontconfig  -lm -lgcc -lc -lgcc /usr/lib/crtn.o 
/usr/lib/crt1.o: could not read symbols: File in wrong format
collect2: ld returned 1 exit status
make[1]: *** [temacs] Error 1
make[1]: Leaving directory `/remote/filer.gx/user.active/njohan/gentoo_prefix/var/tmp/portage/app-editors/emacs-23.2-r2/work/emacs-23.2/src'
make: *** [src] Error 2
emake failed
 * ERROR: app-editors/emacs-23.2-r2 failed:
 *   emake failed
 * 
 * Call stack:
 *     ebuild.sh, line  62:  Called src_compile
 *   environment, line 3543:  Called die
 * The specific snippet of code:
 *       emake CC="$(tc-getCC)" || die "emake failed"
 * 
 * If you need support, post the output of 'emerge --info =app-editors/emacs-23.2-r2',
 * the complete build log and the output of 'emerge -pqv =app-editors/emacs-23.2-r2'.
 * The complete build log is located at '/remote/filer.gx/user.active/njohan/gentoo_prefix/var/tmp/portage/app-editors/emacs-23.2-r2/temp/build.log'.
 * The ebuild environment file is located at '/remote/filer.gx/user.active/njohan/gentoo_prefix/var/tmp/portage/app-editors/emacs-23.2-r2/temp/environment'.
 * S: '/remote/filer.gx/user.active/njohan/gentoo_prefix/var/tmp/portage/app-editors/emacs-23.2-r2/work/emacs-23.2'


Reproducible: Always
Comment 1 Niklas Johansson 2011-01-04 13:16:21 UTC
Created attachment 258807 [details]
emerge --info =app-editors/emacs-23.2-r2
Comment 2 Niklas Johansson 2011-01-04 13:16:37 UTC
Created attachment 258809 [details]
emerge -pqv =app-editors/emacs-23.2-r2
Comment 3 Niklas Johansson 2011-01-04 13:16:57 UTC
Created attachment 258810 [details]
build.log
Comment 4 Niklas Johansson 2011-01-04 13:17:21 UTC
Created attachment 258811 [details]
environment
Comment 5 Niklas Johansson 2011-01-04 13:18:07 UTC
My guess:

It uses local non-prefix file:
  /usr/lib/crtn.o 
Comment 6 Fabian Groffen gentoo-dev 2011-01-04 13:19:57 UTC
hmmm, yeah, I wonder what it's necessary for anyway.
Comment 7 Ulrich Müller gentoo-dev 2011-01-25 17:50:54 UTC
What does "gcc -print-file-name=crt1.o" output?
Comment 8 Fabian Groffen gentoo-dev 2011-01-25 18:22:22 UTC
crt1.o is IIRC never provided by a prefix, so something like /usr/lib/crt1.o
Comment 9 Ulrich Müller gentoo-dev 2011-01-25 18:55:36 UTC
(In reply to comment #8)
> crt1.o is IIRC never provided by a prefix, so something like /usr/lib/crt1.o

Indeed, the build.log shows that it's trying to link against /usr/lib/crt1.o. My guess is that this is the 64 bit version, and that /usr/lib32/crt1.o should be used instead.

Comment 10 Fabian Groffen gentoo-dev 2011-01-25 19:21:01 UTC
Yeah, but why is it necessary to give this explicitly?  GCC in general knows best how to do it in the end...
Comment 11 Ulrich Müller gentoo-dev 2011-01-25 19:45:16 UTC
(In reply to comment #10)
> Yeah, but why is it necessary to give this explicitly?

It's like this (since about 25 years ;) because Emacs's own pre-crt0.o must be first in the linking sequence.
Comment 12 Ulrich Müller gentoo-dev 2011-01-25 21:25:35 UTC
Created attachment 260716 [details, diff]
Patch for src/s/gnu-linux.h

Does attached patch fix the issue?
Comment 13 Niklas Johansson 2011-01-25 22:07:47 UTC
(In reply to comment #7)
> What does "gcc -print-file-name=crt1.o" output?
> 

On my system I get this:

$ gcc -print-file-name=crt1.o
/usr/lib/../lib32/crt1.o
Comment 14 Niklas Johansson 2011-01-25 22:09:23 UTC
(In reply to comment #12)
> Created an attachment (id=260716) [details]
> Patch for src/s/gnu-linux.h
> 
> Does attached patch fix the issue?
> 

1) I patched using the above.

2) ./configure

3) make

gcc -c -D_BSD_SOURCE   -Demacs -DHAVE_CONFIG_H  -I. -I/remote/filer.gx/user.active/njohan/gentoo_prefix/var/tmp/portage/app-editors/emacs-23.2-r2/work/emacs-23.2/src -D_BSD_SOURCE -I/remote/filer.gx/user.active/njohan/gentoo_prefix/usr/include -I/remote/filer.gx/user.active/njohan/gentoo_prefix/usr/include/alsa    -g -O2 -Wdeclaration-after-statement -Wno-pointer-sign   -I/remote/filer.gx/user.active/njohan/gentoo_prefix/usr/include -MMD -MF deps/vm-limit.d vm-limit.c
gcc -c -D_BSD_SOURCE   -Demacs -DHAVE_CONFIG_H  -I. -I/remote/filer.gx/user.active/njohan/gentoo_prefix/var/tmp/portage/app-editors/emacs-23.2-r2/work/emacs-23.2/src -D_BSD_SOURCE -I/remote/filer.gx/user.active/njohan/gentoo_prefix/usr/include -I/remote/filer.gx/user.active/njohan/gentoo_prefix/usr/include/alsa    -g -O2 -Wdeclaration-after-statement -Wno-pointer-sign   -I/remote/filer.gx/user.active/njohan/gentoo_prefix/usr/include -MMD -MF deps/widget.d widget.c
gcc -c -D_BSD_SOURCE   -Demacs -DHAVE_CONFIG_H  -I. -I/remote/filer.gx/user.active/njohan/gentoo_prefix/var/tmp/portage/app-editors/emacs-23.2-r2/work/emacs-23.2/src -D_BSD_SOURCE -I/remote/filer.gx/user.active/njohan/gentoo_prefix/usr/include -I/remote/filer.gx/user.active/njohan/gentoo_prefix/usr/include/alsa    -g -O2 -Wdeclaration-after-statement -Wno-pointer-sign   -I/remote/filer.gx/user.active/njohan/gentoo_prefix/usr/include -MMD -MF deps/prefix-args.d prefix-args.c
gcc -Wl,-znocombreloc   prefix-args.o -o prefix-args
gcc -nostdlib `./prefix-args -Xlinker  -z nocombreloc` -Wl,-znocombreloc   -o temacs pre-crt0.o /usr/lib64/crt1.o /usr/lib64/crti.o dispnew.o frame.o scroll.o xdisp.o menu.o xmenu.o window.o charset.o coding.o category.o ccl.o character.o chartab.o cm.o term.o terminal.o xfaces.o xterm.o xfns.o xselect.o xrdb.o fontset.o xsmfns.o fringe.o image.o xsettings.o xgselect.o   emacs.o keyboard.o macros.o keymap.o sysdep.o buffer.o filelock.o insdel.o marker.o minibuf.o fileio.o dired.o filemode.o cmds.o casetab.o casefiddle.o indent.o search.o regex.o undo.o alloc.o data.o doc.o editfns.o callint.o eval.o floatfns.o fns.o font.o print.o lread.o syntax.o unexelf.o bytecode.o process.o callproc.o region-cache.o sound.o atimer.o doprnt.o strftime.o intervals.o textprop.o composite.o md5.o    xfont.o terminfo.o lastfile.o   vm-limit.o widget.o    ../lwlib/liblw.a  -lXaw3d -lXmu -lXt -lSM -lICE -lXext -ltiff -ljpeg -lpng -lz -lm -lgif -lXpm -lX11  -L/remote/filer.gx/user.active/njohan/gentoo_prefix/usr/lib -lasound   -lncurses   -L/remote/filer.gx/user.active/njohan/gentoo_prefix/usr/lib -lfontconfig  -lm -lgcc -lc -lgcc /usr/lib64/crtn.o 
/usr/lib64/crt1.o: could not read symbols: File in wrong format
collect2: ld returned 1 exit status
make[1]: *** [temacs] Error 1
make[1]: Leaving directory `/remote/filer.gx/user.active/njohan/gentoo_prefix/var/tmp/portage/app-editors/emacs-23.2-r2/work/emacs-23.2/src'
make: *** [src] Error 2

Comment 15 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2011-01-25 22:19:28 UTC
Ugh, the real issue here that you are finding:

- 32bit userland (~x86-linux)
- Probably 64bit /usr/lib{,64}/crt1.o

It would help some debugging if you can list the output of "file /usr/lib/crt1.o" and "file /usr/lib64/crt1.o" (and lib32 if you have it)
Comment 16 Ulrich Müller gentoo-dev 2011-01-25 22:22:31 UTC
(In reply to comment #14)
> 1) I patched using the above.
> 
> 2) ./configure

You use plain configure without any options? This won't work. Please try:
   ./configure --with-crt-dir=/usr/lib32

Or, alternatively, apply the patch from within the ebuild.

Comment 17 Niklas Johansson 2011-01-25 22:34:34 UTC
(In reply to comment #15)
> Ugh, the real issue here that you are finding:
> 
> - 32bit userland (~x86-linux)
> - Probably 64bit /usr/lib{,64}/crt1.o
> 
> It would help some debugging if you can list the output of "file
> /usr/lib/crt1.o" and "file /usr/lib64/crt1.o" (and lib32 if you have it)
> 

$ file /usr/lib/crt1.o 
/usr/lib/crt1.o: ELF 64-bit LSB relocatable, x86-64, version 1 (SYSV), for 

$ file /usr/lib32/crt1.o 
/usr/lib32/crt1.o: ELF 32-bit LSB relocatable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.6.15, not stripped

$ file /usr/lib64/crt1.o 
/usr/lib64/crt1.o: ELF 64-bit LSB relocatable, x86-64, version 1 (SYSV), for GNU/Linux 2.6.15, not stripped
Comment 18 Niklas Johansson 2011-01-25 22:39:13 UTC
(In reply to comment #16)
> (In reply to comment #14)
> > 1) I patched using the above.
> > 
> > 2) ./configure
> 
> You use plain configure without any options? This won't work. Please try:
>    ./configure --with-crt-dir=/usr/lib32
> 
> Or, alternatively, apply the patch from within the ebuild.
> 

1) Patch
2) ./configure --with-crt-dir=/usr/lib32
3) make

WORKING !
Comment 19 Ulrich Müller gentoo-dev 2011-01-25 22:57:11 UTC
(In reply to comment #18)
> 1) Patch
> 2) ./configure --with-crt-dir=/usr/lib32
> 3) make
> 
> WORKING !

Good. :)

I've fixed this in the Emacs overlay:
<https://overlays.gentoo.org/proj/emacs/changeset/1570>

The ebuild from there will be moved to the main portage tree very soon.
Comment 20 Niklas Johansson 2011-01-25 22:59:32 UTC
Thanks for solving this bug :)
Comment 21 Ulrich Müller gentoo-dev 2011-01-29 10:11:55 UTC
Reassigning to emacs because this also affects native amd64 with ABI="x86".
Comment 22 Ulrich Müller gentoo-dev 2011-01-30 09:14:38 UTC
Ebuild moved to main tree, therefore closing this bug.
Thank you for reporting this issue.