diff mbox series

Remove dbx.h, do not set PREFERRED_DEBUGGING_TYPE from dbxcoff.h, lynx.h

Message ID 49oqn7p0-n811-366q-p55q-1s9pq9ss8n3@fhfr.qr
State New
Headers show
Series Remove dbx.h, do not set PREFERRED_DEBUGGING_TYPE from dbxcoff.h, lynx.h | expand

Commit Message

Richard Biener Sept. 9, 2021, 1:19 p.m. UTC
The following removes the unused config/dbx.h file and removes the
setting of PREFERRED_DEBUGGING_TYPE from dbxcoff.h which is
overridden by all users (djgpp/mingw/cygwin) via either including
config/i386/djgpp.h or config/i386/cygming.h

There are still circumstances where mingw and cygwin default to
STABS, namely when HAVE_GAS_PE_SECREL32_RELOC is not defined and
the target defaults to 32bit code generation.

The new style handling DBX_DEBUGGING_INFO is in line with
dbxelf.h which does not define PREFERRED_DEBUGGING_TYPE either.

The patch also removes the PREFERRED_DEBUGGING_TYPE define from
lynx.h which always follows elfos.h already defaulting to DWARF,
so the comment about STABS being the default is misleading and
outdated.  There's no listed maintainer for Lynx OS.

I have not tested this in any ways but I also have no idea how
to meaningfully do so.

OK?

Thanks,
Richard.

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

	PR target/102255
	* config/dbx.h: Remove.
	* config/dbxcoff.h: Do not define PREFERRED_DEBUGGING_TYPE.
	* config/lynx.h: Likewise.
---
 gcc/config/dbx.h     | 32 --------------------------------
 gcc/config/dbxcoff.h |  6 ------
 gcc/config/lynx.h    |  7 -------
 3 files changed, 45 deletions(-)
 delete mode 100644 gcc/config/dbx.h

Comments

Jonathan Yong Sept. 9, 2021, 2:25 p.m. UTC | #1
On 9/9/21 1:19 PM, Richard Biener wrote:
> The following removes the unused config/dbx.h file and removes the
> setting of PREFERRED_DEBUGGING_TYPE from dbxcoff.h which is
> overridden by all users (djgpp/mingw/cygwin) via either including
> config/i386/djgpp.h or config/i386/cygming.h
> 
> There are still circumstances where mingw and cygwin default to
> STABS, namely when HAVE_GAS_PE_SECREL32_RELOC is not defined and
> the target defaults to 32bit code generation.
> 
> The new style handling DBX_DEBUGGING_INFO is in line with
> dbxelf.h which does not define PREFERRED_DEBUGGING_TYPE either.
> 
> The patch also removes the PREFERRED_DEBUGGING_TYPE define from
> lynx.h which always follows elfos.h already defaulting to DWARF,
> so the comment about STABS being the default is misleading and
> outdated.  There's no listed maintainer for Lynx OS.
> 
> I have not tested this in any ways but I also have no idea how
> to meaningfully do so.
> 

Cygwin/MinGW seems to have HAVE_GAS_PE_SECREL32_RELOC set with modern 
binutils for both 32bit and 64bit, so PREFERRED_DEBUGGING_TYPE should 
nearly always be set as DWARF2_DEBUG.

Tested with binutils 2.36.50.20210330.
Jeff Law Sept. 9, 2021, 3:26 p.m. UTC | #2
On 9/9/2021 7:19 AM, Richard Biener via Gcc-patches wrote:
> The following removes the unused config/dbx.h file and removes the
> setting of PREFERRED_DEBUGGING_TYPE from dbxcoff.h which is
> overridden by all users (djgpp/mingw/cygwin) via either including
> config/i386/djgpp.h or config/i386/cygming.h
>
> There are still circumstances where mingw and cygwin default to
> STABS, namely when HAVE_GAS_PE_SECREL32_RELOC is not defined and
> the target defaults to 32bit code generation.
>
> The new style handling DBX_DEBUGGING_INFO is in line with
> dbxelf.h which does not define PREFERRED_DEBUGGING_TYPE either.
>
> The patch also removes the PREFERRED_DEBUGGING_TYPE define from
> lynx.h which always follows elfos.h already defaulting to DWARF,
> so the comment about STABS being the default is misleading and
> outdated.  There's no listed maintainer for Lynx OS.
>
> I have not tested this in any ways but I also have no idea how
> to meaningfully do so.
>
> OK?
>
> Thanks,
> Richard.
>
> 2021-09-09  Richard Biener  <rguenther@suse.de>
>
> 	PR target/102255
> 	* config/dbx.h: Remove.
> 	* config/dbxcoff.h: Do not define PREFERRED_DEBUGGING_TYPE.
> 	* config/lynx.h: Likewise.
I'd go ahead and install.  We're on a clear path to kill dbx/stabs and 
if this breaks those ports, better to do so as early as possible to give 
folks a chance to fix 'em.

I can't really help on the testing side for this -- my tester doesn't 
try to test djgpp, mingw or cygwin.

jeff

ps.  I'd hazard a guess that lynx.h is for the old lynxos system from 
the 90s.  I'd be amazed if it's still used in any way.
Jason Merrill Sept. 9, 2021, 4:11 p.m. UTC | #3
On 9/9/21 9:19 AM, Richard Biener via Gcc-patches wrote:
> The following removes the unused config/dbx.h file and removes the
> setting of PREFERRED_DEBUGGING_TYPE from dbxcoff.h which is
> overridden by all users (djgpp/mingw/cygwin) via either including
> config/i386/djgpp.h or config/i386/cygming.h
> 
> There are still circumstances where mingw and cygwin default to
> STABS, namely when HAVE_GAS_PE_SECREL32_RELOC is not defined and
> the target defaults to 32bit code generation.
> 
> The new style handling DBX_DEBUGGING_INFO is in line with
> dbxelf.h which does not define PREFERRED_DEBUGGING_TYPE either.
> 
> The patch also removes the PREFERRED_DEBUGGING_TYPE define from
> lynx.h which always follows elfos.h already defaulting to DWARF,
> so the comment about STABS being the default is misleading and
> outdated.  There's no listed maintainer for Lynx OS.
> 
> I have not tested this in any ways but I also have no idea how
> to meaningfully do so.
> 
> OK?

You probably also want to remove the remnant of --with-stabs from 
configure.ac.

> 
> Thanks,
> Richard.
> 
> 2021-09-09  Richard Biener  <rguenther@suse.de>
> 
> 	PR target/102255
> 	* config/dbx.h: Remove.
> 	* config/dbxcoff.h: Do not define PREFERRED_DEBUGGING_TYPE.
> 	* config/lynx.h: Likewise.
> ---
>   gcc/config/dbx.h     | 32 --------------------------------
>   gcc/config/dbxcoff.h |  6 ------
>   gcc/config/lynx.h    |  7 -------
>   3 files changed, 45 deletions(-)
>   delete mode 100644 gcc/config/dbx.h
> 
> diff --git a/gcc/config/dbx.h b/gcc/config/dbx.h
> deleted file mode 100644
> index b270a07cf9f..00000000000
> --- a/gcc/config/dbx.h
> +++ /dev/null
> @@ -1,32 +0,0 @@
> -/* Prefer DBX (stabs) debugging information.
> -   Copyright (C) 1996-2021 Free Software Foundation, Inc.
> -
> -This file is part of GCC.
> -
> -GCC is free software; you can redistribute it and/or modify
> -it under the terms of the GNU General Public License as published by
> -the Free Software Foundation; either version 3, or (at your option)
> -any later version.
> -
> -GCC is distributed in the hope that it will be useful,
> -but WITHOUT ANY WARRANTY; without even the implied warranty of
> -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> -GNU General Public License for more details.
> -
> -Under Section 7 of GPL version 3, you are granted additional
> -permissions described in the GCC Runtime Library Exception, version
> -3.1, as published by the Free Software Foundation.
> -
> -You should have received a copy of the GNU General Public License and
> -a copy of the GCC Runtime Library Exception along with this program;
> -see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
> -<http://www.gnu.org/licenses/>.  */
> -
> -/* This file causes gcc to prefer using DBX (stabs) debugging
> -   information.  The configure script will add a #include of this file
> -   to tm.h when --with-stabs is used for certain targets.  */
> -
> -#define DBX_DEBUGGING_INFO 1
> -
> -#undef PREFERRED_DEBUGGING_TYPE
> -#define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
> 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/lynx.h b/gcc/config/lynx.h
> index 020cc97352f..14387040cba 100644
> --- a/gcc/config/lynx.h
> +++ b/gcc/config/lynx.h
> @@ -158,13 +158,6 @@ along with GCC; see the file COPYING3.  If not see
>     while (0)
>   #endif
>   
> -/* Keep the *_DEBUGGING_INFO defines from elfos.h except that stabs is
> -   the default on LynxOS.  */
> -
> -#ifndef PREFERRED_DEBUGGING_TYPE
> -# define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
> -#endif
> -
>   #ifndef TARGET_POSIX_IO
>   # define TARGET_POSIX_IO
>   #endif
>
Richard Biener Sept. 10, 2021, 6:02 a.m. UTC | #4
On Thu, 9 Sep 2021, Jeff Law wrote:

> 
> 
> On 9/9/2021 7:19 AM, Richard Biener via Gcc-patches wrote:
> > The following removes the unused config/dbx.h file and removes the
> > setting of PREFERRED_DEBUGGING_TYPE from dbxcoff.h which is
> > overridden by all users (djgpp/mingw/cygwin) via either including
> > config/i386/djgpp.h or config/i386/cygming.h
> >
> > There are still circumstances where mingw and cygwin default to
> > STABS, namely when HAVE_GAS_PE_SECREL32_RELOC is not defined and
> > the target defaults to 32bit code generation.
> >
> > The new style handling DBX_DEBUGGING_INFO is in line with
> > dbxelf.h which does not define PREFERRED_DEBUGGING_TYPE either.
> >
> > The patch also removes the PREFERRED_DEBUGGING_TYPE define from
> > lynx.h which always follows elfos.h already defaulting to DWARF,
> > so the comment about STABS being the default is misleading and
> > outdated.  There's no listed maintainer for Lynx OS.
> >
> > I have not tested this in any ways but I also have no idea how
> > to meaningfully do so.
> >
> > OK?
> >
> > Thanks,
> > Richard.
> >
> > 2021-09-09  Richard Biener  <rguenther@suse.de>
> >
> >  PR target/102255
> >  * config/dbx.h: Remove.
> >  * config/dbxcoff.h: Do not define PREFERRED_DEBUGGING_TYPE.
> >  * config/lynx.h: Likewise.
> I'd go ahead and install.  We're on a clear path to kill dbx/stabs and if this
> breaks those ports, better to do so as early as possible to give folks a
> chance to fix 'em.
> 
> I can't really help on the testing side for this -- my tester doesn't try to
> test djgpp, mingw or cygwin.

I see.  Mind the patch doesn't change anything (unless my analysis was 
flawed).  It merely reduces the grep hit for DBX_DEBUGGING_INFO and
PREFERRED_DEBUGGING_TYPE ;)

My immediate goal is to get rid of PREFERRED_DEBUGGING_TYPE
(it will always be DWARF_DEBUGGING_INFO) and _default_ all ports
to DWARF so my original goal of being able to deprecate STABS for GCC 12
will work out (which would be sth odd if some port still defaults to it).

I've pushed this change now.

Richard.
Jan-Benedict Glaw Sept. 13, 2021, 3:51 a.m. UTC | #5
Hi Richard,

On Fri, 2021-09-10 08:02:00 +0200, Richard Biener via Gcc-patches <gcc-patches@gcc.gnu.org> wrote:
> > On 9/9/2021 7:19 AM, Richard Biener via Gcc-patches wrote:
> > > The patch also removes the PREFERRED_DEBUGGING_TYPE define from
> > > lynx.h which always follows elfos.h already defaulting to DWARF,
> > > so the comment about STABS being the default is misleading and
> > > outdated.  There's no listed maintainer for Lynx OS.
> > >
> > > I have not tested this in any ways but I also have no idea how
> > > to meaningfully do so.

I'm not actually running such a configuration and cannot properly test
it, but automated mass-building broke for --target=i686-lynxos:

[all 2021-09-13 00:17:48] /usr/lib/gcc-snapshot/bin/g++ -c   -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  -DGENERATOR_FILE -fno-PIE -I. -Ibuild -I../../gcc/gcc -I../../gcc/gcc/build -I../../gcc/gcc/../include  -I../../gcc/gcc/../libcpp/include  \
[all 2021-09-13 00:17:48]  -o build/genconstants.o ../../gcc/gcc/genconstants.c
[all 2021-09-13 00:17:49] /usr/lib/gcc-snapshot/bin/g++   -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  -DGENERATOR_FILE -fno-PIE -static-libstdc++ -static-libgcc  -no-pie -o build/genconstants \
[all 2021-09-13 00:17:49]     build/genconstants.o build/read-md.o build/errors.o ../build-x86_64-pc-linux-gnu/libiberty/libiberty.a
[all 2021-09-13 00:17:49] build/genconstants ../../gcc/gcc/common.md ../../gcc/gcc/config/i386/i386.md \
[all 2021-09-13 00:17:49]    > tmp-constants.h
[all 2021-09-13 00:17:49] /bin/bash ../../gcc/gcc/../move-if-change tmp-constants.h insn-constants.h
[all 2021-09-13 00:17:49] echo timestamp > s-constants
[all 2021-09-13 00:17:49] /usr/lib/gcc-snapshot/bin/g++ -c   -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  -DGENERATOR_FILE -fno-PIE -I. -Ibuild -I../../gcc/gcc -I../../gcc/gcc/build -I../../gcc/gcc/../include  -I../../gcc/gcc/../libcpp/include  \
[all 2021-09-13 00:17:49]  -o build/genpreds.o ../../gcc/gcc/genpreds.c
[all 2021-09-13 00:17:49] In file included from ./tm.h:37,
[all 2021-09-13 00:17:49]                  from ../../gcc/gcc/genpreds.c:26:
[all 2021-09-13 00:17:49] ../../gcc/gcc/defaults.h:910:2: error: #error You must define PREFERRED_DEBUGGING_TYPE
[all 2021-09-13 00:17:49]   910 | #error You must define PREFERRED_DEBUGGING_TYPE
[all 2021-09-13 00:17:49]       |  ^~~~~
[all 2021-09-13 00:17:50] make[1]: *** [Makefile:2831: build/genpreds.o] Error 1
[all 2021-09-13 00:17:50] make[1]: Leaving directory '/var/lib/laminar/run/gcc-i686-lynxos/8/toolchain-build/gcc'
[all 2021-09-13 00:17:50] make: *** [Makefile:4423: all-gcc] Error 2

Thanks,
  Jan-Benedict

--
Richard Biener Sept. 13, 2021, 9:28 a.m. UTC | #6
On Mon, 13 Sep 2021, Jan-Benedict Glaw wrote:

> Hi Richard,
> 
> On Fri, 2021-09-10 08:02:00 +0200, Richard Biener via Gcc-patches <gcc-patches@gcc.gnu.org> wrote:
> > > On 9/9/2021 7:19 AM, Richard Biener via Gcc-patches wrote:
> > > > The patch also removes the PREFERRED_DEBUGGING_TYPE define from
> > > > lynx.h which always follows elfos.h already defaulting to DWARF,
> > > > so the comment about STABS being the default is misleading and
> > > > outdated.  There's no listed maintainer for Lynx OS.
> > > >
> > > > I have not tested this in any ways but I also have no idea how
> > > > to meaningfully do so.
> 
> I'm not actually running such a configuration and cannot properly test
> it, but automated mass-building broke for --target=i686-lynxos:

Ah, I didn't spot

/* Undefine the definition from elfos.h to enable our default.  */

#undef PREFERRED_DEBUGGING_TYPE

will fix.

Richard.
diff mbox series

Patch

diff --git a/gcc/config/dbx.h b/gcc/config/dbx.h
deleted file mode 100644
index b270a07cf9f..00000000000
--- a/gcc/config/dbx.h
+++ /dev/null
@@ -1,32 +0,0 @@ 
-/* Prefer DBX (stabs) debugging information.
-   Copyright (C) 1996-2021 Free Software Foundation, Inc.
-
-This file is part of GCC.
-
-GCC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 3, or (at your option)
-any later version.
-
-GCC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-Under Section 7 of GPL version 3, you are granted additional
-permissions described in the GCC Runtime Library Exception, version
-3.1, as published by the Free Software Foundation.
-
-You should have received a copy of the GNU General Public License and
-a copy of the GCC Runtime Library Exception along with this program;
-see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
-<http://www.gnu.org/licenses/>.  */
-
-/* This file causes gcc to prefer using DBX (stabs) debugging
-   information.  The configure script will add a #include of this file
-   to tm.h when --with-stabs is used for certain targets.  */
-
-#define DBX_DEBUGGING_INFO 1
-
-#undef PREFERRED_DEBUGGING_TYPE
-#define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
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/lynx.h b/gcc/config/lynx.h
index 020cc97352f..14387040cba 100644
--- a/gcc/config/lynx.h
+++ b/gcc/config/lynx.h
@@ -158,13 +158,6 @@  along with GCC; see the file COPYING3.  If not see
   while (0)
 #endif
 
-/* Keep the *_DEBUGGING_INFO defines from elfos.h except that stabs is
-   the default on LynxOS.  */
-
-#ifndef PREFERRED_DEBUGGING_TYPE
-# define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
-#endif
-
 #ifndef TARGET_POSIX_IO
 # define TARGET_POSIX_IO
 #endif