From owner-freebsd-current Wed May 8 18:49:37 2002 Delivered-To: freebsd-current@freebsd.org Received: from damnhippie.dyndns.org (12-253-177-2.client.attbi.com [12.253.177.2]) by hub.freebsd.org (Postfix) with ESMTP id 7B40837B407 for ; Wed, 8 May 2002 18:49:20 -0700 (PDT) Received: from [172.22.42.2] (peace.hippie.lan [172.22.42.2]) by damnhippie.dyndns.org (8.11.6/8.11.6) with ESMTP id g491nJG79557 for ; Wed, 8 May 2002 19:49:19 -0600 (MDT) (envelope-from freebsd@damnhippie.dyndns.org) User-Agent: Microsoft Outlook Express Macintosh Edition - 5.01 (1630) Date: Wed, 08 May 2002 19:49:19 -0600 Subject: Re: does the order of .a files matter? From: Ian To: freebsd-current Message-ID: In-Reply-To: <200205082044.09459.mi+mx@aldan.algebra.com> Mime-version: 1.0 Content-type: text/plain; charset="US-ASCII" Content-transfer-encoding: 7bit Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG > > 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