Date: Wed, 8 May 2002 17:48:52 -0700 From: Alfred Perlstein <bright@mu.org> To: Mikhail Teterin <mi+mx@aldan.algebra.com> Cc: questions@FreeBSD.org, current@FreeBSD.org Subject: Re: does the order of .a files matter? Message-ID: <20020509004852.GX36741@elvis.mu.org> In-Reply-To: <200205082044.09459.mi%2Bmx@aldan.algebra.com> References: <200205082044.09459.mi%2Bmx@aldan.algebra.com>
next in thread | previous in thread | raw e-mail | index | archive | help
* Mikhail Teterin <mi+mx@aldan.algebra.com> [020508 17:46] wrote:
> Hello!
>
> 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.
>
> The most frustrating thing is, the number of such symbols varies greatly
> with the order, in which I list the libraries on the command line. Is
> not the linker supposed to make several runs over the given libraries if
> needed?
>
> Each .a is created "by the book":
>
> ar cq lib<NAME>.a `lorder ${<NAME>_OBJS} | tsort -q`
> ranlib lib<NAME>.a
>
> and the executable creation is:
>
> cc ... -o <exe> ${<exe>_OBJS} ${<exe>_LIBS} ...
>
> It "almost" works, if I try to bypass the libraries completely and just
> link all of object files, but for the real application I hit the shell's
> limit on the number of arguments -- there are too many object files.
>
> Any suggestions? Thanks a lot!
>
> -mi
>
> P.S. This is on ``FreeBSD 5.0-CURRENT #2: Fri Apr 26 13:04:00 GMT 2002''
doesn't 'ar' allow for incremental build of .a files? Use xargs or
something to build one giant '.a' then link against that.
-Alfred
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?20020509004852.GX36741>
