Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 08 May 2002 19:49:19 -0600
From:      Ian <freebsd@damnhippie.dyndns.org>
To:        freebsd-current <freebsd-current@freebsd.org>
Subject:   Re: does the order of .a files matter?
Message-ID:  <B8FF31BF.CCB4%freebsd@damnhippie.dyndns.org>
In-Reply-To: <200205082044.09459.mi%2Bmx@aldan.algebra.com>

next in thread | previous in thread | raw e-mail | index | archive | help
> 
> I'm trying to port a huge application to FreeBSD. The app's build
> process creates over a hundred of static libraries (.a) and then tries
> to link them (and a few object files) into the executable. The process
> seems to work fine on the existing platforms (a number of Unixes and
> NT), but on FreeBSD I keep getting unresolved symbols.
> 

There are a few linker command line options that may help you through this
kind of problem.  (IMO, there should be an option for just making multiple
passes over the libraries, but it appears there isn't one.)

There's a -whole-archive option that just forces a whole library to be
included rather than picked-over for symbols that resolve outstanding
references.  That might help your problem to some degree.

There's an incremental-link option that might let you do some sort of
multi-pass linking to get around the command line size/argcount limits.

And, you can specify a given library multiple times on the command line.

Of these 3 possibilities, I've only ever used the last one, to help with
some perverse mutually-interdependant libraries I didn't have control over.
Even that was long long ago.

There's a way to pass args thru cc or gcc to the linker, "-Xlinker_arg" if I
recall correctly.  "man cc" and "man ld" will probably contain clues.

-- Ian


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?B8FF31BF.CCB4%freebsd>