[PATCH] gas: Fix -mrelax-relocations detection on Solaris/x86 [PR19520]

Rainer Orth ro@CeBiTec.Uni-Bielefeld.DE
Mon Oct 13 09:42:31 GMT 2025


Hi Jan,

>>> Hmm, no, not really. What target an assembler is built for shouldn't
>>> really depend on host properties imo. There's no other similar use
>>> of uname anywhere in the script.
>> 
>> what else could I do?  Natively, I see three options:
>> 
>> * Try to link an object containing one of the gotx relocs with /bin/ld.
>>   However, that might be difficult to create since there's no guarantee
>>   that gas is even available when building binutils.
>> 
>> * Check the native <sys/elf_i386.h> and <sys/elf_amd64.h> if the gotx
>>   relocs are defined there.
>> 
>> * Check if the exact OS version is 11.4.
>> 
>> None of this works for crosses:
>> 
>> * The first is obviously impossible.
>> 
>> * The second would work, but the natively headers are most likely not
>>   available for a cross build.
>> 
>> * The third won't work either since the info about the minor OS versions
>>   isn't included in the target triplet.
>> 
>> That's why I used the uname route in the native case while erring on the
>> side of caution for crosses by disabling gotx reloc support.
>> 
>> If you have other suggestions, I'm all ears.
>
> I don't; perhaps the only viable route is the option discussed on the other
> sub-thread (with H.J.).

OTOH I don't see what's so bad with native-only checks in configure.ac.
Why should the toolchain be held hostage to what can be done in crosses?
There are quite a number of such native-only checks in gcc/configure.ac
and this was never considered a problem, provided there's a reasonable
fallback for crosses.

For the case at hand, I don't mind since I'd prefer to remove
-mrelax-relocations for good since it was only ever created for the
benefit of Solaris 12/11.4, but has been unused/disabled for at least 7
years.

	Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University


More information about the Binutils mailing list