> -----Original Message-----
> From: Karl Meakin <[email protected]>
> Sent: 16 July 2026 17:13
> To: Tamar Christina <[email protected]>; [email protected]; gcc-
> [email protected]
> Subject: Re: [PATCH] aarch64: Add dg-requires for BE support where it used.
> 
> On 16/07/2026 08:53, Tamar Christina wrote:
> >> -----Original Message-----
> >> From: Iain Sandoe <[email protected]>
> >> Sent: 15 July 2026 20:25
> >> To: Karl Meakin <[email protected]>; Tamar Christina
> >> <[email protected]>; [email protected]
> >> Subject: [PATCH] aarch64: Add dg-requires for BE support where it used.
> >>
> >> Tested on aarch64-linux and aarch64-darwin where this resolves around 40
> >> fails and over 1400 UNRESOLVED (on cfarm425 as well).  I guess this is
> >> borderline obvious - but in case I missed something .. OK for trunk?
> > Hmm the UNRESOLVED come from aarch64/neon/* but the other tests, are
> > Assemble and compile only tests and most of them avoid using standard
> headers
> > such that they work without tripping over glibc's ABI variant thing which is
> what
> > prevents the header includes to work when using -mbig-endian and the
> assembler
> > also supports both (well, gas does).
> >
> > But for those tests using stdint_types_mbig_endian effective check should
> work.
> >
> > So I don't think we want the check for big-endian on the tests outside of
> > aarch64/neon.
> >
> >> diff --git a/gcc/testsuite/gcc.target/aarch64/neon/aarch64-neon.exp
> >> b/gcc/testsuite/gcc.target/aarch64/neon/aarch64-neon.exp
> >> index e3a48b306a5..258d632797c 100644
> >> --- a/gcc/testsuite/gcc.target/aarch64/neon/aarch64-neon.exp
> >> +++ b/gcc/testsuite/gcc.target/aarch64/neon/aarch64-neon.exp
> >> @@ -35,9 +35,11 @@ dg-init
> >>   dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*\[cCs\]]] \
> >>    " -ansi -pedantic-errors -std=c23 -O2 -march=armv8-a+simd" ""
> >>
> >> -# Again, for big-endian targets.
> >> -dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*\[cCs\]]] \
> >> +if { [istarget be] } then {
> >> +    # Again, for big-endian targets.
> >> +    dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*\[cCs\]]] \
> >>    " -ansi -pedantic-errors -std=c23 -O2 -march=armv8-a+simd -mbig-
> >> endian" ""
> >> +}
> >>
> > I think the change here is all that's needed, but I think we should just 
> > remove
> > this check entirely.
> >
> > Karl did submit a similar patch to the above for this but I forgot about it 
> > until
> now.
> >
> > But I think we should just remove this, since due to GLIBC's ABI variants 
> > it's
> > very hard to get big endian codegen to work on linux compilers.  As such
> these
> > tests will never run on little-endian for most people.
> >
> > But then on big-endian they'll run twice because the "normal" variant
> doesn't force
> > little endian. So on Big Endian they'll effectively be the same thing.
> >
> > A patch to drop the entire " Again, for big-endian targets." Blob in
> aarch64/neon/aarch64-neon.exp
> >
> > Is thus OK and pre-approved should you want to commit that.
> >
> > Thanks,
> > Tamar
> 
> It is quite easy to make big-endian work on little-endian machines. Just
> create an empty file in
> /usr/include/aarch64-linux-gnu/gnu/stubs-lp64_be.h (I should really
> submit a patch to fix it upstream).
> I think it is valuable to have both endiannesses tested, regardless of
> the endianness of the host machine.

It's not unfortunately. If you look internally we had discussions about it.
Big-Endian is an official ABI variant for glibc. You can't "just make" the file.
GLIBC has to relax the restrictions and even then it will take years for the
Change to trickle down to distros so it's usable by people.

We can't really rely on people having to hack the toolchain to run tests...

Thanks,
Tamar.

> Your point about running the same tests twice on big-endian targets is
> correct, and was due to an oversight on my part. The first `dg-runtest`
> invocation should include an explicit `-mlittle-endian`.

Reply via email to