https://gcc.gnu.org/g:382d3c1448d9c85b41ea0d6c2181d5cd1fdb419c
commit r17-2040-g382d3c1448d9c85b41ea0d6c2181d5cd1fdb419c Author: Rainer Orth <[email protected]> Date: Wed Jul 1 10:31:07 2026 +0200 build: Remove $gas By the removal of HAVE_GNU_AS, the gas variable in config.gcc etc. has become unnecessary. This patch removes it. * In some cases, the code is changed to use as_flavor instead. * In config.gcc several tests can be removed: ia64*-*-elf*, hppa*-*-*: : These are a gas-only configurations. ia64-hp-*vms*: The requirements and support status of this configuration isn't documented. * The check in configure.ac to require gas on mips*-*-*, loongarch*-*, and *-*-hpux* can be done unconditionally. 2026-04-11 Rainer Orth <[email protected]> gcc: * acinclude.m4 (gcc_GAS_FLAGS): Check as_flavor instead of gas. * config.gcc: Remove gas. <ia64*-*-elf*> (target_cpu_defaults): Always add MASK_GNU_AS. <ia64-hp-*vms*>: Likewise. <hppa*-*-*> (target_cpu_default2): Always add MASK_GAS. * configure.ac: Remove gas. * configure: Regenerate. Diff: --- gcc/acinclude.m4 | 4 ++-- gcc/config.gcc | 54 ++++++------------------------------------------------ gcc/configure | 27 +++------------------------ gcc/configure.ac | 23 +---------------------- 4 files changed, 12 insertions(+), 96 deletions(-) diff --git a/gcc/acinclude.m4 b/gcc/acinclude.m4 index e9427f37c66c..68a8c2cdea47 100644 --- a/gcc/acinclude.m4 +++ b/gcc/acinclude.m4 @@ -462,7 +462,7 @@ dnl # Used by gcc_GAS_CHECK_FEATURE dnl # AC_DEFUN([gcc_GAS_FLAGS], [AC_CACHE_CHECK([assembler flags], gcc_cv_as_flags, -[ case "$target:$gas" in +[ case "$target:$as_flavor" in *-*-darwin*:*) dnl Darwin with the native assembler uses -arch i386/x86_64/ppc/ppc64. dnl @@ -490,7 +490,7 @@ AC_DEFUN([gcc_GAS_FLAGS], ;; esac ;; - *-*-solaris2*:no) + *-*-solaris2*:solaris) dnl Solaris with the native assembler uses -m32/-m64 consistently. case "$target" in i?86-*-* | sparc-*-*) diff --git a/gcc/config.gcc b/gcc/config.gcc index a95e2e9352d6..3c1b40d6f7cd 100644 --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -179,9 +179,6 @@ # # thread_file Set to control which thread package to use. # -# gas Set to yes or no depending on whether the target -# system normally uses GNU as. -# # configure_default_options # Set to an initializer for configure_default_options # in configargs.h, based on --with-cpu et cetera. @@ -252,9 +249,6 @@ target_cpu_default= gdb_needs_out_file_path= # Set this to control which thread package will be used. thread_file= -# Reinitialize these from the flag values every loop pass, since some -# configure entries modify them. -gas="$gas_flag" gnu_ld="$gnu_ld_flag" default_use_cxa_atexit=no default_gnu_indirect_function=no @@ -883,7 +877,6 @@ case ${target} in esac ;; *-*-dragonfly*) - gas=yes gnu_ld=yes tmake_file="t-slibgcc" case ${enable_threads} in @@ -923,7 +916,6 @@ case ${target} in # The machine-specific section should not tamper with this # ordering but may order all other entries of tm_file as it # pleases around the provided core setting. - gas=yes gnu_ld=yes fbsd_major=`echo ${target} | sed -e 's/.*freebsd//g' | sed -e 's/\..*//g'` if test "$fbsd_major" = ""; then @@ -968,7 +960,6 @@ case ${target} in ;; *-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-gnu* | *-*-kopensolaris*-gnu | *-*-uclinuxfdpiceabi) extra_options="$extra_options gnu-user.opt" - gas=yes gnu_ld=yes case ${enable_threads} in "" | yes | posix) thread_file='posix' ;; @@ -1057,7 +1048,6 @@ case ${target} in tmake_file="t-netbsd t-slibgcc" extra_objs="${extra_objs} netbsd.o" d_target_objs="${d_target_objs} netbsd-d.o" - gas=yes gnu_ld=yes use_gcc_stdint=wrap case ${enable_threads} in @@ -1092,7 +1082,6 @@ case ${target} in target_has_targetrustm=yes ;; *-*-phoenix*) - gas=yes gnu_ld=yes default_use_cxa_atexit=yes ;; @@ -1778,7 +1767,6 @@ bpf-*-*) cris-*-elf | cris-*-none) tm_file="elfos.h newlib-stdint.h ${tm_file}" tmake_file="cris/t-cris cris/t-elfmulti" - gas=yes extra_options="${extra_options} cris/elf.opt" use_gcc_stdint=wrap ;; @@ -1879,7 +1867,6 @@ frv-*-*linux*) tmake_file="${tmake_file} frv/t-frv frv/t-linux" ;; ft32-*-elf) - gas=yes gnu_ld=yes tm_file="elfos.h newlib-stdint.h ${tm_file}" tmake_file="${tmake_file} ft32/t-ft32" @@ -1907,13 +1894,11 @@ amdgcn-*-amdhsa) thread_file=gcn ;; moxie-*-elf) - gas=yes gnu_ld=yes tm_file="elfos.h newlib-stdint.h ${tm_file}" tmake_file="${tmake_file} moxie/t-moxie" ;; moxie-*-uclinux*) - gas=yes gnu_ld=yes tm_file="elfos.h ${tm_file} gnu-user.h linux.h glibc-stdint.h moxie/uclinux.h" tmake_file="${tmake_file} moxie/t-moxie" @@ -1923,7 +1908,6 @@ moxie-*-rtems*) tm_file="moxie/moxie.h elfos.h moxie/rtems.h rtems.h newlib-stdint.h" ;; moxie-*-moxiebox*) - gas=yes gnu_ld=yes tm_file="${tm_file} elfos.h moxie/moxiebox.h newlib-stdint.h" tmake_file="${tmake_file} moxie/t-moxiebox" @@ -1943,7 +1927,7 @@ hppa*64*-*-linux*) pa/pa64-linux.h" tmake_file="${tmake_file} pa/t-pa pa/t-linux" d_target_objs="${d_target_objs} pa-d.o" - gas=yes gnu_ld=yes + gnu_ld=yes ;; hppa*-*-linux*) target_cpu_default="MASK_PA_11|MASK_NO_SPACE_REGS|MASK_CALLER_COPIES" @@ -1959,7 +1943,6 @@ hppa*-*-openbsd*) extra_options="${extra_options} openbsd.opt" tmake_file="pa/t-pa" d_target_objs="${d_target_objs} pa-d.o" - gas=yes gnu_ld=yes ;; hppa*-*-netbsd*) @@ -2001,7 +1984,6 @@ hppa*64*-*-hpux11*) thread_file=posix ;; esac - gas=yes case ${target} in *-*-hpux11.[01]*) use_gcc_stdint=provide @@ -2080,14 +2062,12 @@ i[34567]86-*-openbsd*) tm_file="${tm_file} i386/unix.h i386/att.h elfos.h" tm_file="${tm_file} openbsd.h openbsd-stdint.h openbsd-libpthread.h i386/openbsdelf.h" extra_options="${extra_options} openbsd.opt" - gas=yes gnu_ld=yes ;; x86_64-*-openbsd*) tm_file="${tm_file} i386/unix.h i386/att.h elfos.h" tm_file="${tm_file} openbsd.h openbsd-stdint.h openbsd-libpthread.h i386/x86-64.h i386/openbsdelf.h" extra_options="${extra_options} openbsd.opt" - gas=yes gnu_ld=yes ;; i[34567]86-*-linux* | i[34567]86-*-kfreebsd*-gnu | i[34567]86-*-gnu* | i[34567]86-*-kopensolaris*-gnu) @@ -2195,7 +2175,6 @@ i[34567]86-pc-msdosdjgpp*) native_system_header_dir=/dev/env/DJDIR/include extra_options="${extra_options} i386/djgpp.opt" gnu_ld=yes - gas=yes use_gcc_stdint=wrap ;; i[34567]86-*-lynxos*) @@ -2205,13 +2184,11 @@ i[34567]86-*-lynxos*) extra_options="${extra_options} lynx.opt" thread_file=lynx gnu_ld=yes - gas=yes ;; i[34567]86-*-nto-qnx*) tm_file="${tm_file} i386/att.h tm-dwarf2.h elfos.h i386/unix.h i386/nto.h" extra_options="${extra_options} i386/nto.opt" gnu_ld=yes - gas=yes ;; i[34567]86-*-rtems*) tm_file="${tm_file} i386/unix.h i386/att.h elfos.h i386/i386elf.h i386/rtemself.h rtems.h newlib-stdint.h" @@ -2382,7 +2359,6 @@ i[34567]86-*-mingw* | x86_64-*-mingw*) extra_objs="${extra_objs} winnt.o winnt-stubs.o winnt-dll.o" c_target_objs="${c_target_objs} msformat-c.o" cxx_target_objs="${cxx_target_objs} winnt-cxx.o msformat-c.o" - gas=yes gnu_ld=yes default_use_cxa_atexit=yes use_gcc_stdint=wrap @@ -2410,10 +2386,7 @@ ia64*-*-elf*) tm_file="${tm_file} elfos.h newlib-stdint.h ia64/sysv4.h ia64/elf.h" tmake_file="ia64/t-ia64" target_cpu_default="0" - if test x$gas = xyes - then - target_cpu_default="${target_cpu_default}|MASK_GNU_AS" - fi + target_cpu_default="${target_cpu_default}|MASK_GNU_AS" if test x$gnu_ld = xyes then target_cpu_default="${target_cpu_default}|MASK_GNU_LD" @@ -2457,10 +2430,7 @@ ia64-hp-*vms*) tm_file="${tm_file} elfos.h ia64/sysv4.h vms/vms.h ia64/vms.h" tmake_file="${tmake_file} ia64/t-ia64" target_cpu_default="0" - if test x$gas = xyes - then - target_cpu_default="${target_cpu_default}|MASK_GNU_AS" - fi + target_cpu_default="${target_cpu_default}|MASK_GNU_AS" extra_options="${extra_options} ia64/vms.opt" ;; iq2000*-*-elf*) @@ -2614,7 +2584,6 @@ riscv*-*-linux*) tmake_file="${tmake_file} riscv/t-riscv riscv/t-linux" tm_defines="${tm_defines} TARGET_DEFAULT_ASYNC_UNWIND_TABLES=1" gnu_ld=yes - gas=yes case $target in riscv32be-*|riscv64be-*) tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=1" @@ -2629,7 +2598,6 @@ riscv*-*-gnu*) tm_file="elfos.h gnu-user.h gnu.h glibc-stdint.h ${tm_file} riscv/gnu.h" tmake_file="${tmake_file} riscv/t-riscv" gnu_ld=yes - gas=yes case $target in riscv32be-*|riscv64be-*) tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=1" @@ -2657,7 +2625,6 @@ riscv*-*-elf* | riscv*-*-rtems*) esac tmake_file="${tmake_file} riscv/t-riscv" gnu_ld=yes - gas=yes case $target in riscv32be-*|riscv64be-*) tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=1" @@ -2671,7 +2638,6 @@ riscv*-*-freebsd*) tm_file="${tm_file} elfos.h ${fbsd_tm_file} riscv/freebsd.h" tmake_file="${tmake_file} riscv/t-riscv" gnu_ld=yes - gas=yes case $target in riscv32be-*|riscv64be-*) tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=1" @@ -2692,7 +2658,6 @@ loongarch*-*-linux*) extra_options="${extra_options} linux-android.opt" tmake_file="${tmake_file} loongarch/t-multilib loongarch/t-linux" gnu_ld=yes - gas=yes # Force .init_array support. The configure script cannot always # automatically detect that GAS supports it, yet we require it. @@ -2704,7 +2669,6 @@ loongarch*-*-elf*) tm_file="${tm_file} loongarch/elf.h loongarch/loongarch-driver.h" tmake_file="${tmake_file} loongarch/t-multilib" gnu_ld=yes - gas=yes # For .init_array support. The configure script cannot always # automatically detect that GAS supports it, yet we require it. @@ -2724,7 +2688,6 @@ mips*-img-linux*) with_arch_32="mips32r6" with_arch_64="mips64r6" gnu_ld=yes - gas=yes ;; mips*-mti-linux*) tm_file="elfos.h gnu-user.h linux.h linux-android.h glibc-stdint.h ${tm_file} mips/gnu-user.h mips/linux.h mips/linux-common.h mips/mti-linux.h" @@ -2734,7 +2697,6 @@ mips*-mti-linux*) with_arch_32="mips32r2" with_arch_64="mips64r2" gnu_ld=yes - gas=yes ;; mips*-*-linux*) # Linux MIPS, either endian. tm_file="elfos.h gnu-user.h linux.h linux-android.h glibc-stdint.h ${tm_file} mips/gnu-user.h mips/linux.h mips/linux-common.h" @@ -3274,7 +3236,6 @@ powerpc-*-lynxos*) extra_options="${extra_options} rs6000/sysv4.opt lynx.opt" thread_file=lynx gnu_ld=yes - gas=yes ;; powerpcle-*-elf*) tm_file="${tm_file} elfos.h gnu-user.h freebsd-spec.h newlib-stdint.h rs6000/sysv4.h rs6000/sysv4le.h" @@ -3638,7 +3599,7 @@ sparc64-*-openbsd*) tm_file="${tm_file} openbsd.h openbsd-stdint.h openbsd-libpthread.h sparc/openbsd64.h" extra_options="${extra_options} openbsd.opt" extra_options="${extra_options}" - gas=yes gnu_ld=yes + gnu_ld=yes with_cpu=ultrasparc tmake_file="${tmake_file} sparc/t-sparc" ;; @@ -3730,7 +3691,7 @@ xtensa*-*-uclinux*) ;; am33_2.0-*-linux*) tm_file="mn10300/mn10300.h elfos.h gnu-user.h linux.h glibc-stdint.h mn10300/linux.h" - gas=yes gnu_ld=yes + gnu_ld=yes use_collect2=no ;; *) @@ -6128,10 +6089,7 @@ case ${target} in ;; hppa*-*-*) - if test x$gas = xyes - then - target_cpu_default2="MASK_GAS" - fi + target_cpu_default2="MASK_GAS" ;; fido*-*-* | m68k*-*-*) diff --git a/gcc/configure b/gcc/configure index b619ecf16042..57f9498b961b 100755 --- a/gcc/configure +++ b/gcc/configure @@ -25495,34 +25495,23 @@ case $target in *-*-aix*) if $gcc_cv_as -v 2>&1 | grep '^as V' > /dev/null; then as_flavor=aix - gas=no - else - gas=yes fi ;; *-*-darwin*) as_flavor=darwin - gas=no ;; *-*-solaris2*) if $gcc_cv_as -V 2>&1 | grep 'Compiler Common.*SunOS' > /dev/null; then as_flavor=solaris - gas=no - else - gas=yes fi ;; hppa*64*-*-hpux11*) if $gcc_cv_as -V 2>&1 | grep 'UX.11.*PA-RISC.*Assembler' > /dev/null; then as_flavor=hpux - gas=no - else - gas=yes fi ;; nvptx-*-*) as_flavor=nvptx - gas=no ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $as_flavor" >&5 @@ -25548,15 +25537,6 @@ case "$ORIGINAL_AS_FOR_TARGET" in ;; esac -# Check if we are using GNU as if not already set. -if test -z "$gas"; then - if $gcc_cv_as --version 2>/dev/null | grep GNU > /dev/null; then - gas=yes - else - gas=no - fi -fi - if $gcc_cv_as --help 2>&1 | grep -- --fatal-warnings > /dev/null; then fw_as_opt=--fatal-warnings fi @@ -26253,7 +26233,7 @@ $as_echo_n "checking assembler flags... " >&6; } if ${gcc_cv_as_flags+:} false; then : $as_echo_n "(cached) " >&6 else - case "$target:$gas" in + case "$target:$as_flavor" in *-*-darwin*:*) case "$target" in i?86-*-*) @@ -26276,7 +26256,7 @@ else ;; esac ;; - *-*-solaris2*:no) + *-*-solaris2*:solaris) case "$target" in i?86-*-* | sparc-*-*) gcc_cv_as_flags=-m32 @@ -31733,8 +31713,7 @@ esac case "$target" in mips*-*-* | loongarch*-*-* | *-*-hpux* ) - if test x$gas = xyes \ - || test x"$host" != x"$build" \ + if test x"$host" != x"$build" \ || test ! -x "$gcc_cv_as" \ || "$gcc_cv_as" -v < /dev/null 2>&1 | grep GNU > /dev/null; then : diff --git a/gcc/configure.ac b/gcc/configure.ac index c34e00fc3b4a..ab07f2cba72c 100644 --- a/gcc/configure.ac +++ b/gcc/configure.ac @@ -2741,34 +2741,23 @@ case $target in *-*-aix*) if $gcc_cv_as -v 2>&1 | grep '^as V' > /dev/null; then as_flavor=aix - gas=no - else - gas=yes fi ;; *-*-darwin*) as_flavor=darwin - gas=no ;; *-*-solaris2*) if $gcc_cv_as -V 2>&1 | grep 'Compiler Common.*SunOS' > /dev/null; then as_flavor=solaris - gas=no - else - gas=yes fi ;; hppa*64*-*-hpux11*) if $gcc_cv_as -V 2>&1 | grep 'UX.11.*PA-RISC.*Assembler' > /dev/null; then as_flavor=hpux - gas=no - else - gas=yes fi ;; nvptx-*-*) as_flavor=nvptx - gas=no ;; esac AC_MSG_RESULT($as_flavor) @@ -2787,15 +2776,6 @@ case "$ORIGINAL_AS_FOR_TARGET" in *) AC_CONFIG_FILES(as:exec-tool.in, [chmod +x as]) ;; esac -# Check if we are using GNU as if not already set. -if test -z "$gas"; then - if $gcc_cv_as --version 2>/dev/null | grep GNU > /dev/null; then - gas=yes - else - gas=no - fi -fi - if $gcc_cv_as --help 2>&1 | grep -- --fatal-warnings > /dev/null; then fw_as_opt=--fatal-warnings fi @@ -5595,8 +5575,7 @@ esac case "$target" in mips*-*-* | loongarch*-*-* | *-*-hpux* ) - if test x$gas = xyes \ - || test x"$host" != x"$build" \ + if test x"$host" != x"$build" \ || test ! -x "$gcc_cv_as" \ || "$gcc_cv_as" -v < /dev/null 2>&1 | grep GNU > /dev/null; then :
