public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Always default to DWARF2_DEBUG if not specified, warn about deprecated STABS
@ 2021-09-21 14:25 Richard Biener
  2021-09-28  6:14 ` Richard Biener
                   ` (2 more replies)
  0 siblings, 3 replies; 19+ messages in thread
From: Richard Biener @ 2021-09-21 14:25 UTC (permalink / raw)
  To: gcc-patches

This makes defaults.h choose DWARF2_DEBUG if PREFERRED_DEBUGGING_TYPE
is not specified by the target and errors out if DWARF DWARF is not supported.

It also makes us warn when STABS is enabled but not the preferred
debugging type and removes the corresponding diagnostic from the Ada frontend.
The warnings are pruned from the testsuite output via prune_gcc_output.

The following target configurations now explicitely default to STABS:
 pdp11-*-*   pdp11 is a.out, dwarf support is difficult
 hppa[12]*-*-hpux10*  does not support DWARF
 hppa[12]*-*-hpux11*  likewise
note that the hppa configs have been deprecated.

Targets with DWARF support will now see
> ./cc1 -quiet t.c -gstabs
t.c: warning: STABS debugging information is obsolete and not supported anymore

that is, -gstabs will still generate STABS but use will be diagnosed
on targets where DWARF is available.

I have built all targets from contrib/config-list.mk to make sure we
don't run into the #error and the following makes the STABS usage
explicit for pdp11 and hppa with SOM.

This completes the series of deprecating STABS for GCC 12.

Bootstrapped and tested on x86_64-unknown-linux-gnu.

OK for trunk?

Thanks,
Richard.

2021-09-21  Richard Biener  <rguenther@suse.de>

gcc/
	* defaults.h (PREFERRED_DEBUGGING_TYPE): Choose DWARF2_DEBUG
	when not set.
	* toplev.c (process_options): Warn when STABS debugging is
	enabled but not the preferred format.
	* config/pa/som.h (PREFERRED_DEBUGGING_TYPE): Define to
	DBX_DEBUG.
	* config/pdp11/pdp11.h (PREFERRED_DEBUGGING_TYPE): Likewise.

gcc/ada/
	* gcc-interface/misc.c (gnat_post_options): Do not warn
	about DBX_DEBUG use here.

gcc/testsuite/
	* lib/prune.exp: Prune STABS obsoletion message.
---
 gcc/ada/gcc-interface/misc.c |  6 ------
 gcc/config/pa/som.h          |  4 ++++
 gcc/config/pdp11/pdp11.h     |  3 +++
 gcc/defaults.h               | 29 +++++------------------------
 gcc/testsuite/lib/prune.exp  |  3 +++
 gcc/toplev.c                 |  5 +++++
 6 files changed, 20 insertions(+), 30 deletions(-)

diff --git a/gcc/ada/gcc-interface/misc.c b/gcc/ada/gcc-interface/misc.c
index 96199bd4b63..87a4c8662cb 100644
--- a/gcc/ada/gcc-interface/misc.c
+++ b/gcc/ada/gcc-interface/misc.c
@@ -274,12 +274,6 @@ gnat_post_options (const char **pfilename ATTRIBUTE_UNUSED)
   if (!global_options_set.x_flag_diagnostics_show_caret)
     global_dc->show_caret = false;
 
-  /* Warn only if STABS is not the default: we don't want to emit a warning if
-     the user did not use a -gstabs option.  */
-  if (PREFERRED_DEBUGGING_TYPE != DBX_DEBUG && write_symbols == DBX_DEBUG)
-    warning (0, "STABS debugging information for Ada is obsolete and not "
-		"supported anymore");
-
   /* Copy global settings to local versions.  */
   gnat_encodings = global_options.x_gnat_encodings;
   optimize = global_options.x_optimize;
diff --git a/gcc/config/pa/som.h b/gcc/config/pa/som.h
index 05cc315b9f9..36a1122b132 100644
--- a/gcc/config/pa/som.h
+++ b/gcc/config/pa/som.h
@@ -21,6 +21,10 @@ along with GCC; see the file COPYING3.  If not see
 #undef TARGET_SOM
 #define TARGET_SOM 1
 
+/* With SOM we can only do STABS.  */
+#undef PREFERRED_DEBUGGING_TYPE
+#define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
+
 /* We do not use BINCL stabs in SOM.
    ??? If it does not hurt, we probably should to avoid useless divergence
    from other embedded stabs implementations.  */
diff --git a/gcc/config/pdp11/pdp11.h b/gcc/config/pdp11/pdp11.h
index 9bc5e089f49..91a8ce70751 100644
--- a/gcc/config/pdp11/pdp11.h
+++ b/gcc/config/pdp11/pdp11.h
@@ -54,6 +54,9 @@ along with GCC; see the file COPYING3.  If not see
 
 #define DBX_DEBUGGING_INFO
 
+#undef PREFERRED_DEBUGGING_TYPE
+#define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
+
 #define TARGET_40_PLUS		(TARGET_40 || TARGET_45)
 #define TARGET_10		(! TARGET_40_PLUS)
 
diff --git a/gcc/defaults.h b/gcc/defaults.h
index ba79a8e48ed..d7f2546f2cc 100644
--- a/gcc/defaults.h
+++ b/gcc/defaults.h
@@ -900,33 +900,14 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 #define DEFAULT_GDB_EXTENSIONS 1
 #endif
 
-/* If more than one debugging type is supported, you must define
-   PREFERRED_DEBUGGING_TYPE to choose the default.  */
-
-#if 1 < (defined (DBX_DEBUGGING_INFO) \
-         + defined (DWARF2_DEBUGGING_INFO) + defined (XCOFF_DEBUGGING_INFO) \
-         + defined (VMS_DEBUGGING_INFO))
+/* Default to DWARF2_DEBUGGING_INFO.  Legacy targets can choose different
+   by defining PREFERRED_DEBUGGING_TYPE.  */
 #ifndef PREFERRED_DEBUGGING_TYPE
-#error You must define PREFERRED_DEBUGGING_TYPE
-#endif /* no PREFERRED_DEBUGGING_TYPE */
-
-/* If only one debugging format is supported, define PREFERRED_DEBUGGING_TYPE
-   here so other code needn't care.  */
-#elif defined DBX_DEBUGGING_INFO
-#define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
-
-#elif defined DWARF2_DEBUGGING_INFO || defined DWARF2_LINENO_DEBUGGING_INFO
+#if defined DWARF2_DEBUGGING_INFO || defined DWARF2_LINENO_DEBUGGING_INFO
 #define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG
-
-#elif defined VMS_DEBUGGING_INFO
-#define PREFERRED_DEBUGGING_TYPE VMS_AND_DWARF2_DEBUG
-
-#elif defined XCOFF_DEBUGGING_INFO
-#define PREFERRED_DEBUGGING_TYPE XCOFF_DEBUG
-
 #else
-/* No debugging format is supported by this target.  */
-#define PREFERRED_DEBUGGING_TYPE NO_DEBUG
+#error You must define PREFERRED_DEBUGGING_TYPE if DWARF is not supported
+#endif
 #endif
 
 #ifndef FLOAT_LIB_COMPARE_RETURNS_BOOL
diff --git a/gcc/testsuite/lib/prune.exp b/gcc/testsuite/lib/prune.exp
index fac212ecf60..131424861d5 100644
--- a/gcc/testsuite/lib/prune.exp
+++ b/gcc/testsuite/lib/prune.exp
@@ -93,6 +93,9 @@ proc prune_gcc_output { text } {
     # Ignore dsymutil warning (tool bug is actually linker)
     regsub -all "(^|\n)\[^\n\]*could not find object file symbol for symbol\[^\n\]*" $text "" text
 
+    # Ignore stabs obsoletion warnings
+    regsub -all "(^|\n)\[^\n\]*\[Ww\]arning: STABS debugging information is obsolete and not supported anymore\[^\n\]*" $text "" text
+
     # If dg-enable-nn-line-numbers was provided, then obscure source-margin
     # line numbers by converting them to "NN" form.
     set text [maybe-handle-nn-line-numbers $text]
diff --git a/gcc/toplev.c b/gcc/toplev.c
index 14d1335e79e..8de8a92f2c6 100644
--- a/gcc/toplev.c
+++ b/gcc/toplev.c
@@ -1452,6 +1452,11 @@ process_options (void)
       && ctf_debug_info_level == CTFINFO_LEVEL_NONE)
     write_symbols = NO_DEBUG;
 
+  /* Warn if STABS debug gets enabled and is not the default.  */
+  if (PREFERRED_DEBUGGING_TYPE != DBX_DEBUG && (write_symbols & DBX_DEBUG))
+    warning (0, "STABS debugging information is obsolete and not "
+	     "supported anymore");
+
   if (write_symbols == NO_DEBUG)
     ;
 #if defined(DBX_DEBUGGING_INFO)
-- 
2.31.1

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH] Always default to DWARF2_DEBUG if not specified, warn about deprecated STABS
  2021-09-21 14:25 [PATCH] Always default to DWARF2_DEBUG if not specified, warn about deprecated STABS Richard Biener
@ 2021-09-28  6:14 ` Richard Biener
  2021-09-28 13:18   ` Koning, Paul
  2021-10-23 20:00 ` Jan-Benedict Glaw
  2022-08-28  7:50 ` Jan-Benedict Glaw
  2 siblings, 1 reply; 19+ messages in thread
From: Richard Biener @ 2021-09-28  6:14 UTC (permalink / raw)
  To: Richard Biener; +Cc: GCC Patches

On Tue, Sep 21, 2021 at 4:26 PM Richard Biener via Gcc-patches
<gcc-patches@gcc.gnu.org> wrote:
>
> This makes defaults.h choose DWARF2_DEBUG if PREFERRED_DEBUGGING_TYPE
> is not specified by the target and errors out if DWARF DWARF is not supported.
>
> It also makes us warn when STABS is enabled but not the preferred
> debugging type and removes the corresponding diagnostic from the Ada frontend.
> The warnings are pruned from the testsuite output via prune_gcc_output.
>
> The following target configurations now explicitely default to STABS:
>  pdp11-*-*   pdp11 is a.out, dwarf support is difficult
>  hppa[12]*-*-hpux10*  does not support DWARF
>  hppa[12]*-*-hpux11*  likewise
> note that the hppa configs have been deprecated.
>
> Targets with DWARF support will now see
> > ./cc1 -quiet t.c -gstabs
> t.c: warning: STABS debugging information is obsolete and not supported anymore
>
> that is, -gstabs will still generate STABS but use will be diagnosed
> on targets where DWARF is available.
>
> I have built all targets from contrib/config-list.mk to make sure we
> don't run into the #error and the following makes the STABS usage
> explicit for pdp11 and hppa with SOM.
>
> This completes the series of deprecating STABS for GCC 12.
>
> Bootstrapped and tested on x86_64-unknown-linux-gnu.
>
> OK for trunk?

Ping.

> Thanks,
> Richard.
>
> 2021-09-21  Richard Biener  <rguenther@suse.de>
>
> gcc/
>         * defaults.h (PREFERRED_DEBUGGING_TYPE): Choose DWARF2_DEBUG
>         when not set.
>         * toplev.c (process_options): Warn when STABS debugging is
>         enabled but not the preferred format.
>         * config/pa/som.h (PREFERRED_DEBUGGING_TYPE): Define to
>         DBX_DEBUG.
>         * config/pdp11/pdp11.h (PREFERRED_DEBUGGING_TYPE): Likewise.
>
> gcc/ada/
>         * gcc-interface/misc.c (gnat_post_options): Do not warn
>         about DBX_DEBUG use here.
>
> gcc/testsuite/
>         * lib/prune.exp: Prune STABS obsoletion message.
> ---
>  gcc/ada/gcc-interface/misc.c |  6 ------
>  gcc/config/pa/som.h          |  4 ++++
>  gcc/config/pdp11/pdp11.h     |  3 +++
>  gcc/defaults.h               | 29 +++++------------------------
>  gcc/testsuite/lib/prune.exp  |  3 +++
>  gcc/toplev.c                 |  5 +++++
>  6 files changed, 20 insertions(+), 30 deletions(-)
>
> diff --git a/gcc/ada/gcc-interface/misc.c b/gcc/ada/gcc-interface/misc.c
> index 96199bd4b63..87a4c8662cb 100644
> --- a/gcc/ada/gcc-interface/misc.c
> +++ b/gcc/ada/gcc-interface/misc.c
> @@ -274,12 +274,6 @@ gnat_post_options (const char **pfilename ATTRIBUTE_UNUSED)
>    if (!global_options_set.x_flag_diagnostics_show_caret)
>      global_dc->show_caret = false;
>
> -  /* Warn only if STABS is not the default: we don't want to emit a warning if
> -     the user did not use a -gstabs option.  */
> -  if (PREFERRED_DEBUGGING_TYPE != DBX_DEBUG && write_symbols == DBX_DEBUG)
> -    warning (0, "STABS debugging information for Ada is obsolete and not "
> -               "supported anymore");
> -
>    /* Copy global settings to local versions.  */
>    gnat_encodings = global_options.x_gnat_encodings;
>    optimize = global_options.x_optimize;
> diff --git a/gcc/config/pa/som.h b/gcc/config/pa/som.h
> index 05cc315b9f9..36a1122b132 100644
> --- a/gcc/config/pa/som.h
> +++ b/gcc/config/pa/som.h
> @@ -21,6 +21,10 @@ along with GCC; see the file COPYING3.  If not see
>  #undef TARGET_SOM
>  #define TARGET_SOM 1
>
> +/* With SOM we can only do STABS.  */
> +#undef PREFERRED_DEBUGGING_TYPE
> +#define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
> +
>  /* We do not use BINCL stabs in SOM.
>     ??? If it does not hurt, we probably should to avoid useless divergence
>     from other embedded stabs implementations.  */
> diff --git a/gcc/config/pdp11/pdp11.h b/gcc/config/pdp11/pdp11.h
> index 9bc5e089f49..91a8ce70751 100644
> --- a/gcc/config/pdp11/pdp11.h
> +++ b/gcc/config/pdp11/pdp11.h
> @@ -54,6 +54,9 @@ along with GCC; see the file COPYING3.  If not see
>
>  #define DBX_DEBUGGING_INFO
>
> +#undef PREFERRED_DEBUGGING_TYPE
> +#define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
> +
>  #define TARGET_40_PLUS         (TARGET_40 || TARGET_45)
>  #define TARGET_10              (! TARGET_40_PLUS)
>
> diff --git a/gcc/defaults.h b/gcc/defaults.h
> index ba79a8e48ed..d7f2546f2cc 100644
> --- a/gcc/defaults.h
> +++ b/gcc/defaults.h
> @@ -900,33 +900,14 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
>  #define DEFAULT_GDB_EXTENSIONS 1
>  #endif
>
> -/* If more than one debugging type is supported, you must define
> -   PREFERRED_DEBUGGING_TYPE to choose the default.  */
> -
> -#if 1 < (defined (DBX_DEBUGGING_INFO) \
> -         + defined (DWARF2_DEBUGGING_INFO) + defined (XCOFF_DEBUGGING_INFO) \
> -         + defined (VMS_DEBUGGING_INFO))
> +/* Default to DWARF2_DEBUGGING_INFO.  Legacy targets can choose different
> +   by defining PREFERRED_DEBUGGING_TYPE.  */
>  #ifndef PREFERRED_DEBUGGING_TYPE
> -#error You must define PREFERRED_DEBUGGING_TYPE
> -#endif /* no PREFERRED_DEBUGGING_TYPE */
> -
> -/* If only one debugging format is supported, define PREFERRED_DEBUGGING_TYPE
> -   here so other code needn't care.  */
> -#elif defined DBX_DEBUGGING_INFO
> -#define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
> -
> -#elif defined DWARF2_DEBUGGING_INFO || defined DWARF2_LINENO_DEBUGGING_INFO
> +#if defined DWARF2_DEBUGGING_INFO || defined DWARF2_LINENO_DEBUGGING_INFO
>  #define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG
> -
> -#elif defined VMS_DEBUGGING_INFO
> -#define PREFERRED_DEBUGGING_TYPE VMS_AND_DWARF2_DEBUG
> -
> -#elif defined XCOFF_DEBUGGING_INFO
> -#define PREFERRED_DEBUGGING_TYPE XCOFF_DEBUG
> -
>  #else
> -/* No debugging format is supported by this target.  */
> -#define PREFERRED_DEBUGGING_TYPE NO_DEBUG
> +#error You must define PREFERRED_DEBUGGING_TYPE if DWARF is not supported
> +#endif
>  #endif
>
>  #ifndef FLOAT_LIB_COMPARE_RETURNS_BOOL
> diff --git a/gcc/testsuite/lib/prune.exp b/gcc/testsuite/lib/prune.exp
> index fac212ecf60..131424861d5 100644
> --- a/gcc/testsuite/lib/prune.exp
> +++ b/gcc/testsuite/lib/prune.exp
> @@ -93,6 +93,9 @@ proc prune_gcc_output { text } {
>      # Ignore dsymutil warning (tool bug is actually linker)
>      regsub -all "(^|\n)\[^\n\]*could not find object file symbol for symbol\[^\n\]*" $text "" text
>
> +    # Ignore stabs obsoletion warnings
> +    regsub -all "(^|\n)\[^\n\]*\[Ww\]arning: STABS debugging information is obsolete and not supported anymore\[^\n\]*" $text "" text
> +
>      # If dg-enable-nn-line-numbers was provided, then obscure source-margin
>      # line numbers by converting them to "NN" form.
>      set text [maybe-handle-nn-line-numbers $text]
> diff --git a/gcc/toplev.c b/gcc/toplev.c
> index 14d1335e79e..8de8a92f2c6 100644
> --- a/gcc/toplev.c
> +++ b/gcc/toplev.c
> @@ -1452,6 +1452,11 @@ process_options (void)
>        && ctf_debug_info_level == CTFINFO_LEVEL_NONE)
>      write_symbols = NO_DEBUG;
>
> +  /* Warn if STABS debug gets enabled and is not the default.  */
> +  if (PREFERRED_DEBUGGING_TYPE != DBX_DEBUG && (write_symbols & DBX_DEBUG))
> +    warning (0, "STABS debugging information is obsolete and not "
> +            "supported anymore");
> +
>    if (write_symbols == NO_DEBUG)
>      ;
>  #if defined(DBX_DEBUGGING_INFO)
> --
> 2.31.1

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH] Always default to DWARF2_DEBUG if not specified, warn about deprecated STABS
  2021-09-28  6:14 ` Richard Biener
@ 2021-09-28 13:18   ` Koning, Paul
  2021-10-15  8:23     ` Richard Biener
  0 siblings, 1 reply; 19+ messages in thread
From: Koning, Paul @ 2021-09-28 13:18 UTC (permalink / raw)
  To: Richard Biener; +Cc: Richard Guenther, GCC Patches



> On Sep 28, 2021, at 2:14 AM, Richard Biener via Gcc-patches <gcc-patches@gcc.gnu.org> wrote:
> 
> On Tue, Sep 21, 2021 at 4:26 PM Richard Biener via Gcc-patches
> <gcc-patches@gcc.gnu.org> wrote:
>> 
>> This makes defaults.h choose DWARF2_DEBUG if PREFERRED_DEBUGGING_TYPE
>> is not specified by the target and errors out if DWARF DWARF is not supported.
>> 
>> ...
>> 
>> This completes the series of deprecating STABS for GCC 12.
>> 
>> Bootstrapped and tested on x86_64-unknown-linux-gnu.
>> 
>> OK for trunk?
> 
> Ping.

pdp11 is fine.

	paul


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH] Always default to DWARF2_DEBUG if not specified, warn about deprecated STABS
  2021-09-28 13:18   ` Koning, Paul
@ 2021-10-15  8:23     ` Richard Biener
  0 siblings, 0 replies; 19+ messages in thread
From: Richard Biener @ 2021-10-15  8:23 UTC (permalink / raw)
  To: Koning, Paul; +Cc: Richard Biener, GCC Patches

On Tue, 28 Sep 2021, Koning, Paul wrote:

> 
> 
> > On Sep 28, 2021, at 2:14 AM, Richard Biener via Gcc-patches <gcc-patches@gcc.gnu.org> wrote:
> > 
> > On Tue, Sep 21, 2021 at 4:26 PM Richard Biener via Gcc-patches
> > <gcc-patches@gcc.gnu.org> wrote:
> >> 
> >> This makes defaults.h choose DWARF2_DEBUG if PREFERRED_DEBUGGING_TYPE
> >> is not specified by the target and errors out if DWARF DWARF is not supported.
> >> 
> >> ...
> >> 
> >> This completes the series of deprecating STABS for GCC 12.
> >> 
> >> Bootstrapped and tested on x86_64-unknown-linux-gnu.
> >> 
> >> OK for trunk?
> > 
> > Ping.
> 
> pdp11 is fine.

I have now pushed this and the related changes.html update.

Richard.

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH] Always default to DWARF2_DEBUG if not specified, warn about deprecated STABS
  2021-09-21 14:25 [PATCH] Always default to DWARF2_DEBUG if not specified, warn about deprecated STABS Richard Biener
  2021-09-28  6:14 ` Richard Biener
@ 2021-10-23 20:00 ` Jan-Benedict Glaw
  2021-10-23 22:19   ` Jeff Law
  2021-10-24  6:36   ` Richard Biener
  2022-08-28  7:50 ` Jan-Benedict Glaw
  2 siblings, 2 replies; 19+ messages in thread
From: Jan-Benedict Glaw @ 2021-10-23 20:00 UTC (permalink / raw)
  To: Richard Biener; +Cc: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 1973 bytes --]

Hi Richard,

On Tue, 2021-09-21 16:25:19 +0200, Richard Biener via Gcc-patches <gcc-patches@gcc.gnu.org> wrote:
> I have built all targets from contrib/config-list.mk to make sure we
> don't run into the #error and the following makes the STABS usage
> explicit for pdp11 and hppa with SOM.

I'm running build tests based on config-list.mk as well and see a good
number of targets failing, all about the same, ie. for moxie-elf:

[all 2021-10-17 00:01:19] /usr/lib/gcc-snapshot/bin/g++  -fno-PIE -c  -DIN_GCC_FRONTEND -g -O2 -DIN_GCC  -DCROSS_DIRECTORY_STRUCTURE   -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wno-error=format-diag -Wmissing-format-attribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -Werror -fno-common  -DHAVE_CONFIG_H -I. -I. -I../../gcc/gcc -I../../gcc/gcc/. -I../../gcc/gcc/../include -I../../gcc/gcc/../libcpp/include -I../../gcc/gcc/../libcody  -I../../gcc/gcc/../libdecnumber -I../../gcc/gcc/../libdecnumber/dpd -I../libdecnumber -I../../gcc/gcc/../libbacktrace   -o default-d.o -MT default-d.o -MMD -MP -MF ./.deps/default-d.TPo ../../gcc/gcc/config/default-d.c
[all 2021-10-17 00:01:19] In file included from ./tm_d.h:9,
[all 2021-10-17 00:01:19]                  from ../../gcc/gcc/config/default-d.c:22:
[all 2021-10-17 00:01:19] ../../gcc/gcc/defaults.h:908:2: error: #error You must define PREFERRED_DEBUGGING_TYPE if DWARF is not supported
[all 2021-10-17 00:01:19]   908 | #error You must define PREFERRED_DEBUGGING_TYPE if DWARF is not supported
[all 2021-10-17 00:01:19]       |  ^~~~~
[all 2021-10-17 00:01:20] make[1]: *** [Makefile:2330: default-d.o] Error 1
[all 2021-10-17 00:01:21] make[1]: Leaving directory '/var/lib/laminar/run/gcc-moxie-elf/13/toolchain-build/gcc'
[all 2021-10-17 00:01:21] make: *** [Makefile:4423: all-gcc] Error 2

Shall I try to ping all the maintainers?

MfG, JBG

-- 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH] Always default to DWARF2_DEBUG if not specified, warn about deprecated STABS
  2021-10-23 20:00 ` Jan-Benedict Glaw
@ 2021-10-23 22:19   ` Jeff Law
  2021-10-24  6:36   ` Richard Biener
  1 sibling, 0 replies; 19+ messages in thread
From: Jeff Law @ 2021-10-23 22:19 UTC (permalink / raw)
  To: Jan-Benedict Glaw, Richard Biener; +Cc: gcc-patches



On 10/23/2021 2:00 PM, Jan-Benedict Glaw wrote:
> Hi Richard,
>
> On Tue, 2021-09-21 16:25:19 +0200, Richard Biener via Gcc-patches <gcc-patches@gcc.gnu.org> wrote:
>> I have built all targets from contrib/config-list.mk to make sure we
>> don't run into the #error and the following makes the STABS usage
>> explicit for pdp11 and hppa with SOM.
> I'm running build tests based on config-list.mk as well and see a good
> number of targets failing, all about the same, ie. for moxie-elf:
That's odd.  My moxie-elf (and all the others I test) aren't seeing this.

http://gcc.gnu.org/jenkins

Jeff


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH] Always default to DWARF2_DEBUG if not specified, warn about deprecated STABS
  2021-10-23 20:00 ` Jan-Benedict Glaw
  2021-10-23 22:19   ` Jeff Law
@ 2021-10-24  6:36   ` Richard Biener
  2021-10-24  7:20     ` Jan-Benedict Glaw
  1 sibling, 1 reply; 19+ messages in thread
From: Richard Biener @ 2021-10-24  6:36 UTC (permalink / raw)
  To: Jan-Benedict Glaw; +Cc: gcc-patches

On October 23, 2021 10:00:05 PM GMT+02:00, Jan-Benedict Glaw <jbglaw@lug-owl.de> wrote:
>Hi Richard,
>
>On Tue, 2021-09-21 16:25:19 +0200, Richard Biener via Gcc-patches <gcc-patches@gcc.gnu.org> wrote:
>> I have built all targets from contrib/config-list.mk to make sure we
>> don't run into the #error and the following makes the STABS usage
>> explicit for pdp11 and hppa with SOM.
>
>I'm running build tests based on config-list.mk as well and see a good
>number of targets failing, all about the same, ie. for moxie-elf:

That's odd. I did test the patch using config-list.mk - the patch sat in the comit tree for quite a while since that exercise (but unchanged), but I doubt anything significant changed in between. 

>[all 2021-10-17 00:01:19] /usr/lib/gcc-snapshot/bin/g++  -fno-PIE -c  -DIN_GCC_FRONTEND -g -O2 -DIN_GCC  -DCROSS_DIRECTORY_STRUCTURE   -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wno-error=format-diag -Wmissing-format-attribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -Werror -fno-common  -DHAVE_CONFIG_H -I. -I. -I../../gcc/gcc -I../../gcc/gcc/. -I../../gcc/gcc/../include -I../../gcc/gcc/../libcpp/include -I../../gcc/gcc/../libcody  -I../../gcc/gcc/../libdecnumber -I../../gcc/gcc/../libdecnumber/dpd -I../libdecnumber -I../../gcc/gcc/../libbacktrace   -o default-d.o -MT default-d.o -MMD -MP -MF ./.deps/default-d.TPo ../../gcc/gcc/config/default-d.c
>[all 2021-10-17 00:01:19] In file included from ./tm_d.h:9,
>[all 2021-10-17 00:01:19]                  from ../../gcc/gcc/config/default-d.c:22:
>[all 2021-10-17 00:01:19] ../../gcc/gcc/defaults.h:908:2: error: #error You must define PREFERRED_DEBUGGING_TYPE if DWARF is not supported

Is that building the D frontend? I remember restricting the builds to C... 

I will check what's up with this next week. 

>[all 2021-10-17 00:01:19]   908 | #error You must define PREFERRED_DEBUGGING_TYPE if DWARF is not supported
>[all 2021-10-17 00:01:19]       |  ^~~~~
>[all 2021-10-17 00:01:20] make[1]: *** [Makefile:2330: default-d.o] Error 1
>[all 2021-10-17 00:01:21] make[1]: Leaving directory '/var/lib/laminar/run/gcc-moxie-elf/13/toolchain-build/gcc'
>[all 2021-10-17 00:01:21] make: *** [Makefile:4423: all-gcc] Error 2
>
>Shall I try to ping all the maintainers?
>
>MfG, JBG
>


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH] Always default to DWARF2_DEBUG if not specified, warn about deprecated STABS
  2021-10-24  6:36   ` Richard Biener
@ 2021-10-24  7:20     ` Jan-Benedict Glaw
  2021-10-25  8:25       ` Richard Biener
  0 siblings, 1 reply; 19+ messages in thread
From: Jan-Benedict Glaw @ 2021-10-24  7:20 UTC (permalink / raw)
  To: Richard Biener; +Cc: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 2264 bytes --]

Hi Richard,

On Sun, 2021-10-24 08:36:36 +0200, Richard Biener <rguenther@suse.de> wrote:
> On October 23, 2021 10:00:05 PM GMT+02:00, Jan-Benedict Glaw <jbglaw@lug-owl.de> wrote:
> >On Tue, 2021-09-21 16:25:19 +0200, Richard Biener via Gcc-patches <gcc-patches@gcc.gnu.org> wrote:
> >> I have built all targets from contrib/config-list.mk to make sure we
> >> don't run into the #error and the following makes the STABS usage
> >> explicit for pdp11 and hppa with SOM.
> >
> >I'm running build tests based on config-list.mk as well and see a good
> >number of targets failing, all about the same, ie. for moxie-elf:
> 
> That's odd. I did test the patch using config-list.mk - the patch
> sat in the comit tree for quite a while since that exercise (but
> unchanged), but I doubt anything significant changed in between. 
> 
> >[all 2021-10-17 00:01:19] /usr/lib/gcc-snapshot/bin/g++  -fno-PIE -c  -DIN_GCC_FRONTEND -g -O2 -DIN_GCC  -DCROSS_DIRECTORY_STRUCTURE   -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wno-error=format-diag -Wmissing-format-attribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -Werror -fno-common  -DHAVE_CONFIG_H -I. -I. -I../../gcc/gcc -I../../gcc/gcc/. -I../../gcc/gcc/../include -I../../gcc/gcc/../libcpp/include -I../../gcc/gcc/../libcody  -I../../gcc/gcc/../libdecnumber -I../../gcc/gcc/../libdecnumber/dpd -I../libdecnumber -I../../gcc/gcc/../libbacktrace   -o default-d.o -MT default-d.o -MMD -MP -MF ./.deps/default-d.TPo ../../gcc/gcc/config/default-d.c
> >[all 2021-10-17 00:01:19] In file included from ./tm_d.h:9,
> >[all 2021-10-17 00:01:19]                  from ../../gcc/gcc/config/default-d.c:22:
> >[all 2021-10-17 00:01:19] ../../gcc/gcc/defaults.h:908:2: error: #error You must define PREFERRED_DEBUGGING_TYPE if DWARF is not supported
> 
> Is that building the D frontend? I remember restricting the builds to C... 

Probably. I configure as

.../gcc/configure --target=moxie-elf --enable-werror-always
--enable-languages=all --disable-gcov --disable-shared
--disable-threads --without-headers
--prefix=/var/lib/laminar/run/gcc-moxie-elf/13/toolchain-install

MfG, JBG

-- 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH] Always default to DWARF2_DEBUG if not specified, warn about deprecated STABS
  2021-10-24  7:20     ` Jan-Benedict Glaw
@ 2021-10-25  8:25       ` Richard Biener
  2021-10-26  1:28         ` Joseph Myers
  0 siblings, 1 reply; 19+ messages in thread
From: Richard Biener @ 2021-10-25  8:25 UTC (permalink / raw)
  To: Jan-Benedict Glaw; +Cc: gcc-patches, ibuclaw, Joseph S. Myers

On Sun, 24 Oct 2021, Jan-Benedict Glaw wrote:

> Hi Richard,
> 
> On Sun, 2021-10-24 08:36:36 +0200, Richard Biener <rguenther@suse.de> wrote:
> > On October 23, 2021 10:00:05 PM GMT+02:00, Jan-Benedict Glaw <jbglaw@lug-owl.de> wrote:
> > >On Tue, 2021-09-21 16:25:19 +0200, Richard Biener via Gcc-patches <gcc-patches@gcc.gnu.org> wrote:
> > >> I have built all targets from contrib/config-list.mk to make sure we
> > >> don't run into the #error and the following makes the STABS usage
> > >> explicit for pdp11 and hppa with SOM.
> > >
> > >I'm running build tests based on config-list.mk as well and see a good
> > >number of targets failing, all about the same, ie. for moxie-elf:
> > 
> > That's odd. I did test the patch using config-list.mk - the patch
> > sat in the comit tree for quite a while since that exercise (but
> > unchanged), but I doubt anything significant changed in between. 
> > 
> > >[all 2021-10-17 00:01:19] /usr/lib/gcc-snapshot/bin/g++ -fno-PIE -c 
> > >-DIN_GCC_FRONTEND -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE 
> > >-fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall 
> > >-Wno-narrowing -Wwrite-strings -Wcast-qual -Wno-error=format-diag 
> > >-Wmissing-format-attribute -Woverloaded-virtual -pedantic 
> > >-Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -Werror 
> > >-fno-common -DHAVE_CONFIG_H -I. -I. -I../../gcc/gcc -I../../gcc/gcc/. 
> > >-I../../gcc/gcc/../include -I../../gcc/gcc/../libcpp/include 
> > >-I../../gcc/gcc/../libcody -I../../gcc/gcc/../libdecnumber 
> > >-I../../gcc/gcc/../libdecnumber/dpd -I../libdecnumber 
> > >-I../../gcc/gcc/../libbacktrace -o default-d.o -MT default-d.o -MMD 
> > >-MP -MF ./.deps/default-d.TPo ../../gcc/gcc/config/default-d.c [all 
> > >2021-10-17 00:01:19] In file included from ./tm_d.h:9, [all 
> > >2021-10-17 00:01:19] from ../../gcc/gcc/config/default-d.c:22: [all 
> > >2021-10-17 00:01:19] ../../gcc/gcc/defaults.h:908:2: error: #error 
> > >You must define PREFERRED_DEBUGGING_TYPE if DWARF is not supported
> > 
> > Is that building the D frontend? I remember restricting the builds to C... 
> 
> Probably. I configure as
> 
> .../gcc/configure --target=moxie-elf --enable-werror-always
> --enable-languages=all --disable-gcov --disable-shared
> --disable-threads --without-headers
> --prefix=/var/lib/laminar/run/gcc-moxie-elf/13/toolchain-install

So it looks like tm_d.h is much more stripped down compared to regular
tm_p.h but also oddly enough config/default-d.c includes tm_d.h
while config/default-c.c explicitely documents itself to not do that.

In particular tm_d.h includes defaults.h which now has the requirement
that either PREFERRED_DEBUGGING_TYPE is defined or DWARF2_DEBUGGING_INFO
but the latter is usually picked up from config/elfos.h or similar
which are headers _not_ included via tm_d.h.

The old defaults.h resulted in NO_DEBUG if no PREFERRED_DEBUGGING_TYPE
and no DWARF2_DEBUGGING_INFO was defined.

I also note that default-d.o is not built on x86_64-linux?  Looks
like that's built only for

if [ "$target_has_targetdm" = "no" ]; then
  d_target_objs="$d_target_objs default-d.o"
fi

I note that for example config/glibc-d.c includes tm.h and tm_p.h
which would end up in proper definitions.

So ... for moxie-elf, did D really end up with NO_DEBUG previously?
Is that "correct" for D or was that a bug?  moxie-elf seems to use
default-c.c as well but that does not end including defaults.h.

Is it maybe a bug that tm_d.h includes defaults.h at all?  Should
"d defaults" be in a defaults-d.h instead?  If I remove the
defaults.h include from tm_d.h the build for moxie-elf succeeds.

Ian?  Joseph?

Thanks,
Richard.

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH] Always default to DWARF2_DEBUG if not specified, warn about deprecated STABS
  2021-10-25  8:25       ` Richard Biener
@ 2021-10-26  1:28         ` Joseph Myers
  2021-10-29 14:48           ` ibuclaw
  0 siblings, 1 reply; 19+ messages in thread
From: Joseph Myers @ 2021-10-26  1:28 UTC (permalink / raw)
  To: Richard Biener; +Cc: Jan-Benedict Glaw, gcc-patches

On Mon, 25 Oct 2021, Richard Biener via Gcc-patches wrote:

> So it looks like tm_d.h is much more stripped down compared to regular
> tm_p.h but also oddly enough config/default-d.c includes tm_d.h
> while config/default-c.c explicitely documents itself to not do that.

I think the intent of that comment in default-c.c (which I wrote) was that 
if a separate tm_c.h is needed, it should use its own headers, disjoint 
from those used by tm.h.  In particular, as noted in the original patch 
submission 
<https://gcc.gnu.org/legacy-ml/gcc-patches/2011-04/msg00434.html>, that 
avoids making macros used only to define hooks visible throughout the 
compiler.

> Is it maybe a bug that tm_d.h includes defaults.h at all?  Should

It's a bug that it includes defaults.h, and a bug that it includes 
${cpu_type}/${cpu_type}.h.  Any macros used only to define D hooks should 
be in completely separate headers that aren't used elsewhere in the 
compiler.

> "d defaults" be in a defaults-d.h instead?  If I remove the

Yes, and likewise any target-specific overrides of such macros should be 
in a separate header, not ${cpu_type}/${cpu_type}.h.

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH] Always default to DWARF2_DEBUG if not specified, warn about deprecated STABS
  2021-10-26  1:28         ` Joseph Myers
@ 2021-10-29 14:48           ` ibuclaw
  0 siblings, 0 replies; 19+ messages in thread
From: ibuclaw @ 2021-10-29 14:48 UTC (permalink / raw)
  To: Joseph Myers, Richard Biener; +Cc: gcc-patches

> On 26/10/2021 03:28 Joseph Myers <joseph@codesourcery.com> wrote:
> 
>  
> On Mon, 25 Oct 2021, Richard Biener via Gcc-patches wrote:
> 
> > So it looks like tm_d.h is much more stripped down compared to regular
> > tm_p.h but also oddly enough config/default-d.c includes tm_d.h
> > while config/default-c.c explicitely documents itself to not do that.
> 
> I think the intent of that comment in default-c.c (which I wrote) was that 
> if a separate tm_c.h is needed, it should use its own headers, disjoint 
> from those used by tm.h.  In particular, as noted in the original patch 
> submission 
> <https://gcc.gnu.org/legacy-ml/gcc-patches/2011-04/msg00434.html>, that 
> avoids making macros used only to define hooks visible throughout the 
> compiler.
> 
> > Is it maybe a bug that tm_d.h includes defaults.h at all?  Should
> 
> It's a bug that it includes defaults.h, and a bug that it includes 
> ${cpu_type}/${cpu_type}.h.  Any macros used only to define D hooks should 
> be in completely separate headers that aren't used elsewhere in the 
> compiler.
> 
> > "d defaults" be in a defaults-d.h instead?  If I remove the
> 
> Yes, and likewise any target-specific overrides of such macros should be 
> in a separate header, not ${cpu_type}/${cpu_type}.h.
> 

So the what default-d.c is doing, is pulling down per-CPU back-end information to populate the targetdm structure where there's a supported CPU, but not platform.  The why it is doing that was I wanted to avoid both having #ifdef's in the D front-end, and altering gcc/target.def.

It seems then that either all TARGET_D_ macros should be moved to ${cpu_type}/${cpu_type}-d.h, or do one of alternatives I was trying to avoid.

Iain.

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH] Always default to DWARF2_DEBUG if not specified, warn about deprecated STABS
  2021-09-21 14:25 [PATCH] Always default to DWARF2_DEBUG if not specified, warn about deprecated STABS Richard Biener
  2021-09-28  6:14 ` Richard Biener
  2021-10-23 20:00 ` Jan-Benedict Glaw
@ 2022-08-28  7:50 ` Jan-Benedict Glaw
  2022-08-28 21:32   ` Jeff Law
  2 siblings, 1 reply; 19+ messages in thread
From: Jan-Benedict Glaw @ 2022-08-28  7:50 UTC (permalink / raw)
  To: Richard Biener; +Cc: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 1729 bytes --]

On Tue, 2021-09-21 16:25:19 +0200, Richard Biener via Gcc-patches <gcc-patches@gcc.gnu.org> wrote:
> This makes defaults.h choose DWARF2_DEBUG if PREFERRED_DEBUGGING_TYPE
> is not specified by the target and errors out if DWARF DWARF is not supported.

While I think the pdp11 bits arreved, the rest did not (yet). Just
checked my auto-builder logs. When building current HEAD as

	../gcc/configure --prefix=... --enable-werror-always \
		--enable-languages=all --disable-gcov \
		--disable-shared --disable-threads --without-headers \
		--target=...
	make V=1 all-gcc

ALL of these targets won't build right now:
	aarch64-elf
	aarch64-rtems
	alpha64-dec-vms
	alpha-dec-vms
	arm-eabi
	arm-rtems
	arm-symbianelf
	arm-uclinux_eabi
	bfin-elf
	bfin-rtems
	bfin-uclinux
	c6x-elf
	c6x-uclinux
	cris-elf
	fido-elf
	fr30-elf
	ft32-elf
	i686-elf
	i686-lynxos
	i686-nto-qnx
	i686-pc-msdosdjgpp
	i686-rtems
	i686-wrs-vxworks
	i686-wrs-vxworksae
	lm32-elf
	lm32-rtems
	lm32-uclinux
	m32c-elf
	m68k-elf
	m68k-rtems
	m68k-uclinux
	moxie-elf
	moxie-rtems
	moxie-uclinux
	powerpc-eabi
	powerpc-eabialtivec
	powerpc-eabisim
	powerpc-eabisimaltivec
	powerpc-ibm-aix7.1
	powerpc-ibm-aix7.2
	powerpcle-eabi
	powerpcle-eabisim
	powerpcle-elf
	powerpc-lynxos
	powerpc-rtems
	powerpc-wrs-vxworks
	powerpc-wrs-vxworksmils
	powerpc-xilinx-eabi
	ppc-elf
	s390x-ibm-tpf
	sh-elf
	sh-rtems
	sh-superh-elf
	sh-wrs-vxworks
	sparc64-elf
	sparc64-rtems
	sparc-elf
	sparc-leon-elf
	sparc-rtems
	sparc-wrs-vxworks
	visium-elf
	x86_64-elf --with-fpmath=sse
	x86_64-rtems
	xtensa-elf

So I'd like to reignite the discussion about a DWARF2 fallback. :)

Thanks,
  Jan-Benedict

-- 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH] Always default to DWARF2_DEBUG if not specified, warn about deprecated STABS
  2022-08-28  7:50 ` Jan-Benedict Glaw
@ 2022-08-28 21:32   ` Jeff Law
  2022-08-29 20:11     ` Jan-Benedict Glaw
  0 siblings, 1 reply; 19+ messages in thread
From: Jeff Law @ 2022-08-28 21:32 UTC (permalink / raw)
  To: gcc-patches



On 8/28/2022 1:50 AM, Jan-Benedict Glaw wrote:
> On Tue, 2021-09-21 16:25:19 +0200, Richard Biener via Gcc-patches <gcc-patches@gcc.gnu.org> wrote:
>> This makes defaults.h choose DWARF2_DEBUG if PREFERRED_DEBUGGING_TYPE
>> is not specified by the target and errors out if DWARF DWARF is not supported.
> While I think the pdp11 bits arreved, the rest did not (yet). Just
> checked my auto-builder logs. When building current HEAD as
>
> 	../gcc/configure --prefix=... --enable-werror-always \
> 		--enable-languages=all --disable-gcov \
> 		--disable-shared --disable-threads --without-headers \
> 		--target=...
> 	make V=1 all-gcc
>
> ALL of these targets won't build right now:
> 	aarch64-elf
> 	aarch64-rtems
> 	alpha64-dec-vms
> 	alpha-dec-vms
> 	arm-eabi
> 	arm-rtems
> 	arm-symbianelf
> 	arm-uclinux_eabi
> 	bfin-elf
> 	bfin-rtems
> 	bfin-uclinux
> 	c6x-elf
> 	c6x-uclinux
> 	cris-elf
> 	fido-elf
> 	fr30-elf
> 	ft32-elf
> 	i686-elf
> 	i686-lynxos
> 	i686-nto-qnx
> 	i686-pc-msdosdjgpp
> 	i686-rtems
> 	i686-wrs-vxworks
> 	i686-wrs-vxworksae
> 	lm32-elf
> 	lm32-rtems
> 	lm32-uclinux
> 	m32c-elf
> 	m68k-elf
> 	m68k-rtems
> 	m68k-uclinux
> 	moxie-elf
> 	moxie-rtems
> 	moxie-uclinux
> 	powerpc-eabi
> 	powerpc-eabialtivec
> 	powerpc-eabisim
> 	powerpc-eabisimaltivec
> 	powerpc-ibm-aix7.1
> 	powerpc-ibm-aix7.2
> 	powerpcle-eabi
> 	powerpcle-eabisim
> 	powerpcle-elf
> 	powerpc-lynxos
> 	powerpc-rtems
> 	powerpc-wrs-vxworks
> 	powerpc-wrs-vxworksmils
> 	powerpc-xilinx-eabi
> 	ppc-elf
> 	s390x-ibm-tpf
> 	sh-elf
> 	sh-rtems
> 	sh-superh-elf
> 	sh-wrs-vxworks
> 	sparc64-elf
> 	sparc64-rtems
> 	sparc-elf
> 	sparc-leon-elf
> 	sparc-rtems
> 	sparc-wrs-vxworks
> 	visium-elf
> 	x86_64-elf --with-fpmath=sse
> 	x86_64-rtems
> 	xtensa-elf
Umm, most of those -elf targets do build.  See:

http://law-sandy.freeddns.org:8080


Jeff


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH] Always default to DWARF2_DEBUG if not specified, warn about deprecated STABS
  2022-08-28 21:32   ` Jeff Law
@ 2022-08-29 20:11     ` Jan-Benedict Glaw
  2022-08-31 16:05       ` Jeff Law
  2022-09-07 10:50       ` Jan-Benedict Glaw
  0 siblings, 2 replies; 19+ messages in thread
From: Jan-Benedict Glaw @ 2022-08-29 20:11 UTC (permalink / raw)
  To: Jeff Law; +Cc: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 1518 bytes --]

Hi Jeff!

On Sun, 2022-08-28 15:32:53 -0600, Jeff Law via Gcc-patches <gcc-patches@gcc.gnu.org> wrote:
> On 8/28/2022 1:50 AM, Jan-Benedict Glaw wrote:
> > On Tue, 2021-09-21 16:25:19 +0200, Richard Biener via Gcc-patches <gcc-patches@gcc.gnu.org> wrote:
> > > This makes defaults.h choose DWARF2_DEBUG if PREFERRED_DEBUGGING_TYPE
> > > is not specified by the target and errors out if DWARF DWARF is not supported.
> > While I think the pdp11 bits arreved, the rest did not (yet). Just
> > checked my auto-builder logs. When building current HEAD as
> > 
> > 	../gcc/configure --prefix=... --enable-werror-always \
> > 		--enable-languages=all --disable-gcov \
> > 		--disable-shared --disable-threads --without-headers \
> > 		--target=...
> > 	make V=1 all-gcc
> > 
> > ALL of these targets won't build right now:
[...]
> Umm, most of those -elf targets do build.  See:
> 
> http://law-sandy.freeddns.org:8080

Another builder. :)  Randomly picking xtensa-elf, you're configuring
as

+ ../../gcc/configure --disable-analyzer --with-system-libunwind
--with-newlib --without-headers --disable-threads --disable-shared
--enable-languages=c,c++
--prefix=/home/jlaw/jenkins/workspace/xtensa-elf/xtensa-elf-obj/gcc/../../xtensa-elf-installed
--target=xtensa-elf

I guess the main difference that lets my builds fail might be
--enable-languages=all (vs. c,c++ in your case.)

Maybe you'd give that a try? (...and I'll trigger a build with just
c,c++ on my builder.)

MfG, JBG

-- 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH] Always default to DWARF2_DEBUG if not specified, warn about deprecated STABS
  2022-08-29 20:11     ` Jan-Benedict Glaw
@ 2022-08-31 16:05       ` Jeff Law
  2022-09-07 10:50       ` Jan-Benedict Glaw
  1 sibling, 0 replies; 19+ messages in thread
From: Jeff Law @ 2022-08-31 16:05 UTC (permalink / raw)
  To: Jan-Benedict Glaw; +Cc: gcc-patches



On 8/29/2022 2:11 PM, Jan-Benedict Glaw wrote:
> Hi Jeff!
>
> On Sun, 2022-08-28 15:32:53 -0600, Jeff Law via Gcc-patches <gcc-patches@gcc.gnu.org> wrote:
>> On 8/28/2022 1:50 AM, Jan-Benedict Glaw wrote:
>>> On Tue, 2021-09-21 16:25:19 +0200, Richard Biener via Gcc-patches <gcc-patches@gcc.gnu.org> wrote:
>>>> This makes defaults.h choose DWARF2_DEBUG if PREFERRED_DEBUGGING_TYPE
>>>> is not specified by the target and errors out if DWARF DWARF is not supported.
>>> While I think the pdp11 bits arreved, the rest did not (yet). Just
>>> checked my auto-builder logs. When building current HEAD as
>>>
>>> 	../gcc/configure --prefix=... --enable-werror-always \
>>> 		--enable-languages=all --disable-gcov \
>>> 		--disable-shared --disable-threads --without-headers \
>>> 		--target=...
>>> 	make V=1 all-gcc
>>>
>>> ALL of these targets won't build right now:
> [...]
>> Umm, most of those -elf targets do build.  See:
>>
>> http://law-sandy.freeddns.org:8080
> Another builder. :)  Randomly picking xtensa-elf, you're configuring
> as
>
> + ../../gcc/configure --disable-analyzer --with-system-libunwind
> --with-newlib --without-headers --disable-threads --disable-shared
> --enable-languages=c,c++
> --prefix=/home/jlaw/jenkins/workspace/xtensa-elf/xtensa-elf-obj/gcc/../../xtensa-elf-installed
> --target=xtensa-elf
>
> I guess the main difference that lets my builds fail might be
> --enable-languages=all (vs. c,c++ in your case.)
>
> Maybe you'd give that a try? (...and I'll trigger a build with just
> c,c++ on my builder.)
I can, particularly now that the tester builds everything in a docker 
container -- it really didn't like having Ada tests (for example) 
appearing and disappearing based on whether or not the host had an Ada 
compiler installed.  I've also brought the computing resources in-house 
(literally, in my house), so I'm not worried about running out of Amazon 
credits anymore.

Jeff

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH] Always default to DWARF2_DEBUG if not specified, warn about deprecated STABS
  2022-08-29 20:11     ` Jan-Benedict Glaw
  2022-08-31 16:05       ` Jeff Law
@ 2022-09-07 10:50       ` Jan-Benedict Glaw
  2022-09-07 11:57         ` Richard Biener
  1 sibling, 1 reply; 19+ messages in thread
From: Jan-Benedict Glaw @ 2022-09-07 10:50 UTC (permalink / raw)
  To: Jeff Law; +Cc: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 1999 bytes --]

Hi!

On Mon, 2022-08-29 22:11:35 +0200, Jan-Benedict Glaw <jbglaw@lug-owl.de> wrote:
> On Sun, 2022-08-28 15:32:53 -0600, Jeff Law via Gcc-patches <gcc-patches@gcc.gnu.org> wrote:
> > On 8/28/2022 1:50 AM, Jan-Benedict Glaw wrote:
> > > On Tue, 2021-09-21 16:25:19 +0200, Richard Biener via Gcc-patches <gcc-patches@gcc.gnu.org> wrote:
> > > > This makes defaults.h choose DWARF2_DEBUG if PREFERRED_DEBUGGING_TYPE
> > > > is not specified by the target and errors out if DWARF DWARF is not supported.
> > > While I think the pdp11 bits arreved, the rest did not (yet). Just
> > > checked my auto-builder logs. When building current HEAD as
> > > 
> > > 	../gcc/configure --prefix=... --enable-werror-always \
> > > 		--enable-languages=all --disable-gcov \
> > > 		--disable-shared --disable-threads --without-headers \
> > > 		--target=...
> > > 	make V=1 all-gcc
> > > 
> > > ALL of these targets won't build right now:
> [...]
> > Umm, most of those -elf targets do build.  See:
> > 
> > http://law-sandy.freeddns.org:8080
> 
> Another builder. :)  Randomly picking xtensa-elf, you're configuring
> as
> 
> + ../../gcc/configure --disable-analyzer --with-system-libunwind
> --with-newlib --without-headers --disable-threads --disable-shared
> --enable-languages=c,c++
> --prefix=/home/jlaw/jenkins/workspace/xtensa-elf/xtensa-elf-obj/gcc/../../xtensa-elf-installed
> --target=xtensa-elf
> 
> I guess the main difference that lets my builds fail might be
> --enable-languages=all (vs. c,c++ in your case.)
> 
> Maybe you'd give that a try? (...and I'll trigger a build with just
> c,c++ on my builder.)

So ... just building for --enable-languages=c,c++ usually works for
the *-elf targets, but I'm interested in building as much code as
possible. Is it expected that with --enable-languages=all, all those
targets will break? Can we have a sane default here, or need the
maintainers decide for any given debug format?

Thanks,
  Jan-Benedict

-- 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH] Always default to DWARF2_DEBUG if not specified, warn about deprecated STABS
  2022-09-07 10:50       ` Jan-Benedict Glaw
@ 2022-09-07 11:57         ` Richard Biener
  0 siblings, 0 replies; 19+ messages in thread
From: Richard Biener @ 2022-09-07 11:57 UTC (permalink / raw)
  To: Jan-Benedict Glaw; +Cc: Jeff Law, GCC Patches

On Wed, Sep 7, 2022 at 12:51 PM Jan-Benedict Glaw <jbglaw@lug-owl.de> wrote:
>
> Hi!
>
> On Mon, 2022-08-29 22:11:35 +0200, Jan-Benedict Glaw <jbglaw@lug-owl.de> wrote:
> > On Sun, 2022-08-28 15:32:53 -0600, Jeff Law via Gcc-patches <gcc-patches@gcc.gnu.org> wrote:
> > > On 8/28/2022 1:50 AM, Jan-Benedict Glaw wrote:
> > > > On Tue, 2021-09-21 16:25:19 +0200, Richard Biener via Gcc-patches <gcc-patches@gcc.gnu.org> wrote:
> > > > > This makes defaults.h choose DWARF2_DEBUG if PREFERRED_DEBUGGING_TYPE
> > > > > is not specified by the target and errors out if DWARF DWARF is not supported.
> > > > While I think the pdp11 bits arreved, the rest did not (yet). Just
> > > > checked my auto-builder logs. When building current HEAD as
> > > >
> > > >   ../gcc/configure --prefix=... --enable-werror-always \
> > > >           --enable-languages=all --disable-gcov \
> > > >           --disable-shared --disable-threads --without-headers \
> > > >           --target=...
> > > >   make V=1 all-gcc
> > > >
> > > > ALL of these targets won't build right now:
> > [...]
> > > Umm, most of those -elf targets do build.  See:
> > >
> > > http://law-sandy.freeddns.org:8080
> >
> > Another builder. :)  Randomly picking xtensa-elf, you're configuring
> > as
> >
> > + ../../gcc/configure --disable-analyzer --with-system-libunwind
> > --with-newlib --without-headers --disable-threads --disable-shared
> > --enable-languages=c,c++
> > --prefix=/home/jlaw/jenkins/workspace/xtensa-elf/xtensa-elf-obj/gcc/../../xtensa-elf-installed
> > --target=xtensa-elf
> >
> > I guess the main difference that lets my builds fail might be
> > --enable-languages=all (vs. c,c++ in your case.)
> >
> > Maybe you'd give that a try? (...and I'll trigger a build with just
> > c,c++ on my builder.)
>
> So ... just building for --enable-languages=c,c++ usually works for
> the *-elf targets, but I'm interested in building as much code as
> possible. Is it expected that with --enable-languages=all, all those
> targets will break? Can we have a sane default here, or need the
> maintainers decide for any given debug format?

It's not expected that they break - when targets do not decide on a default
format and they can handle DWARF that is automatically selected.  And
that shouldn't change whether you enable some language or not.

Richard.

>
> Thanks,
>   Jan-Benedict
>
> --

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH] Always default to DWARF2_DEBUG if not specified, warn about deprecated STABS
  2021-09-10 12:12 Richard Biener
@ 2021-09-10 15:08 ` Michael Matz
  0 siblings, 0 replies; 19+ messages in thread
From: Michael Matz @ 2021-09-10 15:08 UTC (permalink / raw)
  To: Richard Biener; +Cc: gcc-patches

Hello,

On Fri, 10 Sep 2021, Richard Biener via Gcc-patches wrote:

> diagnostic from the Ada frontend.  The warnings are pruned from the
> testsuite output via prune_gcc_output but somehow this doesn't work
> for the tests in gfortran.dg/debug which are now failing with excess
> errors.  That seems to be the case for other fortran .exp as well
> when appending -gstabs, something which works fine for gcc or g++ dgs.

Fortran emits warnings with a capitalized 'W'.  Your regexp only checks 
for lower-case.

> +    # Ignore stabs obsoletion warnings
> +    regsub -all "(^|\n)\[^\n\]*warning: STABS debugging information is obsolete and not supported anymore\[^\n\]*" $text "" text

This needs to be ".arning" or "\[Ww\]arning".


Ciao,
Michael.

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [PATCH] Always default to DWARF2_DEBUG if not specified, warn about deprecated STABS
@ 2021-09-10 12:12 Richard Biener
  2021-09-10 15:08 ` Michael Matz
  0 siblings, 1 reply; 19+ messages in thread
From: Richard Biener @ 2021-09-10 12:12 UTC (permalink / raw)
  To: gcc-patches

This makes defaults.h choose DWARF2_DEBUG if PREFERRED_DEBUGGING_TYPE
is not specified by the target and NO_DEBUG if DWARF is not supported.

It also makes us warn when STABS is enabled and removes the corresponding
diagnostic from the Ada frontend.  The warnings are pruned from the
testsuite output via prune_gcc_output but somehow this doesn't work
for the tests in gfortran.dg/debug which are now failing with excess
errors.  That seems to be the case for other fortran .exp as well
when appending -gstabs, something which works fine for gcc or g++ dgs.

Bootstrapped / tested on x86_64-unknown-linux-gnu with the mentioned
excess errors from all gfortran.dg/debug/

I need to still edit doc/invoke.texi somehow but I wonder if somebody
has insights into the testsuite pruning issue.

Richard.

2021-09-10  Richard Biener  <rguenther@suse.de>

gcc/
	* defaults.h (PREFERRED_DEBUGGING_TYPE): Choose DWARF2_DEBUG
	or NO_DEBUG.
	* toplev.c (process_options): Warn when STABS debugging is
	enabled.

gcc/ada/
	* gcc-interface/misc.c (gnat_post_options): Do not warn
	about DBX_DEBUG use here.

gcc/testsuite/
	* lib/prune.exp: Prune STABS obsoletion message.
---
 gcc/ada/gcc-interface/misc.c |  6 ------
 gcc/defaults.h               | 27 ++++-----------------------
 gcc/testsuite/lib/prune.exp  |  3 +++
 gcc/toplev.c                 |  5 +++++
 4 files changed, 12 insertions(+), 29 deletions(-)

diff --git a/gcc/ada/gcc-interface/misc.c b/gcc/ada/gcc-interface/misc.c
index 96199bd4b63..87a4c8662cb 100644
--- a/gcc/ada/gcc-interface/misc.c
+++ b/gcc/ada/gcc-interface/misc.c
@@ -274,12 +274,6 @@ gnat_post_options (const char **pfilename ATTRIBUTE_UNUSED)
   if (!global_options_set.x_flag_diagnostics_show_caret)
     global_dc->show_caret = false;
 
-  /* Warn only if STABS is not the default: we don't want to emit a warning if
-     the user did not use a -gstabs option.  */
-  if (PREFERRED_DEBUGGING_TYPE != DBX_DEBUG && write_symbols == DBX_DEBUG)
-    warning (0, "STABS debugging information for Ada is obsolete and not "
-		"supported anymore");
-
   /* Copy global settings to local versions.  */
   gnat_encodings = global_options.x_gnat_encodings;
   optimize = global_options.x_optimize;
diff --git a/gcc/defaults.h b/gcc/defaults.h
index ba79a8e48ed..773b93b1a2e 100644
--- a/gcc/defaults.h
+++ b/gcc/defaults.h
@@ -900,34 +900,15 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 #define DEFAULT_GDB_EXTENSIONS 1
 #endif
 
-/* If more than one debugging type is supported, you must define
-   PREFERRED_DEBUGGING_TYPE to choose the default.  */
-
-#if 1 < (defined (DBX_DEBUGGING_INFO) \
-         + defined (DWARF2_DEBUGGING_INFO) + defined (XCOFF_DEBUGGING_INFO) \
-         + defined (VMS_DEBUGGING_INFO))
 #ifndef PREFERRED_DEBUGGING_TYPE
-#error You must define PREFERRED_DEBUGGING_TYPE
-#endif /* no PREFERRED_DEBUGGING_TYPE */
-
-/* If only one debugging format is supported, define PREFERRED_DEBUGGING_TYPE
-   here so other code needn't care.  */
-#elif defined DBX_DEBUGGING_INFO
-#define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
-
-#elif defined DWARF2_DEBUGGING_INFO || defined DWARF2_LINENO_DEBUGGING_INFO
+/* We default to DWARF2_DEBUGGING_INFO.  */
+#if defined DWARF2_DEBUGGING_INFO || defined DWARF2_LINENO_DEBUGGING_INFO
 #define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG
-
-#elif defined VMS_DEBUGGING_INFO
-#define PREFERRED_DEBUGGING_TYPE VMS_AND_DWARF2_DEBUG
-
-#elif defined XCOFF_DEBUGGING_INFO
-#define PREFERRED_DEBUGGING_TYPE XCOFF_DEBUG
-
 #else
-/* No debugging format is supported by this target.  */
+/* DWARF is not supported by this target.  */
 #define PREFERRED_DEBUGGING_TYPE NO_DEBUG
 #endif
+#endif
 
 #ifndef FLOAT_LIB_COMPARE_RETURNS_BOOL
 #define FLOAT_LIB_COMPARE_RETURNS_BOOL(MODE, COMPARISON) false
diff --git a/gcc/testsuite/lib/prune.exp b/gcc/testsuite/lib/prune.exp
index 91f165bec38..62fcd3731cc 100644
--- a/gcc/testsuite/lib/prune.exp
+++ b/gcc/testsuite/lib/prune.exp
@@ -90,6 +90,9 @@ proc prune_gcc_output { text } {
     # Ignore dsymutil warning (tool bug is actually linker)
     regsub -all "(^|\n)\[^\n\]*could not find object file symbol for symbol\[^\n\]*" $text "" text
 
+    # Ignore stabs obsoletion warnings
+    regsub -all "(^|\n)\[^\n\]*warning: STABS debugging information is obsolete and not supported anymore\[^\n\]*" $text "" text
+
     # If dg-enable-nn-line-numbers was provided, then obscure source-margin
     # line numbers by converting them to "NN" form.
     set text [maybe-handle-nn-line-numbers $text]
diff --git a/gcc/toplev.c b/gcc/toplev.c
index 14d1335e79e..2b58fd373bf 100644
--- a/gcc/toplev.c
+++ b/gcc/toplev.c
@@ -1452,6 +1452,11 @@ process_options (void)
       && ctf_debug_info_level == CTFINFO_LEVEL_NONE)
     write_symbols = NO_DEBUG;
 
+  /* Warn if STABS debug gets enabled.  */
+  if (write_symbols & DBX_DEBUG)
+    warning (0, "STABS debugging information is obsolete and not "
+	     "supported anymore");
+
   if (write_symbols == NO_DEBUG)
     ;
 #if defined(DBX_DEBUGGING_INFO)
-- 
2.31.1

^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2022-09-07 11:57 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-21 14:25 [PATCH] Always default to DWARF2_DEBUG if not specified, warn about deprecated STABS Richard Biener
2021-09-28  6:14 ` Richard Biener
2021-09-28 13:18   ` Koning, Paul
2021-10-15  8:23     ` Richard Biener
2021-10-23 20:00 ` Jan-Benedict Glaw
2021-10-23 22:19   ` Jeff Law
2021-10-24  6:36   ` Richard Biener
2021-10-24  7:20     ` Jan-Benedict Glaw
2021-10-25  8:25       ` Richard Biener
2021-10-26  1:28         ` Joseph Myers
2021-10-29 14:48           ` ibuclaw
2022-08-28  7:50 ` Jan-Benedict Glaw
2022-08-28 21:32   ` Jeff Law
2022-08-29 20:11     ` Jan-Benedict Glaw
2022-08-31 16:05       ` Jeff Law
2022-09-07 10:50       ` Jan-Benedict Glaw
2022-09-07 11:57         ` Richard Biener
  -- strict thread matches above, loose matches on Subject: below --
2021-09-10 12:12 Richard Biener
2021-09-10 15:08 ` Michael Matz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).