Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Static linking / "undefined reference to `__dlopen'&quo
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
Philantrop
Retired Dev
Retired Dev


Joined: 21 Dec 2004
Posts: 1130
Location: Germany

PostPosted: Fri Jun 24, 2005 6:08 pm    Post subject: Static linking / "undefined reference to `__dlopen'&quo Reply with quote

Here is a major problem that truly puzzles me...

I've set up a new server over the last few days. Of course, Gentoo was the only choice. Everything went smoothly apart from an upstream bug in pppd 2.4.3 which I tried to resolve by downgrading to 2.4.2.

Then it all went wrong. Compiling failed with the message

Code:
warning: Using 'dlopen' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking


followed by undefined reference to the symbols here
Code:

 undefined reference to `__dlsym'
 undefined reference to `__dlclose'
 undefined reference to `__dlopen'
 undefined reference to `__dlerror'


So I re-emerged glibc (2.3.5), thinking some part of pppd want to dlopen the wrong version. Didn't help. I re-emerge gcc (3.4.4) as well. Nothing changed.

I took out all unsafe optimizations and reduced my CFLAGS to "-march=pentium3 -O3 -pipe". Didn't help. Slowly becoming desperate, I tried emerge -e system. The compilation failed when OpenSSL was due - the same errors pppd showed.

Next, I switched to gcc 3.3.6. Same problem.

Finally, I took out "~x86", emerged the stable glibc and did another emerge -e system. OpenSSL failed again. Same problem.

Every single package that gets some parts statically linked fails miserably like this. It's always about those symbols being undefined and mostly the above "runtime" message accompanies them. An unholy alliance!

Now, my patient audience, I turn to you and ask for help - what, short of re-installing the whole damn thing, can I do?
Back to top
View user's profile Send private message
Philantrop
Retired Dev
Retired Dev


Joined: 21 Dec 2004
Posts: 1130
Location: Germany

PostPosted: Sat Jun 25, 2005 4:02 pm    Post subject: Reply with quote

Anyone? I can't even rebuild my whole toolchain anymore...
Back to top
View user's profile Send private message
lord_morph
n00b
n00b


Joined: 23 Aug 2005
Posts: 3

PostPosted: Tue Aug 23, 2005 5:52 pm    Post subject: Reply with quote

had the same problem, try

Code:
  ln -s /lib/libdl.so.2 /usr/lib/libdl.so


(only if /usr/lib/libdl.so does not exist);

-> everything worked well after this
Back to top
View user's profile Send private message
tuxicated
Tux's lil' helper
Tux's lil' helper


Joined: 02 Nov 2004
Posts: 120

PostPosted: Sun Nov 13, 2005 5:12 pm    Post subject: Reply with quote

Have a look at:

https://bugs.gentoo.org/show_bug.cgi?id=112413

to find the cause and cure of the problem caused by symlinking /usr or /usr/lib
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum