https://gcc.gnu.org/g:3dfe871a2cdc7db2645fcdf21a2ff0c081e051af

commit r17-2065-g3dfe871a2cdc7db2645fcdf21a2ff0c081e051af
Author: Thomas Schwinge <[email protected]>
Date:   Mon May 18 20:10:12 2026 +0200

    Remove HAVE_GNU_AS: Adjust for GCN assembler ('llvm-mc')
    
    Fix-up for commit e08a7f620c037275e2c1c5940b56b536077cd98b
    "Remove HAVE_GNU_AS", which didn't consider that GCC/GCN is using LLVM's
    'llvm-mc' as its assembler.  In 'gcc/configure', that one was correctly
    detected as 'gas=no':
    
        # 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
    
    ..., so didn't get 'HAVE_GNU_AS' defined.  Now we're not handling it
    specially anymore, so the default 'ASM_V_SPEC' applies, which changes
    'gcc/specs':
    
        *asm_options:
        [...] {+%{v} %{w:-W} %{I*}+} [...]
    
    ..., and we regress:
    
        Running [...]/gcc.misc-tests/options.exp ...
        [-PASS:-]{+FAIL:+} compiler driver -fdump-ipa-all-address option(s) 
{+(linker options)+}
        [-PASS:-]{+FAIL:+} compiler driver -fdump-ipa-all-alias option(s) 
{+(linker options)+}
        [...]
        [-PASS:-]{+FAIL:+} compiler driver -fdump-tree-all-vops option(s) 
{+(linker options)+}
    
    ..., as these test cases invoke GCC with '-v', which now gets forwarded
    to the GCN assembler ('llvm-mc'), which that one doesn't like:
    
        [...]
         [...]/gcc/as -v [...]
        as: Unknown command line argument '-v'.  Try: '[...]/as --help'
        as: Did you mean '-I'?
        compiler exited with status 1
    
            gcc/
            * config/gcn/gcn.h (ASM_V_SPEC): Define.

Diff:
---
 gcc/config/gcn/gcn.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/gcc/config/gcn/gcn.h b/gcc/config/gcn/gcn.h
index 3f0dc415cbeb..87605edd79cd 100644
--- a/gcc/config/gcn/gcn.h
+++ b/gcc/config/gcn/gcn.h
@@ -84,6 +84,9 @@ extern const struct gcn_device_def {
   {"arch", "%{!march=*:-march=%(VALUE)}" }, \
   {"tune", "%{!mtune=*:-mtune=%(VALUE)}" }
 
+/* Assembler doesn't support '-v' option.  */
+#define ASM_V_SPEC ""
+
 /* Default target_flags if no switches specified.  */
 #ifndef TARGET_DEFAULT
 #define TARGET_DEFAULT 0

Reply via email to