[ros-users] Linker --as-needed

Daniel Stonier d.stonier at gmail.com
Mon Aug 9 08:00:45 UTC 2010


On 6 August 2010 08:49, Brian Gerkey <gerkey at willowgarage.com> wrote:

> On Thu, Aug 5, 2010 at 4:08 PM, Daniel Stonier <d.stonier at gmail.com>
> wrote:
> > I had to fix a couple of linkages that went missing in my ros libraries
> when
> > a dependency didn't get linked in (namely rt and pthreads) but haven't
> had
> > any other problems. Mind you, haven't been testing this for very long!
> I'm
> > enabling it as a default in our packages for the moment for testing.
> > Fedora and now gentoo (which is how I found out about it) are setting
> this
> > as a default in their builds now (some others as well). Mind you, just
> > because someone else is doing it is no justification, but it does mean
> its
> > seeing a bit of testing out in the wild and isn't one of those really
> > obscure settings with rather unknown effects.
>
> Happy to hear that it works in general (would be pretty bad if it
> didn't...).  I'm more concerned about whether we're currently
> specifying everything completely, or unknowingly exploiting
> overlinkage.
>
> I guess the only way to find out is to build and test everything with
> that option included.
>
>          brian.


Quick update re testing - our mac guy came back to work this morning and
immediately hit a problem - the mac linker does not have --as-needed as an
option. This may be a problem across other platforms too?

Mac does have another option which seems to be similar and does appear to
work after a few compiles:

-mark_dead_strippable_dylib

Specifies that the dylib being built can be dead strip by any client.
That is, the dylib has no initialization side effects. So if a client
links against the dylib, but never uses any symbol from it, the linker
can optimize away the use of the dylib.

Currently testing in our packages.

-- 
Phone : +82-10-5400-3296 (010-5400-3296)
Home: http://snorriheim.dnsdojo.com/
Yujin Robot: http://www.yujinrobot.com/
Embedded Control Libraries: http://snorriheim.dnsdojo.com/redmine/wiki/ecl
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ros.org/pipermail/ros-users/attachments/20100809/e0ea1978/attachment-0003.html>


More information about the ros-users mailing list