#endif
+/* Define if your assembler supports the --gdwarf-5 option. */
+#ifndef USED_FOR_TARGET
+#undef HAVE_AS_GDWARF_5_DEBUG_FLAG
+#endif
+
+
/* Define if your assembler supports .gnu_attribute. */
#ifndef USED_FOR_TARGET
#undef HAVE_AS_GNU_ATTRIBUTE
#endif
+/* Define if your assembler supports --gdwarf-4 even with compiler generated
+ .debug_line */
+#ifndef USED_FOR_TARGET
+#undef HAVE_AS_WORKING_DWARF_4_FLAG
+#endif
+
+
/* Define if your assembler supports -xbrace_comment option. */
#ifndef USED_FOR_TARGET
#undef HAVE_AS_XBRACE_COMMENT_OPTION
debugging data. */
#define ASM_DEBUG_SPEC "%{g*:%{%:debug-level-gt(0):%{!gdwarf*:--gstabs}}}"
+#define ASM_DEBUG_OPTION_SPEC ""
#define ASM_FINAL_SPEC \
"%{gsplit-dwarf:%ngsplit-dwarf is not supported on this platform} %<gsplit-dwarf"
#undef ASM_DEBUG_SPEC
#define ASM_DEBUG_SPEC "%{g*:%{%:debug-level-gt(0):%{gstabs:--gstabs}}}"
+#undef ASM_DEBUG_OPTION_SPEC
+#define ASM_DEBUG_OPTION_SPEC ""
+
#undef ASM_OUTPUT_ALIGNED_COMMON
#define ASM_OUTPUT_ALIGNED_COMMON(FILE, NAME, SIZE, ALIGN) \
do { \
fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for --gdwarf-5 option" >&5
+$as_echo_n "checking assembler for --gdwarf-5 option... " >&6; }
+if ${gcc_cv_as_gdwarf_5_flag+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ gcc_cv_as_gdwarf_5_flag=no
+ if test $in_tree_gas = yes; then
+ if test $in_tree_gas_is_elf = yes \
+ && test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 36 \) \* 1000 + 0`
+ then gcc_cv_as_gdwarf_5_flag=yes
+fi
+ elif test x$gcc_cv_as != x; then
+ $as_echo "$insn" > conftest.s
+ if { ac_try='$gcc_cv_as $gcc_cv_as_flags --gdwarf-5 -o conftest.o conftest.s >&5'
+ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; }
+ then
+ gcc_cv_as_gdwarf_5_flag=yes
+ else
+ echo "configure: failed program was" >&5
+ cat conftest.s >&5
+ fi
+ rm -f conftest.o conftest.s
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_as_gdwarf_5_flag" >&5
+$as_echo "$gcc_cv_as_gdwarf_5_flag" >&6; }
+if test $gcc_cv_as_gdwarf_5_flag = yes; then
+
+$as_echo "#define HAVE_AS_GDWARF_5_DEBUG_FLAG 1" >>confdefs.h
+
+fi
+
+
+ dwarf4_debug_info_size=0x46
+ dwarf4_high_pc_form=7
+ dwarf4_debug_aranges_size=0x2c
+ dwarf4_line_sz=9
+ for dwarf4_addr_size in 8 4; do
+ conftest_s="\
+ .file \"a.c\"
+ .text
+.Ltext0:
+ .p2align 4
+ .globl foo
+ .type foo, %function
+foo:
+.LFB0:
+.LM1:
+ $insn
+.LM2:
+.LFE0:
+ .size foo, .-foo
+.Letext0:
+ .section .debug_info,\"\",%progbits
+.Ldebug_info0:
+ .4byte $dwarf4_debug_info_size
+ .2byte 0x4
+ .4byte .Ldebug_abbrev0
+ .byte 0x$dwarf4_addr_size
+ .byte 0x1
+ .ascii \"GNU C17\\0\"
+ .byte 0xc
+ .ascii \"a.c\\0\"
+ .ascii \"/\\0\"
+ .${dwarf4_addr_size}byte .Ltext0
+ .${dwarf4_addr_size}byte .Letext0-.Ltext0
+ .4byte .Ldebug_line0
+ .byte 0x2
+ .ascii \"foo\\0\"
+ .byte 0x1
+ .byte 0x2
+ .byte 0x1
+ .${dwarf4_addr_size}byte .LFB0
+ .${dwarf4_addr_size}byte .LFE0-.LFB0
+ .byte 0x1
+ .byte 0x9c
+ .byte 0
+ .section .debug_abbrev,\"\",%progbits
+.Ldebug_abbrev0:
+ .byte 0x1
+ .byte 0x11
+ .byte 0x1
+ .byte 0x25
+ .byte 0x8
+ .byte 0x13
+ .byte 0xb
+ .byte 0x3
+ .byte 0x8
+ .byte 0x1b
+ .byte 0x8
+ .byte 0x11
+ .byte 0x1
+ .byte 0x12
+ .byte 0x$dwarf4_high_pc_form
+ .byte 0x10
+ .byte 0x17
+ .byte 0
+ .byte 0
+ .byte 0x2
+ .byte 0x2e
+ .byte 0
+ .byte 0x3f
+ .byte 0x19
+ .byte 0x3
+ .byte 0x8
+ .byte 0x3a
+ .byte 0xb
+ .byte 0x3b
+ .byte 0xb
+ .byte 0x39
+ .byte 0xb
+ .byte 0x11
+ .byte 0x1
+ .byte 0x12
+ .byte 0x$dwarf4_high_pc_form
+ .byte 0x40
+ .byte 0x18
+ .byte 0
+ .byte 0
+ .byte 0
+ .section .debug_aranges,\"\",%progbits
+ .4byte $dwarf4_debug_aranges_size
+ .2byte 0x2
+ .4byte .Ldebug_info0
+ .byte 0x8
+ .byte 0
+ .2byte 0
+ .2byte 0
+ .${dwarf4_addr_size}byte .Ltext0
+ .${dwarf4_addr_size}byte .Letext0-.Ltext0
+ .${dwarf4_addr_size}byte 0
+ .${dwarf4_addr_size}byte 0
+ .section .debug_line,\"\",%progbits
+.Ldebug_line0:
+ .4byte .LELT0-.LSLT0
+.LSLT0:
+ .2byte 0x4
+ .4byte .LELTP0-.LASLTP0
+.LASLTP0:
+ .byte 0x1
+ .byte 0x1
+ .byte 0x1
+ .byte 0xf6
+ .byte 0xf2
+ .byte 0xd
+ .byte 0
+ .byte 0x1
+ .byte 0x1
+ .byte 0x1
+ .byte 0x1
+ .byte 0
+ .byte 0
+ .byte 0
+ .byte 0x1
+ .byte 0
+ .byte 0
+ .byte 0x1
+ .byte 0
+ .ascii \"a.c\\0\"
+ .byte 0
+ .byte 0
+ .byte 0
+ .byte 0
+.LELTP0:
+ .byte 0
+ .byte 0x$dwarf4_line_sz
+ .byte 0x2
+ .${dwarf4_addr_size}byte .LM1
+ .byte 0x18
+ .byte 0x5
+ .byte 0x1
+ .byte 0
+ .byte 0x$dwarf4_line_sz
+ .byte 0x2
+ .${dwarf4_addr_size}byte .LM2
+ .byte 0x1
+ .byte 0x5
+ .byte 0x1
+ .byte 0
+ .byte 0x$dwarf4_line_sz
+ .byte 0x2
+ .${dwarf4_addr_size}byte .Letext0
+ .byte 0
+ .byte 0x1
+ .byte 0x1
+.LELT0:
+ .section .debug_str,\"\",%progbits
+ .ident \"GCC\"
+"
+ dwarf4_success=no
+ if test $dwarf4_addr_size = 4; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for assembly of compiler generated 32-bit .debug_line" >&5
+$as_echo_n "checking assembler for assembly of compiler generated 32-bit .debug_line... " >&6; }
+if ${gcc_cv_as_debug_line_32_flag+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ gcc_cv_as_debug_line_32_flag=no
+ if test $in_tree_gas = yes; then
+ if test $in_tree_gas_is_elf = yes \
+ && test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 36 \) \* 1000 + 0`
+ then gcc_cv_as_debug_line_32_flag=yes
+fi
+ elif test x$gcc_cv_as != x; then
+ $as_echo "$conftest_s" > conftest.s
+ if { ac_try='$gcc_cv_as $gcc_cv_as_flags -o conftest.o conftest.s >&5'
+ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; }
+ then
+ gcc_cv_as_debug_line_32_flag=yes
+ else
+ echo "configure: failed program was" >&5
+ cat conftest.s >&5
+ fi
+ rm -f conftest.o conftest.s
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_as_debug_line_32_flag" >&5
+$as_echo "$gcc_cv_as_debug_line_32_flag" >&6; }
+if test $gcc_cv_as_debug_line_32_flag = yes; then
+ success=yes
+fi
+
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for assembly of compiler generated 64-bit .debug_line" >&5
+$as_echo_n "checking assembler for assembly of compiler generated 64-bit .debug_line... " >&6; }
+if ${gcc_cv_as_debug_line_64_flag+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ gcc_cv_as_debug_line_64_flag=no
+ if test $in_tree_gas = yes; then
+ if test $in_tree_gas_is_elf = yes \
+ && test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 36 \) \* 1000 + 0`
+ then gcc_cv_as_debug_line_64_flag=yes
+fi
+ elif test x$gcc_cv_as != x; then
+ $as_echo "$conftest_s" > conftest.s
+ if { ac_try='$gcc_cv_as $gcc_cv_as_flags -o conftest.o conftest.s >&5'
+ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; }
+ then
+ gcc_cv_as_debug_line_64_flag=yes
+ else
+ echo "configure: failed program was" >&5
+ cat conftest.s >&5
+ fi
+ rm -f conftest.o conftest.s
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_as_debug_line_64_flag" >&5
+$as_echo "$gcc_cv_as_debug_line_64_flag" >&6; }
+if test $gcc_cv_as_debug_line_64_flag = yes; then
+ dwarf4_success=yes
+fi
+
+ fi
+ if test $dwarf4_success = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for --gdwarf-4 not refusing compiler generated .debug_line" >&5
+$as_echo_n "checking assembler for --gdwarf-4 not refusing compiler generated .debug_line... " >&6; }
+if ${gcc_cv_as_dwarf_4_debug_line_flag+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ gcc_cv_as_dwarf_4_debug_line_flag=no
+ if test $in_tree_gas = yes; then
+ if test $in_tree_gas_is_elf = yes \
+ && test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 36 \) \* 1000 + 0`
+ then gcc_cv_as_dwarf_4_debug_line_flag=yes
+fi
+ elif test x$gcc_cv_as != x; then
+ $as_echo "$conftest_s" > conftest.s
+ if { ac_try='$gcc_cv_as $gcc_cv_as_flags --gdwarf-4 -o conftest.o conftest.s >&5'
+ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; }
+ then
+ gcc_cv_as_dwarf_4_debug_line_flag=yes
+ else
+ echo "configure: failed program was" >&5
+ cat conftest.s >&5
+ fi
+ rm -f conftest.o conftest.s
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_as_dwarf_4_debug_line_flag" >&5
+$as_echo "$gcc_cv_as_dwarf_4_debug_line_flag" >&6; }
+if test $gcc_cv_as_dwarf_4_debug_line_flag = yes; then
+
+$as_echo "#define HAVE_AS_WORKING_DWARF_4_FLAG 1" >>confdefs.h
+
+fi
+
+ break
+ fi
+ dwarf4_debug_info_size=0x36
+ dwarf4_high_pc_form=6
+ dwarf4_debug_aranges_size=0x1c
+ dwarf4_line_sz=5
+ done
+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for --gstabs option" >&5
$as_echo_n "checking assembler for --gstabs option... " >&6; }
if ${gcc_cv_as_gstabs_flag+:} false; then :
[AC_DEFINE(HAVE_AS_GDWARF2_DEBUG_FLAG, 1,
[Define if your assembler supports the --gdwarf2 option.])])
+ gcc_GAS_CHECK_FEATURE([--gdwarf-5 option],
+ gcc_cv_as_gdwarf_5_flag,
+ [elf,2,36,0], [--gdwarf-5], [$insn],,
+ [AC_DEFINE(HAVE_AS_GDWARF_5_DEBUG_FLAG, 1,
+[Define if your assembler supports the --gdwarf-5 option.])])
+
+ dwarf4_debug_info_size=0x46
+ dwarf4_high_pc_form=7
+ dwarf4_debug_aranges_size=0x2c
+ dwarf4_line_sz=9
+ for dwarf4_addr_size in 8 4; do
+ conftest_s="\
+ .file \"a.c\"
+ .text
+.Ltext0:
+ .p2align 4
+ .globl foo
+ .type foo, %function
+foo:
+.LFB0:
+.LM1:
+ $insn
+.LM2:
+.LFE0:
+ .size foo, .-foo
+.Letext0:
+ .section .debug_info,\"\",%progbits
+.Ldebug_info0:
+ .4byte $dwarf4_debug_info_size
+ .2byte 0x4
+ .4byte .Ldebug_abbrev0
+ .byte 0x$dwarf4_addr_size
+ .byte 0x1
+ .ascii \"GNU C17\\0\"
+ .byte 0xc
+ .ascii \"a.c\\0\"
+ .ascii \"/\\0\"
+ .${dwarf4_addr_size}byte .Ltext0
+ .${dwarf4_addr_size}byte .Letext0-.Ltext0
+ .4byte .Ldebug_line0
+ .byte 0x2
+ .ascii \"foo\\0\"
+ .byte 0x1
+ .byte 0x2
+ .byte 0x1
+ .${dwarf4_addr_size}byte .LFB0
+ .${dwarf4_addr_size}byte .LFE0-.LFB0
+ .byte 0x1
+ .byte 0x9c
+ .byte 0
+ .section .debug_abbrev,\"\",%progbits
+.Ldebug_abbrev0:
+ .byte 0x1
+ .byte 0x11
+ .byte 0x1
+ .byte 0x25
+ .byte 0x8
+ .byte 0x13
+ .byte 0xb
+ .byte 0x3
+ .byte 0x8
+ .byte 0x1b
+ .byte 0x8
+ .byte 0x11
+ .byte 0x1
+ .byte 0x12
+ .byte 0x$dwarf4_high_pc_form
+ .byte 0x10
+ .byte 0x17
+ .byte 0
+ .byte 0
+ .byte 0x2
+ .byte 0x2e
+ .byte 0
+ .byte 0x3f
+ .byte 0x19
+ .byte 0x3
+ .byte 0x8
+ .byte 0x3a
+ .byte 0xb
+ .byte 0x3b
+ .byte 0xb
+ .byte 0x39
+ .byte 0xb
+ .byte 0x11
+ .byte 0x1
+ .byte 0x12
+ .byte 0x$dwarf4_high_pc_form
+ .byte 0x40
+ .byte 0x18
+ .byte 0
+ .byte 0
+ .byte 0
+ .section .debug_aranges,\"\",%progbits
+ .4byte $dwarf4_debug_aranges_size
+ .2byte 0x2
+ .4byte .Ldebug_info0
+ .byte 0x8
+ .byte 0
+ .2byte 0
+ .2byte 0
+ .${dwarf4_addr_size}byte .Ltext0
+ .${dwarf4_addr_size}byte .Letext0-.Ltext0
+ .${dwarf4_addr_size}byte 0
+ .${dwarf4_addr_size}byte 0
+ .section .debug_line,\"\",%progbits
+.Ldebug_line0:
+ .4byte .LELT0-.LSLT0
+.LSLT0:
+ .2byte 0x4
+ .4byte .LELTP0-.LASLTP0
+.LASLTP0:
+ .byte 0x1
+ .byte 0x1
+ .byte 0x1
+ .byte 0xf6
+ .byte 0xf2
+ .byte 0xd
+ .byte 0
+ .byte 0x1
+ .byte 0x1
+ .byte 0x1
+ .byte 0x1
+ .byte 0
+ .byte 0
+ .byte 0
+ .byte 0x1
+ .byte 0
+ .byte 0
+ .byte 0x1
+ .byte 0
+ .ascii \"a.c\\0\"
+ .byte 0
+ .byte 0
+ .byte 0
+ .byte 0
+.LELTP0:
+ .byte 0
+ .byte 0x$dwarf4_line_sz
+ .byte 0x2
+ .${dwarf4_addr_size}byte .LM1
+ .byte 0x18
+ .byte 0x5
+ .byte 0x1
+ .byte 0
+ .byte 0x$dwarf4_line_sz
+ .byte 0x2
+ .${dwarf4_addr_size}byte .LM2
+ .byte 0x1
+ .byte 0x5
+ .byte 0x1
+ .byte 0
+ .byte 0x$dwarf4_line_sz
+ .byte 0x2
+ .${dwarf4_addr_size}byte .Letext0
+ .byte 0
+ .byte 0x1
+ .byte 0x1
+.LELT0:
+ .section .debug_str,\"\",%progbits
+ .ident \"GCC\"
+"
+ dwarf4_success=no
+ if test $dwarf4_addr_size = 4; then
+ gcc_GAS_CHECK_FEATURE([assembly of compiler generated 32-bit .debug_line],
+ gcc_cv_as_debug_line_32_flag,
+ [elf,2,36,0], [], [$conftest_s],,
+ [success=yes])
+ else
+ gcc_GAS_CHECK_FEATURE([assembly of compiler generated 64-bit .debug_line],
+ gcc_cv_as_debug_line_64_flag,
+ [elf,2,36,0], [], [$conftest_s],,
+ [dwarf4_success=yes])
+ fi
+ if test $dwarf4_success = yes; then
+ gcc_GAS_CHECK_FEATURE([--gdwarf-4 not refusing compiler generated .debug_line],
+ gcc_cv_as_dwarf_4_debug_line_flag,
+ [elf,2,36,0], [--gdwarf-4], [$conftest_s],,
+ [AC_DEFINE(HAVE_AS_WORKING_DWARF_4_FLAG, 1,
+[Define if your assembler supports --gdwarf-4 even with compiler generated .debug_line])])
+ break
+ fi
+ dwarf4_debug_info_size=0x36
+ dwarf4_high_pc_form=6
+ dwarf4_debug_aranges_size=0x1c
+ dwarf4_line_sz=5
+ done
+
gcc_GAS_CHECK_FEATURE([--gstabs option],
gcc_cv_as_gstabs_flag,
[elf,2,11,0], [--gstabs], [$insn],,
static const char *dumps_spec_func (int, const char **);
static const char *greater_than_spec_func (int, const char **);
static const char *debug_level_greater_than_spec_func (int, const char **);
+static const char *dwarf_version_greater_than_spec_func (int, const char **);
static const char *find_fortran_preinclude_file (int, const char **);
static char *convert_white_space (char *);
static char *quote_spec (char *);
#endif /* HAVE_LD_COMPRESS_DEBUG >= 2 */
/* Define ASM_DEBUG_SPEC to be a spec suitable for translating '-g'
- to the assembler. */
+ to the assembler, when compiling assembly sources only. */
#ifndef ASM_DEBUG_SPEC
+# if defined(HAVE_AS_GDWARF_5_DEBUG_FLAG) && defined(HAVE_AS_WORKING_DWARF_4_FLAG)
+/* If --gdwarf-N is supported and as can handle even compiler generated
+ .debug_line with it, supply --gdwarf-N in ASM_DEBUG_OPTION_SPEC rather
+ than in ASM_DEBUG_SPEC, so that it applies to both .s and .c etc.
+ compilations. */
+# define ASM_DEBUG_DWARF_OPTION ""
+# elif defined(HAVE_AS_GDWARF_5_DEBUG_FLAG)
+# define ASM_DEBUG_DWARF_OPTION "%{%:dwarf-version-gt(4):--gdwarf-5;" \
+ "%:dwarf-version-gt(3):--gdwarf-4;" \
+ "%:dwarf-version-gt(2):--gdwarf-3;" \
+ ":--gdwarf2}"
+# else
+# define ASM_DEBUG_DWARF_OPTION "--gdwarf2"
+# endif
# if defined(DBX_DEBUGGING_INFO) && defined(DWARF2_DEBUGGING_INFO) \
&& defined(HAVE_AS_GDWARF2_DEBUG_FLAG) && defined(HAVE_AS_GSTABS_DEBUG_FLAG)
# define ASM_DEBUG_SPEC \
(PREFERRED_DEBUGGING_TYPE == DBX_DEBUG \
? "%{%:debug-level-gt(0):" \
- "%{gdwarf*:--gdwarf2}%{!gdwarf*:%{g*:--gstabs}}}" ASM_MAP \
+ "%{gdwarf*:" ASM_DEBUG_DWARF_OPTION "};" \
+ ":%{g*:--gstabs}}" ASM_MAP \
: "%{%:debug-level-gt(0):" \
- "%{gstabs*:--gstabs}%{!gstabs*:%{g*:--gdwarf2}}}" ASM_MAP)
+ "%{gstabs*:--gstabs;" \
+ ":%{g*:" ASM_DEBUG_DWARF_OPTION "}}}" ASM_MAP)
# else
# if defined(DBX_DEBUGGING_INFO) && defined(HAVE_AS_GSTABS_DEBUG_FLAG)
# define ASM_DEBUG_SPEC "%{g*:%{%:debug-level-gt(0):--gstabs}}" ASM_MAP
# endif
# if defined(DWARF2_DEBUGGING_INFO) && defined(HAVE_AS_GDWARF2_DEBUG_FLAG)
-# define ASM_DEBUG_SPEC "%{g*:%{%:debug-level-gt(0):--gdwarf2}}" ASM_MAP
+# define ASM_DEBUG_SPEC "%{g*:%{%:debug-level-gt(0):" \
+ ASM_DEBUG_DWARF_OPTION "}}" ASM_MAP
# endif
# endif
#endif
# define ASM_DEBUG_SPEC ""
#endif
+/* Define ASM_DEBUG_OPTION_SPEC to be a spec suitable for translating '-g'
+ to the assembler when compiling all sources. */
+#ifndef ASM_DEBUG_OPTION_SPEC
+# if defined(HAVE_AS_GDWARF_5_DEBUG_FLAG) && defined(HAVE_AS_WORKING_DWARF_4_FLAG)
+# define ASM_DEBUG_OPTION_DWARF_OPT \
+ "%{%:dwarf-version-gt(4):--gdwarf-5 ;" \
+ "%:dwarf-version-gt(3):--gdwarf-4 ;" \
+ "%:dwarf-version-gt(2):--gdwarf-3 ;" \
+ ":--gdwarf2 }"
+# if defined(DBX_DEBUGGING_INFO) && defined(DWARF2_DEBUGGING_INFO)
+# define ASM_DEBUG_OPTION_SPEC \
+ (PREFERRED_DEBUGGING_TYPE == DBX_DEBUG \
+ ? "%{%:debug-level-gt(0):" \
+ "%{gdwarf*:" ASM_DEBUG_OPTION_DWARF_OPT "}}" \
+ : "%{%:debug-level-gt(0):" \
+ "%{!gstabs*:%{g*:" ASM_DEBUG_OPTION_DWARF_OPT "}}}")
+# elif defined(DWARF2_DEBUGGING_INFO)
+# define ASM_DEBUG_OPTION_SPEC "%{g*:%{%:debug-level-gt(0):" \
+ ASM_DEBUG_OPTION_DWARF_OPT "}}"
+# endif
+# endif
+#endif
+#ifndef ASM_DEBUG_OPTION_SPEC
+# define ASM_DEBUG_OPTION_SPEC ""
+#endif
+
/* Here is the spec for running the linker, after compiling all files. */
/* This is overridable by the target in case they need to specify the
#endif
static const char *asm_debug = ASM_DEBUG_SPEC;
+static const char *asm_debug_option = ASM_DEBUG_OPTION_SPEC;
static const char *cpp_spec = CPP_SPEC;
static const char *cc1_spec = CC1_SPEC;
static const char *cc1plus_spec = CC1PLUS_SPEC;
to the assembler equivalents. */
"%{v} %{w:-W} %{I*} "
#endif
+"%(asm_debug_option)"
ASM_COMPRESS_DEBUG_SPEC
"%a %Y %{c:%W{o*}%{!o*:-o %w%b%O}}%{!c:-o %d%w%u%O}";
{
INIT_STATIC_SPEC ("asm", &asm_spec),
INIT_STATIC_SPEC ("asm_debug", &asm_debug),
+ INIT_STATIC_SPEC ("asm_debug_option", &asm_debug_option),
INIT_STATIC_SPEC ("asm_final", &asm_final_spec),
INIT_STATIC_SPEC ("asm_options", &asm_options),
INIT_STATIC_SPEC ("invoke_as", &invoke_as),
{ "dumps", dumps_spec_func },
{ "gt", greater_than_spec_func },
{ "debug-level-gt", debug_level_greater_than_spec_func },
+ { "dwarf-version-gt", dwarf_version_greater_than_spec_func },
{ "fortran-preinclude-file", find_fortran_preinclude_file},
#ifdef EXTRA_SPEC_FUNCTIONS
EXTRA_SPEC_FUNCTIONS
return NULL;
}
+/* Returns "" if dwarf_version is greater than ARGV[ARGC-1].
+ Otherwise, return NULL. */
+
+static const char *
+dwarf_version_greater_than_spec_func (int argc, const char **argv)
+{
+ char *converted;
+
+ if (argc != 1)
+ fatal_error (input_location,
+ "wrong number of arguments to %%:dwarf-version-gt");
+
+ long arg = strtol (argv[0], &converted, 10);
+ gcc_assert (converted != argv[0]);
+
+ if (dwarf_version > arg)
+ return "";
+
+ return NULL;
+}
+
static void
path_prefix_reset (path_prefix *prefix)
{