FW: [PATCH v2 1/4] aarch64: add configure checks for BTI support

Yury Khrustalev yury.khrustalev@arm.com
Mon Nov 24 12:50:23 GMT 2025


Hi everyone,

On Thu, Nov 20, 2025 at 10:34:00AM +0000, Yury Khrustalev wrote:
> Thanks Andreas and Bill!
> 
> On Sun, Nov 16, 2025 at 04:54:27AM -0600, Bill Roberts wrote:
> > 
> > On 11/19/25 3:15 PM, Bill Roberts wrote:
> > > 
> > > 
> > > From: Andreas Schwab <schwab@suse.de>
> > > Date: Wednesday, November 19, 2025 at 10:46 AM
> > > To: Yury Khrustalev <Yury.Khrustalev@arm.com>
> > > ...
> > > Subject: Re: [PATCH v2 1/4] aarch64: add configure checks for BTI support
> > 
> > ...
> > 
> > > 
> > > On Nov 19 2025, Yury Khrustalev wrote:
> > >
> > > ...
> > >
> > > > +AC_DEFUN([LIBC_CHECK_CC_MACRO],
> > > > +[
> > > > +AC_CACHE_CHECK([$1], $3, [dnl
> > > > +  if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS -dM -E - < /dev/null | grep -wF "$2" 1>&AS_MESSAGE_LOG_FD])
> > > > +  then
> > > > +    [$4]
> > > > +  else
> > > > +    [$5]
> > > > +  fi])
> > > > +])
> > > 
> > > This should use AC_EGREP_CPP, and I don't think we need an extra macro
> > > for that.
> > 
> > You can't, unfortunately, I learned this the painful way. These macros don't
> > respect CFLAGS only CPPFLAGS.
> 
> I confirm that this is the case (although this fact is not documented in
> [1] sadly). The recommended replacement AC_PREPROC_IFELSE uses only
> CPPFLAGS too.

So, this might not actually be important because on top of checking
this macro one would also need to check if the CRT objects provided
by the toolchain have appropriate ELF markings. Normally we do not
recompile these objects, and, if they are not marked, it doesn't really
matter if GCC provides this macro because the resulting libc.so and
test binaries will not have the markings and the tests would fail.

Anyway, I've sent a separate patch that adds a macro to aclocal.m4 that
allows to grep output from readelf [1]. If it's OK, we can use it for
BTI as well as for GCS.

Thanks,
Yury

[1]: https://inbox.sourceware.org/libc-alpha/20251124124512.693838-1-yury.khrustalev@arm.com/



More information about the Libc-alpha mailing list