This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] fix i386/linux.h to follow current include convention
- To: Richard Henderson <rth at redhat dot com>
- Subject: Re: [PATCH] fix i386/linux.h to follow current include convention
- From: "David O'Brien" <obrien at FreeBSD dot org>
- Date: Sun, 7 Jan 2001 21:11:58 -0800
- Cc: gcc-patches at gcc dot gnu dot org
- Organization: The NUXI BSD group
- References: <20010105235036.A20578@dragon.nuxi.com> <20010107030000.A24090@redhat.com>
- Reply-To: obrien at FreeBSD dot org
On Sun, Jan 07, 2001 at 03:00:00AM -0800, Richard Henderson wrote:
> On Fri, Jan 05, 2001 at 11:50:37PM -0800, David O'Brien wrote:
> > This is a patch that makes i386/linux.h follow the current include
> > convention. Many people follow the style of the Linux headers, so they
> > should follow the desired style.
>
> Ok, except that you need similar changes for users of
> i386/gnu.h and i386/moss.h.
Here is the latest version of the patch, handling Linux, GNU, and moss
targets. Of note is that mips*-*-gnu* does not include gcc/config/gnu.h
which claims to be for all GNU targets. When I did include it, compiling
for a mips*-*-gnu* target was more broken than it was before this patch.
How does this version of the patch look?
-- David
Index: config.gcc
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config.gcc,v
retrieving revision 1.17
diff -u -u -6 -r1.17 config.gcc
--- config.gcc 2001/01/02 02:53:47 1.17
+++ config.gcc 2001/01/08 05:04:07
@@ -262,23 +262,31 @@
;;
*-*-gnu*)
# On the Hurd, the setup is just about the same on
# each different CPU. The specific machines that we
# support are matched above and just set $cpu_type.
xm_file="xm-gnu.h ${xm_file}"
- tm_file=${cpu_type}/gnu.h
+ tm_file="${cpu_type}/gnu.h"
extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o"
# GNU always uses ELF.
elf=yes
# GNU tools are the only tools.
gnu_ld=yes
gas=yes
# These details are the same as for Linux.
xmake_file=x-linux
# But here we need a little extra magic.
tmake_file="t-linux t-gnu"
+ case $machine in
+ i[34567]86-*-*)
+ tm_file="${cpu_type}/${cpu_type}.h i386/att.h linux.h i386/linux.h gnu.h ${tm_file}"
+ ;;
+ mips*-*-*)
+ tm_file="svr4.h ${cpu_type}/${cpu_type}.h ${tm_file}"
+ ;;
+ esac
;;
*-*-openbsd*)
tm_file=${cpu_type}/openbsd.h
tmake_file="t-libc-ok t-openbsd"
# avoid surprises, always provide an xm-openbsd file
xm_file=${cpu_type}/xm-openbsd.h
@@ -968,13 +976,13 @@
if test x$enable_threads = xyes; then
thread_file='posix'
fi
;;
i[34567]86-*-elf*)
xm_file="${xm_file} xm-svr4.h i386/xm-sysv4.h"
- tm_file=i386/i386elf.h
+ tm_file="i386/i386.h i386/att.h elfos.h i386/i386elf.h"
tmake_file=i386/t-i386elf
xmake_file=x-svr4
;;
i[34567]86-ibm-aix*) # IBM PS/2 running AIX
if test x$gas = xyes
then
@@ -1155,26 +1163,26 @@
float_format=i386
;;
i[34567]86-*-linux*libc1) # Intel 80386's running GNU/Linux
# with ELF format using the
# GNU/Linux C library 5
xmake_file=x-linux
- tm_file=i386/linux.h
+ tm_file="i386/i386.h i386/att.h linux.h i386/linux.h"
tmake_file="t-linux t-linux-gnulibc1 i386/t-crtstuff"
extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
gnu_ld=yes
float_format=i386
if test x$enable_threads = xyes; then
thread_file='single'
fi
;;
i[34567]86-*-linux*) # Intel 80386's running GNU/Linux
# with ELF format using glibc 2
# aka GNU/Linux C library 6
xmake_file=x-linux
- tm_file=i386/linux.h
+ tm_file="i386/i386.h i386/att.h linux.h i386/linux.h"
tmake_file="t-linux i386/t-crtstuff"
extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
gnu_ld=yes
float_format=i386
if test x$enable_threads = xyes; then
thread_file='posix'
@@ -1199,13 +1207,13 @@
case $host in *pc-msdosdjgpp*)
target_alias=djgpp
;;
esac
;;
i[34567]86-moss-msdos* | i[34567]86-*-moss*)
- tm_file=i386/moss.h
+ tm_file="i386/i386.h i386/att.h linux.h i386/linux.h i386/moss.h"
tmake_file=t-libc-ok
gnu_ld=yes
gas=yes
;;
i[34567]86-*-lynxos*)
if test x$gas = xyes
Index: config/i386/gnu.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/i386/gnu.h,v
retrieving revision 1.9
diff -u -r1.9 gnu.h
--- gnu.h 2000/11/02 23:29:09 1.9
+++ gnu.h 2001/01/08 04:55:45
@@ -1,11 +1,5 @@
/* Configuration for an i386 running GNU with ELF as the target machine. */
-/* This does it mostly for us. */
-#include <i386/linux.h>
-
-/* Get machine-independent configuration parameters for the GNU system. */
-#include <gnu.h>
-
#undef TARGET_VERSION
#define TARGET_VERSION fprintf (stderr, " (i386 GNU)");
Index: config/i386/i386elf.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/i386/i386elf.h,v
retrieving revision 1.8
diff -u -r1.8 i386elf.h
--- i386elf.h 2000/09/25 09:16:37 1.8
+++ i386elf.h 2001/01/08 04:55:46
@@ -20,11 +20,8 @@
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
/* Use stabs instead of DWARF debug format. */
+#undef PREFERRED_DEBUGGING_TYPE
#define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
-
-#include "i386/i386.h"
-#include "i386/att.h"
-#include "elfos.h"
#undef TARGET_VERSION
#define TARGET_VERSION fprintf (stderr, " (i386 bare ELF target)");
Index: config/i386/linux.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/i386/linux.h,v
retrieving revision 1.21
diff -u -r1.21 linux.h
--- linux.h 2000/11/02 23:29:10 1.21
+++ linux.h 2001/01/08 04:55:46
@@ -22,13 +22,6 @@
#define LINUX_DEFAULT_ELF
-/* A lie, I guess, but the general idea behind linux/ELF is that we are
- supposed to be outputting something that will assemble under SVr4.
- This gets us pretty close. */
-#include <i386/i386.h> /* Base i386 target machine definitions */
-#include <i386/att.h> /* Use the i386 AT&T assembler syntax */
-#include <linux.h> /* some common stuff */
-
/* Output at beginning of assembler file. */
/* The .file command should always begin the output. */
#undef ASM_FILE_START
Index: config/i386/moss.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/i386/moss.h,v
retrieving revision 1.5
diff -u -r1.5 moss.h
--- moss.h 2000/11/02 23:29:10 1.5
+++ moss.h 2001/01/08 04:55:46
@@ -19,9 +19,6 @@
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-/* I believe in reuse... */
-#include "i386/linux.h"
-
#undef CPP_PREDEFINES
#define CPP_PREDEFINES "-D__ELF__ -Dmoss -Asystem=posix"
Index: config/mips/gnu.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/mips/gnu.h,v
retrieving revision 1.5
diff -u -r1.5 gnu.h
--- gnu.h 2000/11/02 23:29:11 1.5
+++ gnu.h 2001/01/08 04:55:46
@@ -32,8 +32,6 @@
#undef ASM_DECLARE_OBJECT_NAME
/* #undef PREFERRED_DEBUGGING_TYPE */
-#include <svr4.h>
-
#undef MD_EXEC_PREFIX
#undef MD_STARTFILE_PREFIX
#undef TARGET_VERSION