problem with tap-plugins

Cedric Roux sed at free.fr
Sun May 18 20:11:57 UTC 2014


On 05/18/2014 09:59 PM, Andreas Moog wrote:
> On 18.05.2014 20:48, Cedric Roux wrote:
>> Hi Ubuntu,
>>
>> you have a problem with tap-plugins.
>>
>> Your version provides the .so files *without* linking to the libm.
>> (I'm speaking of http://packages.ubuntu.com/trusty/tap-plugins)
>>
>> This is wrong.
>
> Correct. In this case, the upstream Makefile seems incorrect:
>
> LDFLAGS	+=	-nostartfiles -shared -Wl,-Bsymbolic -lc -lm -lrt
> [...]
> $(CC) $(LDFLAGS) -o tap_echo.so tap_echo.o
>
> Obviously, additional link libraries have no place in LDFLAGS (which
> should only contain flags to pass to the linker). Putting the libraries
> after the object file produces a correct result:
>
>> /temp/tap-plugins-0.7.2$ gcc -nostartfiles -shared -Wl,-Bsymbolic -lc -lm -lrt -o tap_echo.so tap_echo.o
>> /temp/tap-plugins-0.7.2$ ldd tap_echo.so
>> 	linux-vdso.so.1 =>  (0x00007fff86b69000)
>> 	libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f09d5fb6000)
>> 	/lib64/ld-linux-x86-64.so.2 (0x00007f09d65a9000)
>> /temp/tap-plugins-0.7.2$ gcc -nostartfiles -shared -Wl,-Bsymbolic -o tap_echo.so tap_echo.o -lc -lm -lrt
>> /temp/tap-plugins-0.7.2$ ldd tap_echo.so
>> 	linux-vdso.so.1 =>  (0x00007fffc4dfe000)
>> 	libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007feecb177000)
>> 	libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007feecae71000)
>> 	/lib64/ld-linux-x86-64.so.2 (0x00007feecb76a000)
>
> See
> https://wiki.debian.org/ToolChain/DSOLinking#Only_link_with_needed_libraries
>
> for a explanation.

Okay, thanks. Sorry for the noise. I hadn't seen -lm *before* the .o in
the Makefile.



More information about the Ubuntu-motu mailing list