Summary: | app-admin/syslog-ng-2.1.4: fails with forced --as-needed | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Stephen Bridges <widget> |
Component: | Current packages | Assignee: | Mr. Bones. (RETIRED) <mr_bones_> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | 404errorqc, anotherbearcatfan, bugs+gentoo, esigra, flameeyes |
Priority: | High | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Bug Depends on: | |||
Bug Blocks: | 129413 | ||
Attachments: | syslog-ng with --as-need linker flag buildlog |
Description
Stephen Bridges
2009-04-10 12:46:06 UTC
same issue here Patches welcome. I don't use --as-needed. The problem is with the ordering of the libraries. What is asked to the linker is to: link librt (why? there is nothing using it, so it's skipped) move to static linking link libgthread (that needs librt) link librt (now there is need for it and is linked, but we're in static linking mode) return to dynamic linking (implicitly link the C library). The _dl_cpuclock_offset symbol is needed by the static rt library and defined in the static C library, but it's neither needed nor defined in the dynamic versions. This is actually a tricky situation, I guess the easy way out would be to remove the -lrt from the libraries found with libgthread and then append it _after_ returning to dynamic linking. Or finally decide that glib is important for the system and move everything in /lib using dynamic linking ;) Using the GCC spec to force --as-needed did NOT run into this problem. I last built syslog-ng-2.1.4 on 4/13. Created attachment 189988 [details]
syslog-ng with --as-need linker flag buildlog
Hi,
I ran into the same trouble !!!
Is this really failing with "forced" --as-needed, as the description says? I thought it only failed with LDFLAGS="-Wl,--as-needed". After all, if it really fails with "forced", then I must have been very lucky when it compiled for me on 4/13. Could someone else please verify this and update the description accordingly? It fails on my system with LDFLAGS="-Wl,-O1 -Wl,--as-needed" but not if I remove it. The same happens here (glibc 2.10.1). My apologies, I forgot to mention that I use GCC 4.4.1... Should this have to be considered as a ld bug and/or be reported ? I recently emerged world after gcc-4.3.4 was released. Once again, I used Flameeyes' method to generate a forced --as-needed gcc spec file, which is set as my default gcc profile. This resulted in a successful build. I suggest anyone playing with --as-needed to try this method instead of using '-Wl,--as-needed'. I'll happily take a patch for this but I don't use --as-needed so there's not going to be any progress unless an actual user of that feature steps up. I assume it's still the same with the 3.0.x series? 3.1.1 emerged just fine here with forced asneeded (and also got redudant -Wl,--as-needed in LDFLAGS if that matters, it doesn't) also I can't remember even 2.1.x failing for me, but it's been a while. so far as I know -> fixed by 3.1.1 |