From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Lance Taylor To: jj@sunsite.ms.mff.cuni.cz Cc: rth@cygnus.com, binutils@sourceware.cygnus.com Subject: Re: [RFC] Adding --skip-mismatch option to ld Date: Thu, 01 Jul 1999 00:00:00 -0000 Message-id: <19990609043554.1753.qmail@daffy.airs.com> References: <19990604171207.W949@mff.cuni.cz> <19990607120530.A13793@cygnus.com> <19990608001452.O949@mff.cuni.cz> <19990608001452.O949@mff.cuni.cz> X-SW-Source: 1999-q2/msg00188.html Date: Tue, 8 Jun 1999 00:14:52 +0200 From: Jakub Jelinek On Mon, Jun 07, 1999 at 12:05:30PM -0700, Richard Henderson wrote: > On Fri, Jun 04, 1999 at 05:12:07PM +0200, Jakub Jelinek wrote: > > Now Solaris linker apparently skips a library in the search path if it is > > for the wrong architecture (=emulation) which makes a lot of sense to me, > > that's why I wrote the second part of this patch. I've made it optional and > > not default because it differs from the standard library path searching, on > > the other side without this any compilation with some wrong arch library in > > the search path before the correct arch one would die in error. > > I don't see any need to make this optional. My preferred solution > would be to skip the library with a note written to the map file > to aid diagnosing user's problems. In such a case, what would it do if --no-warn-mismatch is specified? Should it stop skipping the libraries and choose the first one in the search path, or should it continue skipping incompatible libraries, in which case if the user wanted to link against an incompatible library, he'd have to specify its full name including path? --no-warn-mismatch is more likely to be used for object files rather than archives. Even if we make --skip-mismatch the default behaviour, I don't see any need to change the behaviour of --no-warn-mismatch. So I would pick your second choice if --skip-mismatch were to become the default. However, requiring things like specifying the full pathname is exactly why I think it would be unwise to make --skip-mismatch the default. It becomes harder to predict the linker's behaviour. I don't know much about what are people using --no-warn-mismatch for and what tasks are they solving by it, so I cannot come to conclusion about the above question easily myself. People use --no-warn-mismatch mainly for things like -mips2 vs. -mips3 object files. C code compiled with -mips2 and -mips3 use different calling conventions, so the linker prevents you from linking them together. However, in certain specific cases, such as when building a kernel, it is desirable to link them together; the --no-warn-mismatch option permits such cases. Ian