[Bug bootstrap/84017] [6/7/8 regression] Bootstrap failure on Solaris 10/x86 with gas/ld

ro at CeBiTec dot Uni-Bielefeld.DE gcc-bugzilla@gcc.gnu.org
Mon Jan 29 09:31:00 GMT 2018


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84017

--- Comment #4 from ro at CeBiTec dot Uni-Bielefeld.DE <ro at CeBiTec dot Uni-Bielefeld.DE> ---
> --- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
> I can't think of how the self-test failure could be related, unless it just
> results in miscompiled stage2 or stage3 compiler.

It seems that's exactly what's happening, both for cc1 and go1.

> Anyway, .gnu.linkonce* sections are used when the assembler/linker don't
> support comdat, when they do, we instead use comdat.  If the gas/ld combo on
> Solaris 10 doesn't support either comdat, or properly .gnu.linkonce, then it
> probably can't claim it SUPPORTS_ONE_ONLY and then pretty much doesn't support
> C++ at a usable level.  Or what exact part of .gnu.linkonce this combo doesn't
> support?
> In the i?86-*-solaris* target hook it could override any of the generic hooks
> that rely on it.
> Or just declare gas/ld combo unsupported on Solaris 10.

I've done some digging over the weekend.  Initially, prompted by the
linker warnings during the build

ld: warning: relocation warning: R_386_GOTOFF: file
../src/c++11/.libs/libc++11convenience.a(locale-inst.o): section
[217].rel.gnu.linkonce.t._ZNSt17moneypunct_bynameIcLb0EEC2EPKcj: symbol .LC0:
relocation against discarded COMDAT section
[138].gnu.linkonce.r._ZSt16__convert_from_vRKPiPciPKcz.str1.1: symbol not
found, relocation ignored

I was reminded of ld's -z relaxreloc option (more on that separately).
While it doesn't help in this case, it probably provides an option to
enable comdat on some versions of Solaris 10 (though certainly not for GCC 8).

However, looking more closely at the warnings, the only affect two files

../src/c++11/.libs/libc++11convenience.a(locale-inst.o):
../src/c++11/.libs/libc++11convenience.a(wlocale-inst.o):

and refer only to a single comdat section:

.gnu.linkonce.r._ZSt16__convert_from_vRKPiPciPKcz.str1.1

This is only present in the gas builds, since as seems to have no syntax
for the SHF_MERGE flag, thus explaining why only gas/ld is failing.

I've prepared a patch to disable HAVE_GAS_SHF_MERGE which allowed me to
successfully bootstrap both the gas/ld and as/ld configurations.

        Rainer


More information about the Gcc-bugs mailing list