[PATCH] aarch64: make GCS configure checks aarch64-only

Yury Khrustalev yury.khrustalev@arm.com
Wed Nov 26 11:33:49 GMT 2025


Polite ping :)

On Mon, Nov 24, 2025 at 03:41:57PM +0000, Yury Khrustalev wrote:
> We only need to enable GCS tests on AArch64 targets, however previously
> the configure checks for GCS support in compiler and linker were added
> for all targets which was not efficient.
> 
> ...
>
> diff --git a/aclocal.m4 b/aclocal.m4
> index cfe9c0b538..5c25a71d8f 100644
> --- a/aclocal.m4
> +++ b/aclocal.m4
> @@ -497,3 +497,31 @@ LIBC_CHECK_TEST_CXX(
>      [LIBC_TRY_CXX_OPTION([$2], [$4], [$5])])
>    )
>  ])
> +
> +dnl Check if toolchain supports generating binaries with the required
> +dnl ELF marking as checked by readelf.
> +dnl LIBC_CHECK_ELF_PROPERTY([message], [pattern], [action-if-true], [action-if-false])
> +AC_DEFUN([LIBC_CHECK_ELF_PROPERTY],
> +[AC_MSG_CHECKING([$1])
> +libc_elf_property=no
> +cat > conftest.c <<EOF
> +int foo (void) { return 42; }
> +EOF
> +if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
> +		  -fPIC -shared -o conftest.so conftest.c
> +		  1>&AS_MESSAGE_LOG_FD])
> +then
> +  if AC_TRY_COMMAND([LC_ALL=C $READELF -n --wide conftest.so | grep "$2" 1>&AS_MESSAGE_LOG_FD])
> +  then
> +    libc_elf_property=yes
> +  else
> +    libc_elf_property=no
> +  fi
> +fi
> +rm -f conftest*
> +if test $libc_elf_property = yes; then
> +  $3
> +else
> +  $4
> +fi
> +AC_MSG_RESULT($libc_elf_property)])

If there is no objection to this macro added to the common aclocal.m4, I
will push this change shortly.

Thanks,
Yury



More information about the Libc-alpha mailing list