This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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.
2007-04-28  Robert Millan  <rmh@aybabtu.com>

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

Index: ld/ldlang.c
===================================================================
RCS file: /cvs/src/src/ld/ldlang.c,v
retrieving revision 1.261
diff -u -r1.261 ldlang.c
--- ld/ldlang.c	28 Apr 2007 06:04:28 -0000	1.261
+++ ld/ldlang.c	28 Apr 2007 18:13:07 -0000
@@ -5156,7 +5156,7 @@
       if (compatible == NULL)
 	{
 	  if (command_line.warn_mismatch)
-	    einfo (_("%P: warning: %s architecture of input file `%B'"
+	    einfo (_("%P%F: %s architecture of input file `%B'"
 		     " is incompatible with %s output\n"),
 		   bfd_printable_name (input_bfd), input_bfd,
 		   bfd_printable_name (output_bfd));

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]