[PATCH] sparc64: Check whether the compiler supports -fcall-used-g6

DJ Delorie dj@redhat.com
Tue Nov 10 01:39:11 GMT 2026


On Thu, Nov 5, 2026 at 2:50 PM Stian Halseth <stian@itx.no> wrote:
> The sparc64 Makefile adds -fcall-used-g6 unconditionally.

LGTM
Reviewed-by: DJ Delorie <dj@redhat.com>

> diff --git a/Makefile.in b/Makefile.in
>  test-cc-option-wimplicit-fallthrough = @libc_cv_test_cc_wimplicit_fallthrough@
>  test-config-cflags-mprefer-vector-width = @libc_cv_test_cc_mprefer_vector_width@
>  test-config-cflags-signaling-nans = @libc_cv_test_cc_signaling_nans@
> +test-config-cflags-fcall-used-g6 = @libc_cv_test_cc_fcall_used_g6@
>  test-cc-option-wfree-labels = @libc_cv_test_cc_wfree_labels@
>  test-cc-option-wmissing-parameter-name = @libc_cv_test_cc_wmissing_parameter_name@
>  test-enable-cet = @test_enable_cet@

Ok.  This is the same as test_enable_cet, which uses the same setup
but for x86_64.

>                 config-cflags-signaling-nans="$(test-config-cflags-signaling-nans)" \
> +               config-cflags-fcall-used-g6="$(test-config-cflags-fcall-used-g6)" \
>                 cc-option-wfree-labels="$(test-cc-option-wfree-labels)" \

Ok.  This is where the test-* variant is used for "make check"

> diff --git a/configure.ac b/configure.ac
>  # Support configure.ac under sysdeps.
>  AC_SUBST(libc_cv_test_cc_mprefer_vector_width)
> +AC_SUBST(libc_cv_test_cc_fcall_used_g6)
>  AC_SUBST(test_enable_cet)

Ok.  These are all sysdep-specific entries and the new one follows.

> diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/Makefile b/sysdeps/unix/sysv/linux/sparc/sparc64/Makefile
>
> -sysdep-CFLAGS += -fcall-used-g6
> +sysdep-CFLAGS += $(config-cflags-fcall-used-g6)
>  LD += -melf64_sparc

Ok.  Similar to other sysdeps.

> diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/configure.ac b/sysdeps/unix/sysv/linux/sparc/sparc64/configure.ac
> +
> +dnl Clang does not support -fcall-used-<reg>.
> +LIBC_TRY_CC_AND_TEST_CC_OPTION([for -fcall-used-g6],
> +  [-Werror -fcall-used-g6],
> +  libc_cv_cc_fcall_used_g6,
> +  [libc_cv_cc_fcall_used_g6=-fcall-used-g6],
> +  [libc_cv_cc_fcall_used_g6=],
> +  libc_cv_test_cc_fcall_used_g6,
> +  [libc_cv_test_cc_fcall_used_g6=-fcall-used-g6],
> +  [libc_cv_test_cc_fcall_used_g6=])
> +LIBC_CONFIG_VAR([config-cflags-fcall-used-g6],
> +               [$libc_cv_cc_fcall_used_g6])

Ok.



More information about the Libc-alpha mailing list