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

Bug 395223

Summary: app-editors/emacs-18.59-r6 compile failure "ld: i386 architecture of input file `pre-crt0.o' is incompatible with i386:x86-64 output"
Product: Gentoo Linux Reporter: Ulrich Müller <ulm>
Component: Current packagesAssignee: Emacs project <emacs>
Status: RESOLVED FIXED    
Severity: normal    
Priority: Normal    
Version: unspecified   
Hardware: AMD64   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 331933    
Attachments: build.log
emerge --info

Description Ulrich Müller gentoo-dev 2011-12-19 01:07:44 UTC
Created attachment 296325 [details]
build.log

Compilation on an amd64 multilib system fails at the linking stage:

gcc -nostdlib   -o temacs pre-crt0.o /usr/lib32/crt1.o /usr/lib32/crti.o dispnew.o scroll.o xdisp.o window.o term.o cm.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 casefiddle.o indent.o search.o regex.o undo.o alloc.o data.o doc.o editfns.o callint.o eval.o fns.o print.o lread.o abbrev.o syntax.o unexelf.o mocklisp.o bytecode.o process.o callproc.o  doprnt.o terminfo.o lastfile.o malloc.o -lncurses  -lc /usr/lib32/crtn.o -lgcc -lc
/usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/../../../../x86_64-pc-linux-gnu/bin/ld: i386 architecture of input file `pre-crt0.o' is incompatible with i386:x86-64 output
[... 47 similar lines omitted ...]
/usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/../../../../x86_64-pc-linux-gnu/bin/ld: i386 architecture of input file `/usr/lib32/crtn.o' is incompatible with i386:x86-64 output
collect2: ld returned 1 exit status
make[2]: *** [temacs] Error 1
make[2]: Leaving directory `/var/tmp/portage/app-editors/emacs-18.59-r6/work/emacs-18.59/src'
make[1]: *** [doall] Error 2
make[1]: Leaving directory `/var/tmp/portage/app-editors/emacs-18.59-r6/work/emacs-18.59/src'
make: *** [src] Error 2
emake failed

Most likely we have to pass LD="$(tc-getCC)" for the right multilib setup. Furthermore, LDFLAGS are not respected.
Comment 1 Ulrich Müller gentoo-dev 2011-12-19 01:08:51 UTC
Created attachment 296327 [details]
emerge --info
Comment 2 Ulrich Müller gentoo-dev 2011-12-19 07:38:36 UTC
Fixed in -r7.