aboutsummaryrefslogtreecommitdiff
path: root/gcc/gcc.c
diff options
context:
space:
mode:
authorGeoffrey Keating <geoffk@redhat.com>2001-11-20 10:16:09 +0000
committerGeoffrey Keating <geoffk@gcc.gnu.org>2001-11-20 10:16:09 +0000
commit5f0e9ea2789c1f2c3e28497a906857c3ba89564a (patch)
treefd1b1fc0714cb784db75a1235b1bd95e97dfc4a7 /gcc/gcc.c
parent2d2e8123b5928675f46e2628e7cac9c13875d2cd (diff)
downloadgcc-5f0e9ea2789c1f2c3e28497a906857c3ba89564a.zip
gcc-5f0e9ea2789c1f2c3e28497a906857c3ba89564a.tar.gz
gcc-5f0e9ea2789c1f2c3e28497a906857c3ba89564a.tar.bz2
configure.in (HAVE_AS_GDWARF2_DEBUG_FLAG): Define.
* configure.in (HAVE_AS_GDWARF2_DEBUG_FLAG): Define. (HAVE_AS_GSTABS_DEBUG_FLAG): Define. * configure: Regenerate. * config.in: Add dummy definitions of new flags. * toplev.c (PREFERRED_DEBUGGING_TYPE): Move definition to... * defaults.h (PREFERRED_DEBUGGING_TYPE): ... here. * gcc.c (ASM_DEBUG_SPEC): New macro. (asm_debug): New static variable. (default_compilers): Add asm_debug when assembling from user input. (static_specs): Add asm_debug. From-SVN: r47210
Diffstat (limited to 'gcc/gcc.c')
-rw-r--r--gcc/gcc.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/gcc/gcc.c b/gcc/gcc.c
index fc9ee62..62ff7d0 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -586,6 +586,20 @@ proper position among the other output files. */
#define LINKER_NAME "collect2"
#endif
+/* Define ASM_DEBUG_SPEC to be a spec suitable for translating '-g'
+ to the assembler. */
+#ifndef ASM_DEBUG_SPEC
+# if defined(HAVE_AS_GDWARF2_DEBUG_FLAG) && defined(HAVE_AS_GSTABS_DEBUG_FLAG)
+# if PREFERRED_DEBUGGING_FORMAT == DBX_DEBUG
+# define ASM_DEBUG_SPEC "%{gdwarf-2*:--gdwarf2}%{!gdwarf-2*:%{g*:--gstabs}}"
+# else
+# define ASM_DEBUG_SPEC "%{gstabs*:--gstabs}%{!gstabs*:%{g*:--gdwarf2}}"
+# endif
+# else
+# define ASM_DEBUG_SPEC ""
+# endif
+#endif
+
/* Here is the spec for running the linker, after compiling all files. */
/* -u* was put back because both BSD and SysV seem to support it. */
@@ -613,6 +627,7 @@ proper position among the other output files. */
# endif
#endif
+static const char *asm_debug = ASM_DEBUG_SPEC;
static const char *cpp_spec = CPP_SPEC;
static const char *cpp_predefines = CPP_PREDEFINES;
static const char *cc1_spec = CC1_SPEC;
@@ -820,11 +835,12 @@ static struct compiler default_compilers[] =
"%{!M:%{!MM:%{!E:cc1 -fpreprocessed %i %(cc1_options) %{!fsyntax-only:%(invoke_as)}}}}", 0},
{".s", "@assembler", 0},
{"@assembler",
- "%{!M:%{!MM:%{!E:%{!S:as %(asm_options) %i %A }}}}", 0},
+ "%{!M:%{!MM:%{!E:%{!S:as %(asm_debug) %(asm_options) %i %A }}}}", 0},
{".S", "@assembler-with-cpp", 0},
{"@assembler-with-cpp",
"%(trad_capable_cpp) -lang-asm %(cpp_options)\
- %{!M:%{!MM:%{!E:%(invoke_as)}}}", 0},
+ %{!M:%{!MM:%{!E:%{!S:-o %{|!pipe:%g.s} |\n\
+ as %(asm_debug) %(asm_options) %{!pipe:%g.s} %A }}}}", 0},
#include "specs.h"
/* Mark end of table */
{0, 0, 0}
@@ -1327,6 +1343,7 @@ struct spec_list
static struct spec_list static_specs[] =
{
INIT_STATIC_SPEC ("asm", &asm_spec),
+ INIT_STATIC_SPEC ("asm_debug", &asm_debug),
INIT_STATIC_SPEC ("asm_final", &asm_final_spec),
INIT_STATIC_SPEC ("asm_options", &asm_options),
INIT_STATIC_SPEC ("invoke_as", &invoke_as),