problem with tap-plugins

Andreas Moog andreas.moog at warperbbs.de
Sun May 18 19:59:38 UTC 2014


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.

-- 
PGP-encrypted mails preferred
PGP Fingerprint: 74CD D9FE 5BCB FE0D 13EE 8EEA 61F3 4426 74DE 6624

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 884 bytes
Desc: OpenPGP digital signature
URL: <https://lists.ubuntu.com/archives/ubuntu-motu/attachments/20140518/96de41fc/attachment.pgp>


More information about the Ubuntu-motu mailing list