2017年12月6日 星期三

link unused library as needed

https://lists.ubuntu.com/archives/ubuntu-devel/2010-November/031991.html

There is a second change to the linking in natty; as announced in [1], 
--no-add-needed/--no-copy-dt-needed-entries is passed by default, with the 
current gcc in natty, --as-needed is passed as well.  Please see [2] for 
implications (runtime failures) and a list of packages which might be affected.

To revert this change on a per package basis, pass --no-as-needed to the linker 
(-Wl,--no-as-needed in LDFLAGS).  To add an explicit dependency on a library use 
--no-as-needed -lfoo --as-needed.
-Wl,--no-as-needed -lfoo -Wl,--as-needed
Please tag bug reports with `as-needed' if you see runtime failures caused by 
this change (mostly unresolvable symbols referenced by plugins and ldopened 
objects).

沒有留言:

張貼留言