aboutsummaryrefslogtreecommitdiff
path: root/gcc/gcc.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2001-11-27 23:53:09 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2001-11-27 23:53:09 +0100
commit8a63621fe525f28c16a490a51f976165a0009784 (patch)
tree7054f4c69941b6f5305fa806c6e2bd79c96452b7 /gcc/gcc.c
parent98741ec369ebe78d12f2a6f0a2a9a3fa14ac28f3 (diff)
downloadgcc-8a63621fe525f28c16a490a51f976165a0009784.zip
gcc-8a63621fe525f28c16a490a51f976165a0009784.tar.gz
gcc-8a63621fe525f28c16a490a51f976165a0009784.tar.bz2
gcc.c (ASM_DEBUG_SPEC): Use conditional expression rather than preprocessor define.
* gcc.c (ASM_DEBUG_SPEC): Use conditional expression rather than preprocessor define. If only DBX_DEBUGGING_INFO or only DWARF2_DEBUGGING_INFO is supported for the target, provide appropriate definitions. From-SVN: r47390
Diffstat (limited to 'gcc/gcc.c')
-rw-r--r--gcc/gcc.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/gcc/gcc.c b/gcc/gcc.c
index 7a5cad2..ea7aa1c 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -80,6 +80,7 @@ compilation is specified by a string called a "spec". */
#include "intl.h"
#include "prefix.h"
#include "gcc.h"
+#include "flags.h"
#ifdef HAVE_SYS_RESOURCE_H
#include <sys/resource.h>
@@ -590,15 +591,24 @@ proper position among the other output files. */
to the assembler. */
#ifndef ASM_DEBUG_SPEC
# if defined(HAVE_AS_GDWARF2_DEBUG_FLAG) && defined(HAVE_AS_GSTABS_DEBUG_FLAG)
-# if PREFERRED_DEBUGGING_TYPE == DBX_DEBUG
-# define ASM_DEBUG_SPEC "%{gdwarf-2*:--gdwarf2}%{!gdwarf-2*:%{g*:--gstabs}}"
+# if defined(DBX_DEBUGGING_INFO) && defined(DWARF2_DEBUGGING_INFO)
+# define ASM_DEBUG_SPEC \
+ (PREFERRED_DEBUGGING_TYPE == DBX_DEBUG \
+ ? "%{gdwarf-2*:--gdwarf2}%{!gdwarf-2*:%{g*:--gstabs}}" \
+ : "%{gstabs*:--gstabs}%{!gstabs*:%{g*:--gdwarf2}}")
# else
-# define ASM_DEBUG_SPEC "%{gstabs*:--gstabs}%{!gstabs*:%{g*:--gdwarf2}}"
+# ifdef DBX_DEBUGGING_INFO
+# define ASM_DEBUG_SPEC "%{g*:--gstabs}"
+# endif
+# ifdef DWARF2_DEBUGGING_INFO
+# define ASM_DEBUG_SPEC "%{g*:--gdwarf2}"
+# endif
# endif
-# else
-# define ASM_DEBUG_SPEC ""
# endif
#endif
+#ifndef ASM_DEBUG_SPEC
+# define ASM_DEBUG_SPEC ""
+#endif
/* Here is the spec for running the linker, after compiling all files. */