From: Richard Henderson Date: Fri, 17 Nov 2000 23:53:38 +0000 (-0800) Subject: configure.in (HAVE_AS_DWARF2_DEBUG_LINE): New. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=9d1470857bd6726bc7f3613d79dcf9113da36283;p=gcc.git configure.in (HAVE_AS_DWARF2_DEBUG_LINE): New. * configure.in (HAVE_AS_DWARF2_DEBUG_LINE): New. Detect whether as accepts .file/.loc and produces dwarf2 line info. * dwarf2out.c (DWARF2_ASM_LINE_DEBUG_INFO): Default on if the assembler supports it. * config.in, configure: Regenerate. From-SVN: r37534 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 926100e95fc..1c5978c0338 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2000-11-17 Richard Henderson + + * configure.in (HAVE_AS_DWARF2_DEBUG_LINE): New. Detect + whether as accepts .file/.loc and produces dwarf2 line info. + * dwarf2out.c (DWARF2_ASM_LINE_DEBUG_INFO): Default on if + the assembler supports it. + * config.in, configure: Regenerate. + 2000-11-17 Richard Henderson * fixinc/mkfixinc.sh: Don't disable fixincludes for any linux*. diff --git a/gcc/config.in b/gcc/config.in index 4ad8f149010..c710b1760d6 100644 --- a/gcc/config.in +++ b/gcc/config.in @@ -443,6 +443,9 @@ /* Define if your assembler supports offsetable %lo(). */ #undef HAVE_AS_OFFSETABLE_LO10 +/* Define if your assembler supports dwarf2 .file/.loc directives. */ +#undef HAVE_AS_DWARF2_DEBUG_LINE + /* Define if you want to always select the new-abi for g++. */ #undef ENABLE_NEW_GXX_ABI diff --git a/gcc/configure b/gcc/configure index dd9509c89de..2b93377595b 100755 --- a/gcc/configure +++ b/gcc/configure @@ -5851,7 +5851,7 @@ echo "$ac_t""$gcc_cv_nm" 1>&6 # Figure out what assembler alignment features are present. echo $ac_n "checking assembler alignment features""... $ac_c" 1>&6 echo "configure:5854: checking assembler alignment features" >&5 -gcc_cv_as_alignment_features= +gcc_cv_as_alignment_features=none if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x; then # Gas version 2.6 and later support for .balign and .p2align. # bytes to skip when using .p2align. @@ -5899,7 +5899,7 @@ echo "$ac_t""$gcc_cv_as_alignment_features" 1>&6 echo $ac_n "checking assembler subsection support""... $ac_c" 1>&6 echo "configure:5902: checking assembler subsection support" >&5 -gcc_cv_as_subsections= +gcc_cv_as_subsections=no if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x; then if test "$gcc_cv_gas_major_version" -eq 2 -a "$gcc_cv_gas_minor_version" -ge 9 -o "$gcc_cv_gas_major_version" -gt 2 && grep 'obj_format = elf' ../gas/Makefile > /dev/null; then gcc_cv_as_subsections="working .subsection -1" @@ -5939,7 +5939,7 @@ echo "$ac_t""$gcc_cv_as_subsections" 1>&6 echo $ac_n "checking assembler weak support""... $ac_c" 1>&6 echo "configure:5942: checking assembler weak support" >&5 -gcc_cv_as_weak= +gcc_cv_as_weak=no if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x; then if test "$gcc_cv_gas_major_version" -eq 2 -a "$gcc_cv_gas_minor_version" -ge 2 -o "$gcc_cv_gas_major_version" -gt 2; then gcc_cv_as_weak="yes" @@ -5962,7 +5962,7 @@ echo "$ac_t""$gcc_cv_as_weak" 1>&6 echo $ac_n "checking assembler hidden support""... $ac_c" 1>&6 echo "configure:5965: checking assembler hidden support" >&5 -gcc_cv_as_hidden= +gcc_cv_as_hidden=no if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x; then if test "$gcc_cv_gas_major_version" -eq 2 -a "$gcc_cv_gas_minor_version" -ge 10 -o "$gcc_cv_gas_major_version" -gt 2 && grep 'obj_format = elf' ../gas/Makefile > /dev/null; then gcc_cv_as_hidden="yes" @@ -6157,6 +6157,50 @@ EOF ;; esac +echo $ac_n "checking assembler dwarf2 debug_line support""... $ac_c" 1>&6 +echo "configure:6162: checking assembler dwarf2 debug_line support" >&5 +gcc_cv_as_dwarf2_debug_line=no +# ??? Not all targets support dwarf2 debug_line, even within a version +# of gas. Moreover, we need to emit a valid instruction to trigger any +# info to the output file. So, as supported targets are added to gas 2.11, +# add some instruction here to (also) show we expect this might work. +# ??? Once 2.11 is released, probably need to add first known working +# version to the per-target configury. +case "$target" in + i?86*-*-* | mips*-*-* | alpha*-*-*) + insn="nop" + ;; + ia64*-*-*) + insn="nop 0" + ;; + esac +if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x; +then + if test "$gcc_cv_gas_major_version" -eq 2 \ + -a "$gcc_cv_gas_minor_version" -ge 11 \ + -o "$gcc_cv_gas_major_version" -gt 2 \ + && grep 'obj_format = elf' ../gas/Makefile > /dev/null \ + && test x"$insn" != x ; then + gcc_cv_as_dwarf2_debug_line="yes" + fi +elif test x$gcc_cv_as != x -a x"$insn" != x ; then + echo ' .file 0 "conftest.s"' > conftest.s + echo ' .loc 0 3 0' >> conftest.s + echo " $insn" >> conftest.s + if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1 \ + && grep debug_line conftest.o > /dev/null 2>&1 ; then + gcc_cv_as_dwarf2_debug_line="yes" + fi + rm -f conftest.s conftest.o conftest.nm1 conftest.nm2 +fi +if test x"$gcc_cv_as_dwarf2_debug_line" = xyes; then + cat >> confdefs.h <<\EOF +#define HAVE_AS_DWARF2_DEBUG_LINE 1 +EOF + +fi +echo "$ac_t""$gcc_cv_as_dwarf2_debug_line" 1>&6 + # Figure out what language subdirectories are present. # Look if the user specified --enable-languages="..."; if not, use # the environment variable $LANGUAGES if defined. $LANGUAGES might @@ -6285,7 +6329,7 @@ EOF echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6 -echo "configure:6289: checking whether to enable maintainer-specific portions of Makefiles" >&5 +echo "configure:6333: checking whether to enable maintainer-specific portions of Makefiles" >&5 # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. if test "${enable_maintainer_mode+set}" = set; then enableval="$enable_maintainer_mode" diff --git a/gcc/configure.in b/gcc/configure.in index 9f404895a49..0dae0e046c7 100644 --- a/gcc/configure.in +++ b/gcc/configure.in @@ -1210,7 +1210,7 @@ AC_MSG_RESULT($gcc_cv_nm) # Figure out what assembler alignment features are present. AC_MSG_CHECKING(assembler alignment features) -gcc_cv_as_alignment_features= +gcc_cv_as_alignment_features=none if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x; then # Gas version 2.6 and later support for .balign and .p2align. # bytes to skip when using .p2align. @@ -1245,7 +1245,7 @@ fi AC_MSG_RESULT($gcc_cv_as_alignment_features) AC_MSG_CHECKING(assembler subsection support) -gcc_cv_as_subsections= +gcc_cv_as_subsections=no if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x; then if test "$gcc_cv_gas_major_version" -eq 2 -a "$gcc_cv_gas_minor_version" -ge 9 -o "$gcc_cv_gas_major_version" -gt 2 && grep 'obj_format = elf' ../gas/Makefile > /dev/null; then gcc_cv_as_subsections="working .subsection -1" @@ -1283,7 +1283,7 @@ fi AC_MSG_RESULT($gcc_cv_as_subsections) AC_MSG_CHECKING(assembler weak support) -gcc_cv_as_weak= +gcc_cv_as_weak=no if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x; then if test "$gcc_cv_gas_major_version" -eq 2 -a "$gcc_cv_gas_minor_version" -ge 2 -o "$gcc_cv_gas_major_version" -gt 2; then gcc_cv_as_weak="yes" @@ -1302,7 +1302,7 @@ fi AC_MSG_RESULT($gcc_cv_as_weak) AC_MSG_CHECKING(assembler hidden support) -gcc_cv_as_hidden= +gcc_cv_as_hidden=no if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x; then if test "$gcc_cv_gas_major_version" -eq 2 -a "$gcc_cv_gas_minor_version" -ge 10 -o "$gcc_cv_gas_major_version" -gt 2 && grep 'obj_format = elf' ../gas/Makefile > /dev/null; then gcc_cv_as_hidden="yes" @@ -1457,6 +1457,47 @@ changequote([,])dnl ;; esac +AC_MSG_CHECKING(assembler dwarf2 debug_line support) +gcc_cv_as_dwarf2_debug_line=no +# ??? Not all targets support dwarf2 debug_line, even within a version +# of gas. Moreover, we need to emit a valid instruction to trigger any +# info to the output file. So, as supported targets are added to gas 2.11, +# add some instruction here to (also) show we expect this might work. +# ??? Once 2.11 is released, probably need to add first known working +# version to the per-target configury. +case "$target" in + i?86*-*-* | mips*-*-* | alpha*-*-*) + insn="nop" + ;; + ia64*-*-*) + insn="nop 0" + ;; + esac +if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x; +then + if test "$gcc_cv_gas_major_version" -eq 2 \ + -a "$gcc_cv_gas_minor_version" -ge 11 \ + -o "$gcc_cv_gas_major_version" -gt 2 \ + && grep 'obj_format = elf' ../gas/Makefile > /dev/null \ + && test x"$insn" != x ; then + gcc_cv_as_dwarf2_debug_line="yes" + fi +elif test x$gcc_cv_as != x -a x"$insn" != x ; then + echo ' .file 0 "conftest.s"' > conftest.s + echo ' .loc 0 3 0' >> conftest.s + echo " $insn" >> conftest.s + if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1 \ + && grep debug_line conftest.o > /dev/null 2>&1 ; then + gcc_cv_as_dwarf2_debug_line="yes" + fi + rm -f conftest.s conftest.o conftest.nm1 conftest.nm2 +fi +if test x"$gcc_cv_as_dwarf2_debug_line" = xyes; then + AC_DEFINE(HAVE_AS_DWARF2_DEBUG_LINE, 1, + [Define if your assembler supports dwarf2 .file/.loc directives.]) +fi +AC_MSG_RESULT($gcc_cv_as_dwarf2_debug_line) + # Figure out what language subdirectories are present. # Look if the user specified --enable-languages="..."; if not, use # the environment variable $LANGUAGES if defined. $LANGUAGES might diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index a96c01dad48..dba01479894 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -3127,10 +3127,14 @@ extern int flag_traditional; (DWARF_ROUND (2 * DWARF_OFFSET_SIZE + 4, DWARF2_ADDR_SIZE * 2) \ - (2 * DWARF_OFFSET_SIZE + 4)) -/* The default is to have gcc emit the line number tables. */ +/* Use assembler line directives if available. */ #ifndef DWARF2_ASM_LINE_DEBUG_INFO +#ifdef HAVE_AS_DWARF2_DEBUG_LINE +#define DWARF2_ASM_LINE_DEBUG_INFO 1 +#else #define DWARF2_ASM_LINE_DEBUG_INFO 0 #endif +#endif /* Define the architecture-dependent minimum instruction length (in bytes). In this implementation of DWARF, this field is used for information