Closed DarkDefender closed 8 years ago
I've had another non-Gentoo user report the same thing, but it works fine on my Arch Linux system so I'm not sure what the problem is. Can you attach your full config.log
or e-mail it to malvineous@shikadi.net so I can have a look and see if that sheds any light on the problem?
Do you want the log when it fails or when I have removed the check?
When it fails - I'm hoping to see the command line that runs and the error messages generated. I think the problem is that it can't find the AdPlug library, so I don't yet understand why the main code can find it but that configure test can't. They should both be using the same compiler flags!
Here you go!
I agree I feel it's really weird that the test doesn't compile but the adplay code does...
As far as I can tell, the test is accurate - it is checking to see whether AdPlug is linked correctly and on your system it appears not to be, so the test fails. What version of the core AdPlug library are you using?
What happens if you look for the missing symbols in the library directly?
$ ldd src/.libs/adplay | grep libadplug
libadplug-2.3.so.0 => /usr/lib/libadplug-2.3.so.0 (0x00007f4993171000)
$ objdump -T /usr/lib/libadplug-2.3.so.0 | c++filt | grep CPlayer::[C~]
0000000000028790 g DF .text 0000000000000021 Base CPlayer::CPlayer(Copl*)
00000000000287d0 g DF .text 0000000000000012 Base CPlayer::~CPlayer()
00000000000287c0 g DF .text 0000000000000002 Base CPlayer::~CPlayer()
00000000000287c0 g DF .text 0000000000000002 Base CPlayer::~CPlayer()
0000000000028790 g DF .text 0000000000000021 Base CPlayer::CPlayer(Copl*)
Those CPlayer
functions appear to be missing according to the error in your config.log
.
I'm using the latest git version of adplug.
If the library is not linked correctly, then why can I successfully compile and run adplay if I remove that test?
The symbols seems to be there:
objdump -T /usr/lib/libadplug-2.3.so.0 | c++filt | grep CPlayer::[C~]
0000000000028f90 g DF .text 0000000000000021 Base CPlayer::CPlayer(Copl*)
0000000000028fc0 g DF .text 0000000000000012 Base CPlayer::~CPlayer()
0000000000028fb8 g DF .text 0000000000000001 Base CPlayer::~CPlayer()
0000000000028fb8 g DF .text 0000000000000001 Base CPlayer::~CPlayer()
0000000000028f90 g DF .text 0000000000000021 Base CPlayer::CPlayer(Copl*)
That's really weird - you definitely don't have any other version of libadplug*.so*
on your system that the compiler might be picking up instead? The configure test fails because it can't find those CPlayer
functions.
adplay-unix doesn't actually use those functions so I guess I should change the test to pick some other functions it does use, but then technically the problem still exists you just would never notice...
I didn't manage to find any other libadplug version than the one I installed from git on my system.
The weird thing is that I can manually compile the test code if I copy the code to a .cpp and compile it with g++:
g++ -I/usr/include/libbinio -ladplug -lbinio test.cpp
So I tried it with the same compile flags as in the test and I got the same error as before. I managed to make it compile if I remove the "-Wl,--as-needed" line...
Thankfully gentoo had a page explaining why this is happening: https://wiki.gentoo.org/wiki/Project:Quality_Assurance/As-needed#Importance_of_linking_order
The only case when this happens to be a problem is when the libraries get fed into LDFLAGS variable (which is incorrect).
It seems like this is the case as the LDFLAGS variable has libraries in it:
LDFLAGS='-Wl,-O1 -Wl,--as-needed -ladplug -lbinio'
The should be in LIBS
instead.
Aha! Looks like the configure.ac
is using an older style for this type of test.
I have created a patch for configure.ac - are you able to apply it and see whether it fixes the issue? If so I'll commit it.
Thanks for finding out the cause of the issue!
Yes, that patch solved the problem nicely for me. The check now passes on my system.
Excellent! Thanks for testing. I've committed the fix in 69fd2d2.
This commit https://github.com/adplug/adplay-unix/commit/7c2735d92a780e0116beb27e9b9dd77ec22c7bef
Makes the configure check fail on my Gentoo system (haven't tried on any other system). However, if I remove it, adplay complies fine and I can use the complied binary without any problems.