[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Passing options to the linker

From: Paulo J. Matos
Subject: Re: Passing options to the linker
Date: Wed, 24 May 2006 17:01:45 +0100

On 24/05/06, Ralf Wildenhues <address@hidden> wrote:
Hi Paulo,

* Paulo J. Matos wrote on Wed, May 24, 2006 at 05:34:50PM CEST:
> I'd like to know what's the best way to pass some options to the linker?
> I'd like to add -Wl,--whole-archive to the linker before the libraries
> I want to link, which are listed in LIBADD. Any ideas on how to do
> this?

Position-dependent linker flags have not yet been implemented in

> This is needed due to some conclusions I referred in:

Hmm, that looks very fishy:

> > /bin/sh ../libtool --tag=CXX --mode=link g++  -ggdb -Wall -std=c++98 ...
> > esatcluster.o extsat.o esatlogger.o
>   -Wl,--whole-archive
> > ../lib/bf/src/ ../lib/ot/src/ ../lib/fm/src/
>   -Wl,--no-whole-archive
> > ../lib/glpkinterface/src/
> > ../lib/ncquest/src/  -lm -lnsl -llog4cpp

and won't do what you want.  Libtool causes all convenience archives to
be linked with --whole-archive.  Are

convenience archives (noinst_LTLIBRARIES)?  If yes, then what you want
should work out of the box.  If no, where are they to be installed
(are they lib_LTLIBRARIES)?

Well, that's yet another problem. I have them right now as
lib_LTLIBRARIES because I want them to work in two different ways.
1 - They are all statically linked to the core.
2 - They are loaded at run-time as modules.

It seems that for the first I need to have them as noinst_LTLIBRARIES
and for the second as lib_LTLIBRARIES.

Also, for the second I need to set the -module flag in the LDFLAGS but
not on the first but this is not a problem because I have a flag which
I pass to configure --with-modules so that I can add, or not, -module.
The noinst/lib seems harder and not settable through a flag, am I


Paulo Matos


Paulo Jorge Matos - pocm at sat inesc-id pt
Computer and Software Engineering

reply via email to

[Prev in Thread] Current Thread [Next in Thread]