http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60348

--- Comment #13 from Richard Biener <rguenth at gcc dot gnu.org> ---
(In reply to Nach from comment #12)
> Isn't the whole point of -static-libstdc++ is to remove the dependency of
> libstdc++ from the binary? Even without the option, it does indeed work fine
> on the system it was compiled on. However, -static-libstdc++ currently does
> not appear to be doing its job, and I would NOT define it as *working*.

The binary is not dependent on libstdc++ anymore and providing a libstdc++
on a system where the binary doesn't work won't fix it (because libstdc++
is not even loaded).

> For nearly 8 years I've been able to provide ready made binaries for
> practically any system (as long as glibc wasn't ancient). Now after a recent
> upgrade of build utilities, I can't seem to provide binaries for anyone who
> isn't using a distro from the past year or so. Even though these are large
> projects and make use of many statically linked binaries, the culprit as
> reported is missing libstdc++ symbols which in theory should not be
> happening if -static-libstdc++ is used, and the two aforementioned symbols
> are the only libstdc++ I see listed in the binary. Using older build
> utilities, I've never seen any libstdc++ symbols appear in a binary when
> -static-libstdc++ was used.
> 
> Adding -fuse-ld=gold appears to be a *workaround* which works for the sample
> test case I used above. But if I try using -fuse-ld=gold with more
> complicated projects, the binary never even ends up linking, with a whole
> spew of missing symbols, which I know for a fact are contained in libraries
> which are being specified.
> 
> If this in fact a bug with binutils and not libstdc++ or GCC, then fine, I
> don't mind reporting it elsewhere, just please assist me in understanding
> the issue so I can effectively do so.

If you want to target old dynamic linkers then you have to disable support
for GCC features that exploit features of new dynamic linkers.  You
need to rebuild GCC to achieve that and provide --disable-gnu-unique-object
at configure time to disable the use of unique object glibc dynamic linker
extension.

Reply via email to