Skip to contentSkip to conversation

linking problems on Ubuntu

Xenomai Henning Schild 1 participant 1 message May 16, 2017

lore
Share & tools
lore
#0 lore raw

Hi,

i have been seeing occasional linking problems with 3.0.4 and Ubuntu 16.04. The root cause of the problem is that the ubuntu toolchain defaults to linking with "--as-needed" while most other toolchains seem to default to "--no-as-needed".
Depending on your program the linker might not recognize that some libraries are actually needed, because they are just pulled in by weak symbols. Inspecting the binary or .so with ldd will show that not all of the libs you specified actually made it in.

I will have to investigate further on how best to solve that. xeno-config could emit -Wl,--no-as-needed before -l.. but we can not really finish with "-Wl,--as-needed" because we don't know the toolchains default.

The weak symbols and wrapping code depends on "--no-as-needed", for a sane toolchain there is no need to be explicit about that. These morons did not even bother changing the manpages as well ...

So i guess it should be made explicit. I will probably write a patch to xeno-config to just add --no-as-needed regardless. It might have to go into the build-system as well. Any objections or ideas how to address that differently?

Henning