build failure with --as-needed
Cross-platform lightweight components
Status: Alpha
Brought to you by:
pphaneuf
Hi,
attached is a patch which solves a build failure with the linker flag --as-needed. Some background: --as-needed forces the order of libraries, which means that a shared object using symbols must occur on as argument to the linker in front of the file providing the symbol definitions. For xplc it's -ldl that is added in front of libxplc.so.
In the attached patch, I've updated config/rules.mk to allow to specify libraries in <name>_LDADD (automake uses the same convention), and have updated xplc/vars.mk to use libxplc_LDADD in case the libdl is to be used. Would be cool if you could integrate that patch. If there's s.th. wrong with the approach, please let me know.
Cheers,
Stefan.
order libraries last for the linker