[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
Andy Falanga (afalanga)
RE: How to use ld options correctly for --whole-archive in automake and libtool
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
> >> 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,,--
> >> 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 Makefile.am
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
> > 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
> > link with these libraries using the automake process?
> That's not something you want to fix from within automake but rather
> 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
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
> 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.
Re: How to use ld options correctly for --whole-archive in automake and libtool, Gavin Smith, 2015/03/05