Bug 166870
Summary: | ld reports "cannot find -lstdc++_shared" after upgrade to gcc-3.4.4-2.fc3 | ||||||
---|---|---|---|---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Steve Dirkse <sdirkse> | ||||
Component: | binutils | Assignee: | Jakub Jelinek <jakub> | ||||
Status: | CLOSED NOTABUG | QA Contact: | |||||
Severity: | medium | Docs Contact: | |||||
Priority: | medium | ||||||
Version: | 3 | ||||||
Target Milestone: | --- | ||||||
Target Release: | --- | ||||||
Hardware: | x86_64 | ||||||
OS: | Linux | ||||||
Whiteboard: | |||||||
Fixed In Version: | Doc Type: | Bug Fix | |||||
Doc Text: | Story Points: | --- | |||||
Clone Of: | Environment: | ||||||
Last Closed: | 2005-08-27 15:25:05 UTC | Type: | --- | ||||
Regression: | --- | Mount Type: | --- | ||||
Documentation: | --- | CRM: | |||||
Verified Versions: | Category: | --- | |||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
Cloudforms Team: | --- | Target Upstream Version: | |||||
Embargoed: | |||||||
Attachments: |
|
Description
Steve Dirkse
2005-08-26 16:31:14 UTC
That is an Intel compiler bug though. If the linker has been able to find /usr/lib/gcc/x86_64-*/*/libstdc++.so, it should be able to find libstdc++_shared.so and libstdc++_nonshared.a in the same directory as well. From the above command line, it seems that -L/usr/lib/gcc/x86_64-*linux/3.4.*/ is not passed to the linker. So my guess is that Intel compiler has a symlink from probably /opt/intel_cce_80/lib/libstdc++.so to /usr/lib/gcc/x86_64-*linux/3.4.*/libstdc++.so. But that's just wrong. Either they should point that symlink to /usr/lib/libstdc++.so.6 directly (and live with not being able to link programs that create classes that inherit from basic_stringbuf), or better they should instead of creating symlinks pass -L`gcc -print-search-dirs| sed -n '/^libraries/{s,^libraries: =,,;s,:.*$,,;p}'` As a workaround, you can pass -L /usr/lib/gcc/x86_64-redhat-linux/3.4.4/ on the link command line. In any case, you should report this to Intel, not here. Created attachment 118187 [details]
Example for ld bug - unzip and run ./all.sh
Jakob, You're skeptical - I can respect that. But you skipped over this one a bit too quickly. The linker does find /usr/lib/gcc/x86_64-*/*/libstdc++.so, and it *should* be able to find libstdc++_shared.so and libstdc++_nonshared.a in the same directory, *but it does not*. That's the bug. If you look at the ld command sent in the original report, you'll see that - L/usr/lib/gcc/x86_64-redhat-linux/3.4.4/ is included, so adding it again won't help as a workaround. I've added a zip file to this bug that reproduces the problem without using any Intel compiler tools. To run it, just unzip and do ./all.sh. This creates a .o file using g++ and then uses ld in two ways to create the executable. If you diff works.sh and fails.sh (the scripts that run ld) you'll see the difference between success and failure is very small. That is still a bug in Intel compiler driver resp. in the way you are invoking the linker if you are invoking it by hand. When linking a dynamically linked program (as in this case), you can't ever have -Bstatic mode at the end of the command line. |