#endif
+/* Define to 1 if using the Solaris assembler. */
+#ifndef USED_FOR_TARGET
+#undef HAVE_SOLARIS_AS
+#endif
+
+
/* Define to 1 if you have the <stddef.h> header file. */
#ifndef USED_FOR_TARGET
#undef HAVE_STDDEF_H
return;
}
-#if !HAVE_GNU_AS
+#if HAVE_SOLARIS_AS
if (HAVE_COMDAT_GROUP && flags & SECTION_LINKONCE)
{
solaris_elf_asm_comdat_section (name, flags, decl);
#define CC1_SPEC "%(cc1_cpu) " ASAN_CC1_SPEC SCTF_CC1_SPEC \
" %{mx32:%e-mx32 is not supported on Solaris}"
-/* GNU as understands --32 and --64, but the native Solaris
- assembler requires -m32 or -m64 instead. */
-#if HAVE_GNU_AS
-#define ASM_CPU32_DEFAULT_SPEC "--32"
-#define ASM_CPU64_DEFAULT_SPEC "--64"
-#else
+#if HAVE_SOLARIS_AS
#define ASM_CPU32_DEFAULT_SPEC "-m32"
#define ASM_CPU64_DEFAULT_SPEC "-m64"
+#else
+#define ASM_CPU32_DEFAULT_SPEC "--32"
+#define ASM_CPU64_DEFAULT_SPEC "--64"
#endif
-#if !HAVE_GNU_AS
+#if HAVE_SOLARIS_AS
/* Since Studio 12.6, as needs -xbrace_comment=no so its AVX512 syntax is
fully compatible with gas. */
#define ASM_XBRACE_COMMENT_SPEC "-xbrace_comment=no"
} \
} while (0)
-#if !HAVE_GNU_AS
+#if HAVE_SOLARIS_AS
/* The Sun assembler uses .tcomm for TLS common sections. */
#define TLS_COMMON_ASM_OP ".tcomm"
ASM_OUTPUT_LABEL (FILE, NAME); \
} \
while (0)
-#endif /* !HAVE_GNU_AS */
+#endif /* HAVE_SOLARIS_AS */
/* As in sparc/sol2.h, override the default from i386/x86-64.h to work
around Sun as TLS bug. */
/* Sun as requires "h" flag for large sections, GNU as can do without, but
accepts "l". */
-#if HAVE_GNU_AS
-#define MACH_DEP_SECTION_ASM_FLAG 'l'
-#else
+#if HAVE_SOLARIS_AS
#define MACH_DEP_SECTION_ASM_FLAG 'h'
+#else
+#define MACH_DEP_SECTION_ASM_FLAG 'l'
#endif
-#if !HAVE_GNU_AS
+#if HAVE_SOLARIS_AS
/* Emit COMDAT group signature symbols for Sun as. */
#undef TARGET_ASM_FILE_END
#define TARGET_ASM_FILE_END solaris_file_end
#define DTORS_SECTION_ASM_OP "\t.section\t.dtors, \"aw\""
#endif
-#if !HAVE_GNU_AS
+#if HAVE_SOLARIS_AS
#define LARGECOMM_SECTION_ASM_OP "\t.lbcomm\t"
#endif
} \
while (0)
-#if !HAVE_GNU_AS
+#if HAVE_SOLARIS_AS
#undef TARGET_ASM_ASSEMBLE_VISIBILITY
#define TARGET_ASM_ASSEMBLE_VISIBILITY solaris_assemble_visibility
/* We switch to the explicit word size selection mechanism available both in
GNU as and Sun as, for the Niagara4 and above configurations. */
-#if !HAVE_GNU_AS
+#if HAVE_SOLARIS_AS
#undef ASM_ARCH32_SPEC
#define ASM_ARCH32_SPEC "-m32"
#undef ASM_ARCH64_SPEC
} \
while (0)
-#if !HAVE_GNU_AS
+#if HAVE_SOLARIS_AS
/* This is how to output an assembler line that says to advance
the location counter to a multiple of 2**LOG bytes using the
NOP instruction as padding. The filler pattern doesn't work
/* Sun as requires doublequoted section names on SPARC. While GNU as
supports that, too, we prefer the standard variant. */
#define SECTION_NAME_FORMAT "\"%s\""
-#endif /* !HAVE_GNU_AS */
+#endif /* HAVE_SOLARIS_AS */
/* Undefine this so that attribute((init_priority)) works with GNU ld. */
#if HAVE_GNU_LD
#define TARGET_STACK_PROTECT_GUARD hook_tree_void_null
#endif
-#if HAVE_GNU_AS
+#if !HAVE_SOLARIS_AS
#undef TARGET_ASM_OUTPUT_DWARF_DTPREL
#define TARGET_ASM_OUTPUT_DWARF_DTPREL sparc_output_dwarf_dtprel
#endif
/* In non-PIC mode, Sun as (unlike GNU as) emits PC-relative relocations for
the GOT symbol with the 32-bit ABI, so we reload the GOT register. */
- if (!HAVE_GNU_AS && TARGET_ARCH32)
+ if (HAVE_SOLARIS_AS && TARGET_ARCH32)
{
load_got_register ();
return got_register_rtx;
emit_insn (gen_tie_ld32 (temp3, got, temp2, addr));
else
emit_insn (gen_tie_ld64 (temp3, got, temp2, addr));
- if (!HAVE_GNU_AS)
+ if (HAVE_SOLARIS_AS)
{
ret = gen_reg_rtx (Pmode);
emit_insn (gen_tie_add (Pmode, ret, gen_rtx_REG (Pmode, 7),
;; Attributes for branch scheduling
(define_attr "tls_delay_slot" "false,true"
- (symbol_ref "((HAVE_GNU_AS && HAVE_GNU_LD) != 0
+ (symbol_ref "((!HAVE_SOLARIS_AS && HAVE_GNU_LD) != 0
? TLS_DELAY_SLOT_TRUE : TLS_DELAY_SLOT_FALSE)"))
(define_attr "in_sibcall_delay" "false,true"
(unspec:P [(match_operand:P 2 "register_operand" "r")
(match_operand 3 "tie_symbolic_operand" "")]
UNSPEC_TLSIE)))]
- "!HAVE_GNU_AS"
+ "HAVE_SOLARIS_AS"
"add\\t%1, %2, %0, %%tie_add(%a3)")
(define_insn "@tle_hix22<P:mode>"
fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Solaris assembler" >&5
+$as_echo_n "checking Solaris assembler... " >&6; }
+case $target in
+ *-*-solaris2*)
+ if $gcc_cv_as -V 2>&1 | grep 'Compiler Common.*SunOS' > /dev/null; then
+ solaris_as=yes
+ gas_flag=no
+ elif $gcc_cv_as --version 2>/dev/null | grep GNU > /dev/null; then
+ gas_flag=yes
+ fi
+ ;;
+ *)
+ solaris_as=no
+ ;;
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $solaris_as" >&5
+$as_echo "$solaris_as" >&6; }
+solaris_as_bool=`if test $solaris_as = yes; then echo 1; else echo 0; fi`
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_SOLARIS_AS $solaris_as_bool
+_ACEOF
+
+
ORIGINAL_AS_FOR_TARGET=$gcc_cv_as
case "$ORIGINAL_AS_FOR_TARGET" in
gas_flag=no
fi])
+AC_MSG_CHECKING(Solaris assembler)
+case $target in
+ *-*-solaris2*)
+ if $gcc_cv_as -V 2>&1 | grep 'Compiler Common.*SunOS' > /dev/null; then
+ solaris_as=yes
+ gas_flag=no
+ elif $gcc_cv_as --version 2>/dev/null | grep GNU > /dev/null; then
+ gas_flag=yes
+ fi
+ ;;
+ *)
+ solaris_as=no
+ ;;
+esac
+AC_MSG_RESULT($solaris_as)
+solaris_as_bool=`if test $solaris_as = yes; then echo 1; else echo 0; fi`
+AC_DEFINE_UNQUOTED(HAVE_SOLARIS_AS, $solaris_as_bool,
+ [Define to 1 if using the Solaris assembler.])
+
ORIGINAL_AS_FOR_TARGET=$gcc_cv_as
AC_SUBST(ORIGINAL_AS_FOR_TARGET)
case "$ORIGINAL_AS_FOR_TARGET" in