There is already a hack in emacs's ebuilds to workaround this problem on freebsd machines. I will attach a patch to do the same for linux machines. This matters for portage-multilib people.
Created attachment 221151 [details] emacs-22-23-crtn.o-fix.patch This workaround builds on the existing freebsd workaround and enables me to install emacs on my portage-multilib system.
Please report this upstream. This should really be properly fixed, not by adding further hacks. When an upstream fix is available, we can backport it to Emacs 21 and 22.
http://debbugs.gnu.org/cgi/bugreport.cgi?bug=5655
Thanks for reporting it upstream. Probably I was a bit brief in my previous reply. The problem with -print-file-name is that it is a GCC specific option, so it would break things for users of other compilers (e.g. ICC). So it really is a workaround only. I think the proper solution is to link to /usr/lib32/crt*.o for the 32-bit ABI and to /usr/lib64/crt*.o for the 64-bit ABI (i.e. /usr/$(get_libdir)/crt*.o)?
(In reply to comment #4) > Thanks for reporting it upstream. http://debbugs.gnu.org/cgi/bugreport.cgi?bug=5655#13 seems to indicate that upstream is passing the responsibility back downstream ;-). I'm not sure when this'll make it into a release or if it works, but just to note...
Created attachment 229109 [details, diff] emacs-22.3-crt-dir.patch
Created attachment 229111 [details, diff] emacs-23.1-crt-dir.patch
See previous two attachments for the upstream patch backported to Emacs 22 and Emacs 23, respectively. (Feel free to backport to Emacs 21, too. ;-) The ebuilds need the following changes: - Add "multilib" to inherit line. - Add "--with-crt-dir=/usr/$(get_libdir)" to econf. Please test.
(In reply to comment #8) > The ebuilds need the following changes: > - Add "multilib" to inherit line. > - Add "--with-crt-dir=/usr/$(get_libdir)" to econf. Apart from applying the patch, of course.
I've added the --with-crt-dir configure option in emacs-23.2 and emacs-vcs-24.0.9999. Please test.