Summary: | games-simulation/openttd-0.5.2 fails w/ Wl,--as-needed | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Conrad Kostecki <conikost> |
Component: | [OLD] Games | Assignee: | Lars Weiler (RETIRED) <pylon> |
Status: | RESOLVED WONTFIX | ||
Severity: | normal | CC: | games |
Priority: | High | ||
Version: | 2007.0 | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Bug Depends on: | |||
Bug Blocks: | 129413 | ||
Attachments: | openttd-0.5.2-r1.patch |
Description
Conrad Kostecki
![]() Created attachment 122695 [details, diff]
openttd-0.5.2-r1.patch
openttd-0.5.2-r1.patch
patch against openttd-0.5.2.ebuild
Rather -lpthread should be added somewhere. Oke, if this help? So lets add this. I just checked and I can build it with -Wl,--as-needed :) . Hmm strange. You are right. It seems to work. -Wl,--as-needed works alone! But if i use it together with another ldflags (it doesn't matter which other!) i get this error. USE="-lpthread" does not help. So i would guess, we should remove -Wl,--as-needed if its not used alone! I have LDFLAGS="-Wl,-O1,--as-needed,--hash-style=gnu,--sort-common,-z,relro". (-lname is linker option, it causes linking with libname.so or libname.a, if the former isn't available or option -static is used.) Just for testing, with your LDFLAGS i am NOT able to build openttd :( (--hash-style=gnu does not work, as my binutils are only 2.17) only LDFLAGS="-Wl,--as-needed" alone works here. But --as-needed combined with another LDFLAGS like --sort-common or -z,now or other, it always fails! ===> Linking openttd thread.o: In function `OTTDJoinThread': thread.c:(.text+0x2c): undefined reference to `pthread_join' thread.o: In function `OTTDCreateThread': thread.c:(.text+0x84): undefined reference to `pthread_create' collect2: ld gab 1 als Ende-Status zurück make: *** [openttd] Fehler 1 I can't reproduce your problem. But that might be, that I built my complete system without any LDFLAGS set. And according to http://www.gentoo.org/proj/en/qa/asneeded.xml we don't support fixing broken/critical LDFLAGS. Stick with the defaults and you will be happy. Probably one of your reverse-dependency is broken? Check your system and build with a sane environment. I checked this ;) On a System without LDFlags and on my System with complete LDFlags! Both don't compile. Hey Guys ... is that normal? THIS WORKS: LDFLAGS="-Wl,--as-needed -Wl,--sort-common -s -Wl,-O1 -Wl,-z,now" THIS WORKS NOT: LDFLAGS=" -Wl,-O1 -Wl,--as-needed -Wl,--sort-common -s -Wl,-z,now" Could somebody explain me, why only the first works? The second only is chanced, so --as-needed is first? oO |