From owner-freebsd-questions Wed May 8 17:49: 0 2002 Delivered-To: freebsd-questions@freebsd.org Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by hub.freebsd.org (Postfix) with ESMTP id C2A2A37B40A; Wed, 8 May 2002 17:48:52 -0700 (PDT) Received: by elvis.mu.org (Postfix, from userid 1192) id 92839AE25A; Wed, 8 May 2002 17:48:52 -0700 (PDT) Date: Wed, 8 May 2002 17:48:52 -0700 From: Alfred Perlstein To: Mikhail Teterin Cc: questions@FreeBSD.org, current@FreeBSD.org Subject: Re: does the order of .a files matter? Message-ID: <20020509004852.GX36741@elvis.mu.org> References: <200205082044.09459.mi+mx@aldan.algebra.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200205082044.09459.mi+mx@aldan.algebra.com> User-Agent: Mutt/1.3.27i Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG * Mikhail Teterin [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.a `lorder ${_OBJS} | tsort -q` > ranlib lib.a > > and the executable creation is: > > cc ... -o ${_OBJS} ${_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-questions" in the body of the message