From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4312 invoked by alias); 30 Sep 2012 01:06:00 -0000 Received: (qmail 4301 invoked by uid 22791); 30 Sep 2012 01:05:59 -0000 X-SWARE-Spam-Status: No, hits=-5.0 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,KHOP_RCVD_TRUST,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE X-Spam-Check-By: sourceware.org Received: from mail-ob0-f175.google.com (HELO mail-ob0-f175.google.com) (209.85.214.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 30 Sep 2012 01:05:52 +0000 Received: by obceq6 with SMTP id eq6so4822194obc.20 for ; Sat, 29 Sep 2012 18:05:52 -0700 (PDT) MIME-Version: 1.0 Received: by 10.182.43.40 with SMTP id t8mr8932470obl.93.1348967152081; Sat, 29 Sep 2012 18:05:52 -0700 (PDT) Received: by 10.60.34.234 with HTTP; Sat, 29 Sep 2012 18:05:51 -0700 (PDT) In-Reply-To: <1E5FA3D775D47342864BD139C7582A5503BF3649@ALPMLVEM05.e2k.ad.ge.com> References: <680BABF85B31BC4DB6E3E4E33D569F4D0AC12D1B@NHEXCH2.allegro.msad> <1E5FA3D775D47342864BD139C7582A5503BF3649@ALPMLVEM05.e2k.ad.ge.com> Date: Sun, 30 Sep 2012 01:06:00 -0000 Message-ID: Subject: Re: is there any way to change the order of name resolution in linking (aside from putting the libraries in the right order?) From: Dan Hitt To: "Vardhan, Sundara (GE Transportation)" Cc: Jonathan Wakely , gcc-help@gcc.gnu.org Content-Type: text/plain; charset=ISO-8859-1 X-IsSubscribed: yes Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org X-SW-Source: 2012-09/txt/msg00249.txt.bz2 Thanks Sundara. Actually, i tried several variations to try to specify the extension. These are the variations i tried, with the results: -lX11 (found, but does not resolve symbols) -lX11a (cannot find) -lX11.a (cannot find) lX11 (cannot find) libX11 (cannot find) libX11a (cannot find) libX11.a (cannot find) llibX11.a (cannot find) -llibX11.a (cannot find) Just for reference, these go in the arguments as -Wl,--whole-archive,<>,--no-whole-archive and so far, the only things that don't bail are -lX11 and /usr/lib/...../libX11.a, and the latter is the only thing that actually resolves any symbols. dan On Fri, Sep 28, 2012 at 6:13 AM, Vardhan, Sundara (GE Transportation) wrote: > Hi Dan > > I think -l defaults to .so and does not include .a if the extension is > not explicitly mentioned. However, I am not sure if anything in this > area changed in the latest gcc. > > Regards > > Vardhan > > -----Original Message----- > From: gcc-help-owner@gcc.gnu.org [mailto:gcc-help-owner@gcc.gnu.org] On > Behalf Of Dan Hitt > Sent: Thursday, September 27, 2012 4:17 PM > To: Jonathan Wakely > Cc: gcc-help@gcc.gnu.org > Subject: Re: is there any way to change the order of name resolution in > linking (aside from putting the libraries in the right order?) > > On Thu, Sep 27, 2012 at 1:08 PM, Jonathan Wakely > wrote: >> On 27 September 2012 21:04, Dan Hitt wrote: >>> >>> I was not able to use the -l abbreviation >> >> Why not? > > It didn't resolve the reference. > > To be really specific here (except that i have to suppress some of the > dozens of characters in the command), the command generated was: > > gcc-4.6 -Wl,--whole-archive,-lX11,--no-whole-archive [[[other stuff > deleted]]] > > And that command gives the same result as just putting -lX11 first (as > opposed to putting it last, which resolves everything). > > (It may be that the -l option somehow signifies *.so these days? > Because it certainly gives a much smaller executable when it works, and > i had to use the *.a forms with --whole-archive in order to make it > work?) > > dan