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
Created attachment 258807 [details] emerge --info =app-editors/emacs-23.2-r2
Created attachment 258809 [details] emerge -pqv =app-editors/emacs-23.2-r2
Created attachment 258810 [details] build.log
Created attachment 258811 [details] environment
My guess: It uses local non-prefix file: /usr/lib/crtn.o
hmmm, yeah, I wonder what it's necessary for anyway.
What does "gcc -print-file-name=crt1.o" output?
crt1.o is IIRC never provided by a prefix, so something like /usr/lib/crt1.o
(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.
Yeah, but why is it necessary to give this explicitly? GCC in general knows best how to do it in the end...
(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.
Created attachment 260716 [details, diff] Patch for src/s/gnu-linux.h Does attached patch fix the issue?
(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
(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
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)
(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.
(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
(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 !
(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.
Thanks for solving this bug :)
Reassigning to emacs because this also affects native amd64 with ABI="x86".
Ebuild moved to main tree, therefore closing this bug. Thank you for reporting this issue.