libtool
[Top][All Lists]
Advanced

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

Re: per-deplib static/dynamic flags


From: Ralf Wildenhues
Subject: Re: per-deplib static/dynamic flags
Date: Thu, 2 Feb 2006 07:34:11 +0100
User-agent: Mutt/1.5.9i

Hi Bob,

* Bob Friesenhahn wrote on Thu, Feb 02, 2006 at 05:39:02AM CET:
> On Wed, 1 Feb 2006, Albert Chin wrote:
> >>
> >>Good.  GCC uses -B to mean something else.  So -Bstatic is a
> >>linker-only option.  It is likely useful to use something new which
> >>won't be confusing due the different meaning between GCC and ld.

True.

> >How about -static-only and -shared-only?

Hmm.  If we were to invent new flags, I currently like
  -force-static, -prefer-shared
best.

> >Note though that Ralf has -Bstatic defined as:
> > If @var{output-file} is a program, prefer linking statically
> >                                  ^^^^^^
> >
> >This is not -Bstatic under Linux according to ld(1). If this is what
> >is intended, then -prefer-static is back :)

This is precisely and only because I wasn't sure whether we would find a
linker which allows to set the preferred more but not force it to.

And also, because we then need to define the semantics of linking
against a libtool library (*.la) that was created shared-only.

> There is something else we have not considered.  How is all this going 
> to mesh properly with autoconf configure?

This question is *not* new.  `-static-libtool-libs' requires thought,
even `-static', because it has a different meaning for $CC than for
libtool.  Look at GCC's libtool-ldflags script which I pointed to in
my first post in this thread.

We should think about whether:
- we add a similar script to the Libtool package, or
- detect more option forms in the libtool script itself, e.g.:
   -Wl,-rpath
   -Wl,-Bstatic
   ...

> I would love to be able to supply LDFLAGS options to configure and 
> have them work appropriately within the configure script, and then 
> work similarly for libtool.

Note that `-Wl,-Bstatic' will *not* be useful in LDFLAGS, but LIBS at
best, because of the ordering issues.

> If the options do not work in LDFLAGS, 
> then it will be necessary to pass them explicitly via the Makefile.
> 
> In this case
> 
>  -Wl,-Bstatic
> 
> may work better even though it is more obtuse.

I don't see any reason against supporting both
   -force-static and -Wl,-Bstatic
as two names for the same thing.

By the way, I'd like to fix ordering issues for `-Wl,'-given flags that
we don't understand, too; there have been several bug reports about
this.

Cheers,
Ralf




reply via email to

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