[PATCH] gas: Fix -mrelax-relocations detection on Solaris/x86 [PR19520]
H.J. Lu
hjl.tools@gmail.com
Wed Oct 15 23:47:50 GMT 2025
On Mon, Oct 13, 2025 at 5:42 PM Rainer Orth <ro@cebitec.uni-bielefeld.de> wrote:
>
> 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.
Remove --enable-x86-relax-relocations is OK. But -mrelax-relocations=[no|yes]
should stay since it is used in binutils tests. I don't see any
issues for cross binutils.
--
H.J.
More information about the Binutils
mailing list