[PATCH v3 2/2] aarch64: Add memory tagging support for setjmp/longjmp routines

Yury Khrustalev yury.khrustalev@arm.com
Mon Mar 16 09:16:02 GMT 2026


On Thu, Mar 12, 2026 at 12:37:07PM +0200, Claudiu Zissulescu wrote:
> > > +static int
> > > +do_test (void)
> > > +{
> > > +  unsigned long hwcap2;
> > > +
> > > +  hwcap2 = getauxval (AT_HWCAP2);
> > > +  if ((hwcap2 & HWCAP2_MTE) == 0)
> > > +    return EXIT_UNSUPPORTED;
> > 
> > This check is too late because by the time main() is called, we already
> > have
> > 
> >    tst-mte-stack: error while loading shared libraries:
> >      MTE Stack: cannot set stack with PROT_MTE: Invalid argument
> > 
> > on a system without MTE support. Same for another test.
> > 
> 
> The above error is given by the dynamic loader, and it will do so for any
> attempt to load and execute an app which sets DT _AARCH64_MEMTAG_STACK
> dynamic tag. Without the dynamic linker check, an MTE app, most probably,
> will just fail with an unrecognized instruction exception.
> 
> This is happening when one is forcing the execution of the tests in a system
> without MTE support by configuring the glibc build with
> --enable-memory-tagging.

Either way, a test, that is built for some configuration, should run,
and if current runtime platform does not support some feature that is
required for this test, the test should return UNSUPPORTED rather than
break the build.

Thanks,
Yury



More information about the Libc-alpha mailing list