FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian Development

 
 
LinkBack Thread Tools
 
Old 08-19-2011, 04:53 PM
Jakub Wilk
 
Default ld --no-add-needed and multi-arch libraries

I noticed that some time ago that a few packages that used to FTBFS with
--no-add-needed now build successfully without any source changes.


Here's a minimal example:

| $ cat test.c
| #include <dlfcn.h>
| int main(int argc, char **argv) { return !!dlopen((const char*) 0, 0); }
|
| $ gcc -c test.c
|
| $ ldd /usr/lib/libssl.so | grep -F dl.so
| libdl.so.2 => /lib/i386-linux-gnu/libdl.so.2 (0xf75aa000)
|
| $ ld --no-add-needed test.o -ldl ### all righty
| ld: warning: cannot find entry symbol _start; defaulting to 00000000080481b0
|
| $ ld --no-add-needed test.o -lssl ### WTH? it should fail, but it does not
| ld: warning: cannot find entry symbol _start; defaulting to 00000000080481c0

Interestingly enough, the problem disappears if I unmultiarchify libdl:

| # mv -v /lib/*-*-*/libdl* /lib/ && mv -v /usr/lib/*-*-*/libdl* /usr/lib/
| `/lib/i386-linux-gnu/libdl-2.13.so' -> `/lib/libdl-2.13.so'
| `/lib/i386-linux-gnu/libdl.so.2' -> `/lib/libdl.so.2'
| `/usr/lib/i386-linux-gnu/libdl.a' -> `/usr/lib/libdl.a'
| `/usr/lib/i386-linux-gnu/libdl.so' -> `/usr/lib/libdl.so'
|
| # ln -sf /lib/libdl.so.2 /usr/lib/libdl.so
|
| $ ldd /usr/lib/libssl.so | grep -F dl.so
| libdl.so.2 => /lib/libdl.so.2 (0xf75a9000)
|
| $ ld --no-add-needed test.o -ldl ### all righty
| ld: warning: cannot find entry symbol _start; defaulting to 00000000080481b0
|
| $ ld --no-add-needed test.o -lssl ### fails as expected
| ld: test.o: undefined reference to symbol 'dlopen@@GLIBC_2.1'
| ld: note: 'dlopen@@GLIBC_2.1' is defined in DSO /lib/libdl.so.2 so try adding it to the linker command line
| /lib/libdl.so.2: could not read symbols: Invalid operation

It smells like a bug to me, but maybe I'm missing something. Could
someone explain what happens here?


--
Jakub Wilk


--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20110819165307.GA3261@jwilk.net">http://lists.debian.org/20110819165307.GA3261@jwilk.net
 

Thread Tools




All times are GMT. The time now is 09:39 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org