[PATCH] ld/ldlang.c: fatal error on architecture mismatch

Robert Millan rmh@aybabtu.com
Sat Apr 28 20:01:00 GMT 2007


Hi,

This is a common problem in a mixed i386/x86_64 environment.  If you're
compiling something for 32-bit, but /usr/lib/libfoo.a is 64-bit, autoconf
scripts checking for availability of static libfoo should fail.  However:

$ cat test.c
#include <unicode/ubidi.h>
main ()
{
  ubidi_open ();
}
$ gcc -m32 -o /dev/null test.c /usr/lib/libsicuuc.a
/usr/bin/ld: warning: i386:x86-64 architecture of input file `/usr/lib/libsicuuc.a(ubidi.ao)' is incompatible with i386 output
[...]
$ echo $?
0

This results in the build system thinking that /usr/lib/libsicuuc.a is usable
for linking 32-bit code with it.

ld/ChangeLog:

2007-04-28  Robert Millan  <rmh@aybabtu.com>

	* ldlang.c (lang_check): Fatal error on architecture mismatch.

Patch against current CVS is attached.

-- 
Robert Millan

My spam trap is honeypot@aybabtu.com.  Note: this address is only intended
for spam harvesters.  Writing to it will get you added to my black list.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: biarch_mixing.diff
Type: text/x-diff
Size: 730 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20070428/c93c1dae/attachment.bin>


More information about the Binutils mailing list