[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: gcc-10: options order important?



On Fri, Sep 03, 2021 at 12:59:27PM -0400, Greg Wooledge wrote:
> On Fri, Sep 03, 2021 at 02:12:46PM +0100, Tixy wrote:
> > > A man page a found online [1] says linking happens as Greg described, 
> > > and this is true looking at a 6 year old copy of that page on
> > > archive.org. So seems strange that for many years my Makefiles have
> > > worked with Libraries specified before inputs that use them.
> > 
> > Correction... 'for many years my Makefiles have worked with Libraries
> > specified _after_ inputs that use them'
> 
> You had it right the first time.  It's strange that it worked (in the
> past) with the library argument in front.  It's supposed to be behind.
> 
> The linker's argument processing must have been changed a few times.
> GNU utilities in general have a tendency to be overly lenient with
> command-line options.  Commands that *should* fail according to POSIX
> sometimes work in the GNU variants.

[...]

It /might/ be related to weak linking and the default for
the --as-needed option in the linker. Caveat: I haven't found
the time to research this more thoroughly.

But OP could try to pass --no-as-needed and see what happens :)

Cheers
 - t

Attachment: signature.asc
Description: Digital signature


Reply to: