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

Robert Millan rmh@aybabtu.com
Mon Apr 30 13:32:00 GMT 2007


On Mon, Apr 30, 2007 at 05:51:36PM +0930, Alan Modra wrote:
> On Sat, Apr 28, 2007 at 08:57:23PM +0200, Robert Millan wrote:
> > $ 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
> 
> Hmm, ld returned success because it managed to resolve any relocations
> in libsicuuc.a with the generic linker.  If you were trying to link in
> some "foreign" object file, you'd be happy about this result.  So I'm
> not completely convinced it is a good idea to turn the warning into an
> error, since GNU ld has only given a warning for this situation since
> rev 1.1 in CVS.  Note that you can turn warnings into errors by
> passing --fatal-warnings to ld, which is probably the right way to
> cure autoconf.

Note that while current behaviour might be well stablished, it's because of a
new trend (multiarch environments becoming widely used) that this problem
started being relevant.  I think this should be evaluated without considering
stablished behaviour which probably wasn't designed with this context in mind.

As for changing parameters in autoconf scripts, I'm not sure how many programs
will turn out to need this (now and in the future).  How common is the opposite
situation (i.e. intentionaly linking mixed objects) ?  I can't think of any
example.

-- 
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.



More information about the Binutils mailing list