[ros-users] Linker --as-needed

Top Page
Attachments:
Message as email
+ (text/plain)
+ (text/html)
Delete this message
Reply to this message
Author: Daniel Stonier
Date:  
To: ros-users
Subject: [ros-users] Linker --as-needed
I didn't know about this linker option until yesterday...turns out to be
really useful. Setting -Wl,--as-needed in the ROS_LINK_FLAGS variable in
rosconfig.cmake, we can drop any unused linking dependencies.

We've been bashing back and forth here at work on how to build our packages
- ideally we want to be able to build a regular algorithm library or device
driver with no ros connections so we can use in standalone projects, and
also an rosnode lib around that, but unfortunately the manifest drags in all
the ros dependencies into the algorithm library/device driver. Up until now,
we were splitting into separate packages when we really needed to, but is a
bit awkward. There are other use cases too, simple debugging utilities
alongside the main library package, or full blown gui tools.

This solves all of that. Would there be any reason/disadvantage to having it
as a default link flag for gcc in the ros? It's not a big issue as its easy
enough to enable globally yourself, but it's something that could just as
easily be 'under the hood' so to speak.

--
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