]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gcc.c (ASM_DEBUG_SPEC): Use conditional expression rather than preprocessor define.
authorJakub Jelinek <jakub@redhat.com>
Tue, 27 Nov 2001 22:53:09 +0000 (23:53 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Tue, 27 Nov 2001 22:53:09 +0000 (23:53 +0100)
* 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

gcc/ChangeLog
gcc/gcc.c

index f69310c188636d6bebc104655e874b20f44e5e00..23ff6089d59ae97644597d3c06ff7ab1dd6d8946 100644 (file)
@@ -1,3 +1,10 @@
+2001-11-27  Jakub Jelinek  <jakub@redhat.com>
+
+       * 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.
+
 2001-11-27  Neil Booth  <neil@daikokuya.demon.co.uk>
 
        * Makefile.in: Update, and add c-objc-common.o dependencies.
index 7a5cad2a7a72c4ca47eb32982b1749cb3023c7ce..ea7aa1c6a01c621d5be06ce3fd7cc141b8d4c05b 100644 (file)
--- 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.  */