https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102255

            Bug ID: 102255
           Summary: target uses STABS by default
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: rguenth at gcc dot gnu.org
  Target Milestone: ---

The STABS debugging format is supposed to be deprecated for GCC 12 but these
targets still default to it from config.gcc including dbxcoff.h:

i[34567]86-*-cygwin*
x86_64-*-cygwin*
i[34567]86-*-mingw* | x86_64-*-mingw*

the configs include i386/cygming.h as well override that with DWARF when

#if TARGET_64BIT_DEFAULT || defined (HAVE_GAS_PE_SECREL32_RELOC)

the HAVE_GAS_PE_SECREL32_RELOC define/check is from 2004 it seems that's
old enough to require.  In fact install.texi suggests 2.20 is the minimal
supported version for cygwin, mingw does not document any required version.

I'm inclined to

diff --git a/gcc/config/dbxcoff.h b/gcc/config/dbxcoff.h
index d491cff961f..bd705f93711 100644
--- a/gcc/config/dbxcoff.h
+++ b/gcc/config/dbxcoff.h
@@ -25,12 +25,6 @@ along with GCC; see the file COPYING3.  If not see

 #define DBX_DEBUGGING_INFO 1

-/* Generate DBX debugging information by default.  */
-
-#ifndef PREFERRED_DEBUGGING_TYPE
-#define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
-#endif
-
 /* Be function-relative for block and source line stab directives.  */

 #define DBX_BLOCKS_FUNCTION_RELATIVE 1
diff --git a/gcc/config/i386/cygming.h b/gcc/config/i386/cygming.h
index ac458cdfee1..e2d759a7572 100644
--- a/gcc/config/i386/cygming.h
+++ b/gcc/config/i386/cygming.h
@@ -27,7 +27,7 @@ along with GCC; see the file COPYING3.  If not see
 #if (DWARF2_DEBUGGING_INFO)
 #define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG
 #else
-#define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
+#define PREFERRED_DEBUGGING_TYPE NO_DEBUG
 #endif

 #undef TARGET_SEH

Reply via email to