]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Remove HAVE_GNU_AS: Adjust for GCN assembler ('llvm-mc')
authorThomas Schwinge <tschwinge@baylibre.com>
Mon, 18 May 2026 18:10:12 +0000 (20:10 +0200)
committerThomas Schwinge <tschwinge@baylibre.com>
Wed, 1 Jul 2026 16:59:12 +0000 (18:59 +0200)
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.

gcc/config/gcn/gcn.h

index 3f0dc415cbebc1f50ca5b218a79b3212dde8217f..87605edd79cdeabd83c14fafa22fd0892833aa2c 100644 (file)
@@ -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