[Top][All Lists]

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

RE: How to use ld options correctly for --whole-archive in automake and

From: Andy Falanga (afalanga)
Subject: RE: How to use ld options correctly for --whole-archive in automake and libtool
Date: Fri, 6 Mar 2015 15:59:51 +0000

> -----Original Message-----
> From: Thomas Jahns [mailto:address@hidden
> Sent: Friday, March 06, 2015 1:46 AM
> To: Andy Falanga (afalanga)
> Cc: address@hidden
> Subject: Re: How to use ld options correctly for --whole-archive in
> automake and libtool
> >> position. You might be able to work around this with judicious use
> of
> >> extra -Wl, prefixes like this:
> >>
> >> sata_la_LIBADD = -Wl,-Wl,,--whole-archive,../Shared/HwMgmt/.libs/
> >> libhwmgmt.a,../Shared/Misc/.libs/libmisc.a,.libs/libsata.a,-Wl,,--
> no-
> >> whole-archive -lz -lrt
> >>
> >
> > A very interesting suggestion.  I shall have to try this.  I found
> > something similar, after the many, many searches I've done with
> > Google.  It didn't have this many uses of "-Wl," though so that is
> > quite interesting.
> Also it should be noted that you would need to make the files in
> libhwmgmt.a be
> PIC objects instead of non-PIC as libtool will create by default.

I am specifying this for all objects compiled.  I have in each
lib_la_CXXFLAGS = -fPIC

> > This is a good question.  I have been asking myself the same thing.
> > Using these tools opens up a newer deployment method than we've used
> > to this point.  I do still have to answer a question of how I shall
> > statically link with other libraries, most notably Boost.  The
> systems
> > we deploy to will either not have these libraries altogether or they
> > have such woefully out of date versions that statically linking with
> > these other libraries is the only option.  How would I ensure I
> statically
> > link with these libraries using the automake process?
> That's not something you want to fix from within automake but rather
> specify
> something like LIBS="-Bstatic -lboost -Bdynamic" at configure time
> since it
> addressed a specific issue of the build you intend to do and not your
> package
> itself.

I have considered this but haven't tried it as yet because I thought it
applied to *everything* compiled whereas I really want this for only the
python module.  Am I missing how this works?

> But you can still link dynamically to different library versions than
> those
> installed on the system by making use of -Wl,-rpath on Linux. I haven't

I've got to spend some more time understanding what -rpath really is.  I
don't know at this point.  Thanks for the suggestions.


reply via email to

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