GCC 4.8.0 linking error
Today I was testing out sddm on slackware-current (using the latest update). But I got linking error like this:
Code:
/usr/lib/gcc/i486-slackware-linux/4.8.0/../../../../i486-slackware-linux/bin/ld: CMakeFiles/sddm.dir/daemon/Authenticator.cpp.o: undefined reference to symbol '__pthread_key_create@@GLIBC_2.0' Is this a bug on slackware-current gcc's? I've reported this to sddm developer but they couldn't reproduce the issue, or their build was just fine #51. Any idea? PS: Just FYI, sddm developer has been working on a pamless sddm and I'm currently using it right now. |
IMO, gcc-4.8.0 is not quite ready for prime time. I tried to compile a couple of packages, and it stopped with errors. When I went back to 4.7.2, they compiled without error. So until the 4.8.x series matures a bit more, I think that 4.7.2 is the better choice.
|
Whenever you encountered an error with GCC 4.8.0, please consult with this PORTING GUIDE
|
from the experiments done here, a lot of stuff (but not everything) I built from SBo using qt needed explicit linking to libpthread with gcc-4.8.0.
|
I've had that error a few times as well, and I either add -lpthread to LDFLAGS or explicitly add it to the linking rule in the Makefile.
I don't think it's that gcc 4.8.0 is somehow defective, I think it's simply that newer versions of gcc tend to tighten up loose ends where things are vague or implicit but now manifest themselves as a compile-time error like this one. |
Quote:
|
Quote:
Code:
-DCMAKE_SHARED_LINKER_FLAGS="-lpthread" |
I think it is (also) a good idea to add -pthread to the CMAKE_CXX_FLAGS
from man gcc: Adds support for multithreading with the pthreads library. This option sets flags for both the preprocessor and linker. at least for my projects this did it, and I think it is required to enable some c++11 thread support parts |
Thanks for the answers
Well, at least now I know that I'm not alone in this :-P
Quote:
|
This has actually nothing to do with the gcc bump. It is an issue with ld. An upstream change there broke linking dynamic libraries through weak symbols. They consider it a change, but from what I could see most distributions consider it a bug and revert the change. Expect that to be handled in -current soon too :)
|
It has been fixed
I think this "bug" has been fixed in the latest update in slackware-current,
Code:
Wed Apr 3 06:58:59 UTC 2013 |
Hmmm. I'm not sure about this one. I tend to agree with upstream that the new behaviour, however disruptive is more correct. is it really wise to have the linker pull in things that you didn't tell it to?
|
Quote:
Personally, I have to go with the notion that if the change causes existing code to fail to compile until you make a change to the Makefile/configure/whatever that has the identical effect as reverting the binutils commit does, then it is not a beneficial change. I've never been a big supporter of making something more correct for no actual benefit and having breakage result. The time to make something more correct is before the behavior is long-established in the real world. Guess I'd make a lousy CS professor. ;) |
Quote:
|
Could my problem be related to this?
I'm trying to run Spring RTS 94.1. It compiles fine on slackware64-current, but I can't run it. It crashes with error Code:
[f=0000000] Error: Segmentation fault (SIGSEGV) in spring 94.1 (OMP) |
I gott this from compiling gnash
Code:
CXXLD dump-gnash |
Dynamic Shared Object
|
Quote:
no, seems that someone is calling boost::tread.interupt what throws an exception which should be caught in the tread code but is not caught code should look like here, taken from there http://www.highscore.de/cpp/boost/multithreading.html Code:
#include <boost/thread.hpp> |
Code:
note: '_ZN5boost6system15system_categoryEv' is defined in DSO /usr/lib64/../lib64/libboost_system.so.1.53.0 so try adding it to the linker command line |
Quote:
|
Not directly related to the original topic, but I'm encountering another issue with gcc 4.8.0. If I compile the kernel (3.6.x and 3.8.x) then one of my laptops (HP 6715b) with a R300 chipset will oops at radeon_vmap_location+0x14. Roll back to gcc 4.7.2 and everything is fine. I have a newer laptop with an R600 and it is fine with either compiler. Perhaps the new gcc is exposing an issue with the radeon code. Maybe the other way around.
|
Quote:
|
All times are GMT -5. The time now is 09:53 PM. |