This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
x-files must die: dead files and #includes
- To: gcc-patches at gcc dot gnu dot org
- Subject: x-files must die: dead files and #includes
- From: "Zack Weinberg" <zackw at stanford dot edu>
- Date: Sun, 11 Mar 2001 14:12:50 -0800
I was asked to split up the 'too much at once' patch I sent on Friday.
This patch simply kills off all of the xm-*.h headers which are not
referenced, directly or indirectly, from config.gcc. It also kills
config/xm-linux.h which is no longer necessary, and all the headers
that existed only to include it. We still have two arch/xm-linux.h's,
in places where arch/xm-arch.h does things linux doesn't want (pa,
i370). And all incestuous includes are removed from xm-host.h files;
that enabled the elimination of a couple more headers.
While testing, I noticed a cosmetic bug in configure.in (only affects
warning messages). That's fixed too.
Tested by generating tconfig.h for all affected targets and checking
that it was sensible. OK to apply?
zw
* config.gcc: Where xm-host.h used to include another
xm-host.h, list the nested header directly in xm_file. Remove
references to deleted files. Can now use sparc/xm-sp64.h for
sparcv9-*-solaris*.
* config/xm-linux.h, config/arm/xm-linux.h,
config/i386/xm-dos.h, config/i386/xm-gnu.h,
config/i386/xm-linux.h, config/i386/xm-openbsd.h,
config/i860/xm-fx2800.h, config/m68k/xm-atari.h,
config/m68k/xm-linux.h, config/m68k/xm-sun3.h,
config/sparc/xm-linux.h, config/sparc/xm-sysv4-64.h:
Delete.
* config/alpha/xm-alpha-interix.h: Don't include alpha/xm-alpha.h.
* config/mips/xm-iris5.h: Don't include mips/xm-mips.h. Don't
bother to wrap #undef in #ifdef.
* config/pa/xm-linux.h, config/rs6000/xm-sysv4.h:
Don't include xm-linux.h.
* config/sparc/xm-sp64.h: Don't include sparc/xm-sparc.h.
* configure.in: Wrap regexps using [] in changequote block.
Use expr : not echo | grep. Simplify regexps.
* configure: Regenerate.
56 xm-files remain, 22 xm-arch.
===================================================================
Index: config.gcc
--- config.gcc 2001/03/09 20:53:52 1.38
+++ config.gcc 2001/03/11 22:03:04
@@ -357,7 +357,7 @@ alpha-*-interix)
target_cpu_default="MASK_GAS|MASK_IEEE_CONFORMANT"
xm_defines=USG
- xm_file="alpha/xm-alpha-interix.h xm-interix.h"
+ xm_file="alpha/xm-alpha.h alpha/xm-alpha-interix.h xm-interix.h"
xmake_file=x-interix
tmake_file="alpha/t-alpha alpha/t-interix alpha/t-ieee"
if test x$enable_threads = xyes ; then
@@ -537,7 +537,6 @@ arm*-*-netbsd*)
use_collect2=yes
;;
arm*-*-linux*) # ARM GNU/Linux with ELF
- xm_file=arm/xm-linux.h
xmake_file=x-linux
tm_file="arm/linux-elf.h"
tmake_file="t-linux arm/t-linux"
@@ -647,6 +646,7 @@ h8300-*-*)
hppa*-*-linux*)
target_cpu_default="(MASK_PA_11 | MASK_GAS | MASK_JUMP_IN_DELAY)"
tm_file="${tm_file} pa/elf.h linux.h pa/pa-linux.h"
+ xm_file=pa/xm-linux.h
tmake_file="t-linux pa/t-linux"
extra_parts="crtbegin.o crtend.o"
xmake_file=none
@@ -951,7 +951,7 @@ i370-*-mvs*)
tmake_file=i370/t-mvs
;;
i370-*-linux*)
- xm_file="xm-linux.h i370/xm-linux.h"
+ xm_file=i370/xm-linux.h
xmake_file=x-linux
tm_file="i370/linux.h ${tm_file}"
tmake_file="t-linux i370/t-linux"
@@ -2150,7 +2150,7 @@ mips-wrs-vxworks)
mips-sgi-irix5cross64) # Irix5 host, Irix 6 target, cross64
tm_file="mips/iris6.h mips/cross64.h"
xm_defines=USG
- xm_file="mips/xm-iris5.h"
+ xm_file="mips/xm-mips.h mips/xm-iris5.h"
xmake_file=mips/x-iris
tmake_file=mips/t-cross64
# See comment in mips/iris[56].h files.
@@ -2191,7 +2191,7 @@ mips-sgi-irix5*) # SGI System V.4., IRI
tm_file=mips/iris5.h
fi
xm_defines=USG
- xm_file="mips/xm-iris5.h"
+ xm_file="mips/xm-mips.h mips/xm-iris5.h"
xmake_file=mips/x-iris
# mips-tfile doesn't work yet
tmake_file=mips/t-mips-gas
@@ -2979,13 +2979,11 @@ sparc-*-elf*)
float_format=i64
;;
sparc-*-linux*aout*) # Sparc's running GNU/Linux, a.out
- xm_file="${xm_file} sparc/xm-linux.h"
tm_file=sparc/linux-aout.h
xmake_file=x-linux
gnu_ld=yes
;;
sparc-*-linux*libc1*) # Sparc's running GNU/Linux, libc5
- xm_file="${xm_file} sparc/xm-linux.h"
xmake_file=x-linux
tm_file=sparc/linux.h
tmake_file="t-linux t-linux-gnulibc1"
@@ -2994,7 +2992,6 @@ sparc-*-linux*libc1*) # Sparc's running
float_format=sparc
;;
sparc-*-linux*) # Sparc's running GNU/Linux, libc6
- xm_file="${xm_file} sparc/xm-linux.h"
xmake_file=x-linux
tm_file=sparc/linux.h
tmake_file="t-linux"
@@ -3039,7 +3036,7 @@ sparcv9-*-solaris2*)
else
tm_file=sparc/sol2-sld-64.h
fi
- xm_file="sparc/xm-sysv4-64.h"
+ xm_file="sparc/xm-sysv4.h sparc/xm-sp64.h"
xm_defines="USG POSIX"
tmake_file="sparc/t-sol2 sparc/t-sol2-64"
if test x$gnu_ld = xyes; then
@@ -3207,7 +3204,7 @@ sparc64-*-elf*)
;;
sparc64-*-linux*) # 64-bit Sparc's running GNU/Linux
tmake_file="t-linux sparc/t-linux64"
- xm_file="sparc/xm-sp64.h sparc/xm-linux.h"
+ xm_file="sparc/xm-sparc.h sparc/xm-sp64.h"
tm_file=sparc/linux64.h
xmake_file=x-linux
extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
===================================================================
Index: config/xm-linux.h
--- config/xm-linux.h Sun Mar 11 14:03:05 2001
+++ config/xm-linux.h Tue May 5 13:32:27 1998
@@ -1,24 +0,0 @@
-/* Configuration for GCC for Intel i386 running Linux-based GNU systems.
- Copyright (C) 1995, 1996, 1997, 1999 Free Software Foundation, Inc.
- Contributed by H.J. Lu (hjl@nynexst.com)
-
-This file is part of GNU CC.
-
-GNU CC 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 2, or (at your option)
-any later version.
-
-GNU CC 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.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* We do have one, but I'd like to use the one come with gcc since
- we have been doing that for a long time with USG defined. H.J. */
-#undef HAVE_STAB_H
===================================================================
Index: config/alpha/xm-alpha-interix.h
--- config/alpha/xm-alpha-interix.h 1999/09/04 15:08:55 1.2
+++ config/alpha/xm-alpha-interix.h 2001/03/11 22:03:05
@@ -21,8 +21,6 @@ along with GNU CC; see the file COPYING.
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#include <alpha/xm-alpha.h>
-
#undef HOST_BITS_PER_LONG
#define HOST_BITS_PER_LONG 32
===================================================================
Index: config/arm/xm-linux.h
--- config/arm/xm-linux.h Sun Mar 11 14:03:05 2001
+++ config/arm/xm-linux.h Tue May 5 13:32:27 1998
@@ -1,23 +0,0 @@
-/* Configuration for GCC for Intel i386 running Linux-based GNU systems./
- Copyright (C) 1993, 1994, 1995, 1997 Free Software Foundation, Inc.
- Contributed by H.J. Lu (hjl@nynexst.com)
-
-This file is part of GNU CC.
-
-GNU CC 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 2, or (at your option)
-any later version.
-
-GNU CC 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.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-#include <arm/xm-arm.h>
-#include <xm-linux.h>
===================================================================
Index: config/i386/xm-dos.h
--- config/i386/xm-dos.h Sun Mar 11 14:03:05 2001
+++ config/i386/xm-dos.h Tue May 5 13:32:27 1998
@@ -1,36 +0,0 @@
-/* Configuration for GNU C-compiler for Intel 80386 running DOS.
- Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc.
-
-This file is part of GNU CC.
-
-GNU CC 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 2, or (at your option)
-any later version.
-
-GNU CC 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.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* Use semicolons to separate elements of a path. */
-#define PATH_SEPARATOR ';'
-
-/* Use backslashs to separate levels of directory. */
-#define DIR_SEPARATOR '\\'
-#define DIR_SEPARATOR_2 '/'
-
-/* Allow checks for drive names. */
-#define HAVE_DOS_BASED_FILE_SYSTEM
-
-/* Suffix for executable file names. */
-#define EXECUTABLE_SUFFIX ".exe"
-
-/* Tell GCC about DOS's bit bucket. */
-
-#define HOST_BIT_BUCKET "NUL"
===================================================================
Index: config/i386/xm-gnu.h
--- config/i386/xm-gnu.h Sun Mar 11 14:03:05 2001
+++ config/i386/xm-gnu.h Tue May 5 13:32:27 1998
@@ -1,2 +0,0 @@
-/* Configuration for GCC for Intel i386 running GNU as host. */
-#include <xm-gnu.h>
===================================================================
Index: config/i386/xm-linux.h
--- config/i386/xm-linux.h Sun Mar 11 14:03:05 2001
+++ config/i386/xm-linux.h Tue May 5 13:32:27 1998
@@ -1,22 +0,0 @@
-/* Configuration for GCC for Intel i386 running Linux-based GNU systems.
- Copyright (C) 1993, 1994, 1995, 1997 Free Software Foundation, Inc.
- Contributed by H.J. Lu (hjl@nynexst.com)
-
-This file is part of GNU CC.
-
-GNU CC 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 2, or (at your option)
-any later version.
-
-GNU CC 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.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-#include <xm-linux.h>
===================================================================
Index: config/i386/xm-openbsd.h
--- config/i386/xm-openbsd.h Sun Mar 11 14:03:05 2001
+++ config/i386/xm-openbsd.h Tue May 5 13:32:27 1998
@@ -1,21 +0,0 @@
-/* Configuration file for i386 hosts running OpenBSD.
- Copyright (C) 1999 Free Software Foundation, Inc.
-
-This file is part of GNU CC.
-
-GNU CC 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 2, or (at your option)
-any later version.
-
-GNU CC 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.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-#include <xm-openbsd.h>
===================================================================
Index: config/i860/xm-fx2800.h
--- config/i860/xm-fx2800.h Sun Mar 11 14:03:05 2001
+++ config/i860/xm-fx2800.h Tue May 5 13:32:27 1998
@@ -1,7 +0,0 @@
-/* Alliant FX/2800 running Concentrix 2.x. */
-
-/* vfprintf is not present prior to Concentrix 2.2. Unfortunately, there
- does not seem to be a cpp symbol that identifies OS revision. Undefine
- the following if running 2.1 or older. */
-
-#define HAVE_VPRINTF
===================================================================
Index: config/m68k/xm-atari.h
--- config/m68k/xm-atari.h Sun Mar 11 14:03:05 2001
+++ config/m68k/xm-atari.h Tue May 5 13:32:27 1998
@@ -1,5 +0,0 @@
-/* Add HZ define if missing */
-
-#ifndef HZ
-#define HZ 100 /* System clock */
-#endif
===================================================================
Index: config/m68k/xm-linux.h
--- config/m68k/xm-linux.h Sun Mar 11 14:03:05 2001
+++ config/m68k/xm-linux.h Tue May 5 13:32:27 1998
@@ -1,4 +0,0 @@
-/* Configuration for GCC for Motorola m68k running Linux-based GNU systems. */
-
-#include <m68k/xm-m68k.h>
-#include <xm-linux.h>
===================================================================
Index: config/m68k/xm-sun3.h
--- config/m68k/xm-sun3.h Sun Mar 11 14:03:05 2001
+++ config/m68k/xm-sun3.h Tue May 5 13:32:27 1998
@@ -1,5 +0,0 @@
-/* Configuration for GCC for Motorola m68k on sun3. */
-
-#define HAVE_POPEN
-
-#include "m68k/xm-m68k.h"
===================================================================
Index: config/mips/xm-iris5.h
--- config/mips/xm-iris5.h 1998/12/16 21:10:04 1.3
+++ config/mips/xm-iris5.h 2001/03/11 22:03:05
@@ -1,9 +1,4 @@
-#include "mips/xm-mips.h"
-
/* On SGI IRIX 5.3, inttypes.h clashes with sys/types.h, but the clash
(when compiled with GCC) is a warning, so configure.in thinks it's OK
to use it. Work around this problem. */
-
-#ifdef HAVE_INTTYPES_H
#undef HAVE_INTTYPES_H
-#endif
===================================================================
Index: config/pa/xm-linux.h
--- config/pa/xm-linux.h 2001/03/06 14:33:07 1.6
+++ config/pa/xm-linux.h 2001/03/11 22:03:05
@@ -22,5 +22,3 @@ Boston, MA 02111-1307, USA. */
/* Doubles are stored in memory with the high order word first. This
matters when cross-compiling. */
#define HOST_WORDS_BIG_ENDIAN 1
-
-#include <xm-linux.h>
===================================================================
Index: config/rs6000/xm-sysv4.h
--- config/rs6000/xm-sysv4.h 2001/03/06 14:33:08 1.14
+++ config/rs6000/xm-sysv4.h 2001/03/11 22:03:05
@@ -24,10 +24,6 @@ Boston, MA 02111-1307, USA. */
matters when cross-compiling. */
#define HOST_WORDS_BIG_ENDIAN 1
-#ifdef __linux__
-#include "xm-linux.h"
-#endif
-
/* if not compiled with GNU C, use only int bitfields. */
#ifndef __GNUC__
#undef ONLY_INT_FIELDS
===================================================================
Index: config/sparc/xm-linux.h
--- config/sparc/xm-linux.h Sun Mar 11 14:03:05 2001
+++ config/sparc/xm-linux.h Tue May 5 13:32:27 1998
@@ -1,25 +0,0 @@
-/* Configuration for GCC for SPARC running Linux-based GNU systems.
- Copyright (C) 1996, 1997, 2001 Free Software Foundation, Inc.
- Contributed by Eddie C. Dost (ecd@skynet.be)
-
-This file is part of GNU CC.
-
-GNU CC 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 2, or (at your option)
-any later version.
-
-GNU CC 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.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-#ifndef inhibit_libc
-#include <stdlib.h>
-#include <string.h>
-#endif
===================================================================
Index: config/sparc/xm-sp64.h
--- config/sparc/xm-sp64.h 1999/12/14 12:53:39 1.4
+++ config/sparc/xm-sp64.h 2001/03/11 22:03:05
@@ -18,8 +18,6 @@ along with GNU CC; see the file COPYING.
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#include <sparc/xm-sparc.h>
-
/* This describes the machine the compiler is hosted on. */
#if defined(__arch64__) || defined(__sparcv9)
#undef HOST_BITS_PER_LONG
===================================================================
Index: config/sparc/xm-sysv4-64.h
--- config/sparc/xm-sysv4-64.h Sun Mar 11 14:03:05 2001
+++ config/sparc/xm-sysv4-64.h Tue May 5 13:32:27 1998
@@ -1,27 +0,0 @@
-/* Configuration for GCC for Sparc v9 running 64-bit native.
- Copyright (C) 1998 Free Software Foundation, Inc.
-
-This file is part of GNU CC.
-
-GNU CC 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 2, or (at your option)
-any later version.
-
-GNU CC 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.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-#include <sparc/xm-sysv4.h>
-
-/* This describes the machine the compiler is hosted on. */
-#if defined(__arch64__) || defined(__sparcv9)
-#undef HOST_BITS_PER_LONG
-#define HOST_BITS_PER_LONG 64
-#endif
===================================================================
Index: configure.in
--- configure.in 2001/03/11 21:19:10 1.494
+++ configure.in 2001/03/11 22:03:05
@@ -679,12 +679,12 @@ echo "Using \`$srcdir/config/$md_file' a
# If any of the xm_file variables contain nonexistent files, warn
# about them and drop them. But $cpu/xm-$cpu.h is allowed not to
# exist, if we have nothing for it to do.
-
+changequote(,)dnl
bx=
for x in $build_xm_file; do
if test -f $srcdir/config/$x
then bx="$bx $x"
- elif echo $x | grep '\([a-z0-9][a-z0-9]*\)/xm-\1\.h' >/dev/null
+ elif expr $x : '\([^/]*\)/xm-\1\.h' >/dev/null
then :
else AC_MSG_WARN($srcdir/config/$x does not exist.)
fi
@@ -695,7 +695,7 @@ hx=
for x in $host_xm_file; do
if test -f $srcdir/config/$x
then hx="$hx $x"
- elif echo $x | grep '\([a-z0-9][a-z0-9]*\)/xm-\1\.h' >/dev/null
+ elif expr $x : '\([^/]*\)/xm-\1\.h' >/dev/null
then :
else AC_MSG_WARN($srcdir/config/$x does not exist.)
fi
@@ -706,12 +706,13 @@ tx=
for x in $xm_file; do
if test -f $srcdir/config/$x
then tx="$tx $x"
- elif echo $x | grep '\([a-z0-9][a-z0-9]*\)/xm-\1\.h' >/dev/null
+ elif expr $x : '\([^/]*\)/xm-\1\.h' >/dev/null
then :
else AC_MSG_WARN($srcdir/config/$x does not exist.)
fi
done
xm_file="$tx"
+changequote([,])dnl
count=a
for f in $tm_file; do