This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

[PATCH] IA-64 suggested cleanup


This patch 
+ brings the ia64-*-* targets into line WRT tm_file.
+ moves non-generic stuff into elf.h (linux.h and hpux.h was already
  #undef'ing all these bits as they weren't generic.  The one setting
  being used by hpux.h was copied there also.
+ removes -Dia64 from being defined in ia64.h -- this platform is new
  enough there is no reason to invade the user's namespace.


I am unable to really test this patch at this time.  I would appreciate
it if someone with access to a Linux and HP-UX IA-64 box would test these
and give feedback.


-- 
-- David  (obrien@FreeBSD.org)



Index: config.gcc
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config.gcc,v
retrieving revision 1.60
diff -u -r1.60 config.gcc
--- config.gcc	2001/05/17 03:15:42	1.60
+++ config.gcc	2001/05/18 12:06:12
@@ -1429,7 +1464,7 @@
 	cxx_target_objs="i960-c.o"
 	;;
 ia64*-*-elf*)
-	tm_file=ia64/elf.h
+	tm_file="${tm_file} elfos.h ia64/sysv4.h ia64/elf.h"
 	tmake_file="ia64/t-ia64"
 	target_cpu_default="0"
 	if test x$gas = xyes
@@ -1442,8 +1477,15 @@
 	fi
 	float_format=i386
 	;;
+ia64*-*-freebsd*)
+	tm_file="${tm_file} elfos.h ${tm_fbsd} ia64/sysv4.h ia64/freebsd.h"
+	xm_file="xm-freebsd.h"
+	tmake_file="t-freebsd ia64/t-ia64"
+	target_cpu_default="MASK_GNU_AS|MASK_GNU_LD"
+	float_format=i386
+	;;
 ia64*-*-linux*)
-	tm_file=ia64/linux.h
+	tm_file="${tm_file} linux.h ia64/sysv4.h ia64/linux.h"
 	tmake_file="t-linux ia64/t-ia64 ia64/t-glibc"
 	target_cpu_default="MASK_GNU_AS|MASK_GNU_LD"
 	if test x$enable_threads = xyes; then
@@ -1452,7 +1494,7 @@
 	float_format=i386
 	;;
 ia64*-*-hpux*)
-	tm_file="ia64/ia64.h svr4.h ia64/sysv4.h ia64/hpux.h"
+	tm_file="${tm_file} svr4.h ia64/sysv4.h ia64/hpux.h"
 	target_cpu_default="MASK_GNU_AS"
 	if test x$enable_threads = xyes; then
 		thread_file='posix'

Index: config/ia64/elf.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/ia64/elf.h,v
retrieving revision 1.1
diff -u -r1.1 elf.h
--- elf.h	2000/03/09 00:26:04	1.1
+++ elf.h	2001/05/18 12:06:12
@@ -1,8 +1,44 @@
 /* Definitions for embedded ia64-elf target.  */
 
-#include "ia64/ia64.h"
-#include "elfos.h"
-#include "sysv4.h"
+/* This macro is a C statement to print on `stderr' a string describing the
+   particular machine description choice.  */
+
+#define TARGET_VERSION fprintf (stderr, " (IA-64)");
+
+/* Define this to be a string constant containing `-D' options to define the
+   predefined macros that identify this machine and system.  These macros will
+   be predefined unless the `-ansi' option is specified.  */
+/* ??? This is undefed in svr4.h.  */
+#define CPP_PREDEFINES "-Dia64 -Amachine=ia64"
+
+/* A C string constant that tells the GNU CC driver program options to pass to
+   the assembler.  It can also specify how to translate options you give to GNU
+   CC into options for GNU CC to pass to the assembler.  */
+
+#if ((TARGET_CPU_DEFAULT | TARGET_DEFAULT) & MASK_GNU_AS) != 0
+/* GNU AS.  */
+#define ASM_SPEC \
+  "%{mno-gnu-as:-N so} %{!mno-gnu-as:-x} %{mconstant-gp} %{mauto-pic}"
+#else
+/* Intel ias.  */
+#define ASM_SPEC \
+  "%{!mgnu-as:-N so} %{mgnu-as:-x} %{mconstant-gp:-M const_gp}\
+   %{mauto-pic:-M no_plabel}"
+#endif
+
+/* A C string constant that tells the GNU CC driver program options to pass to
+   the linker.  It can also specify how to translate options you give to GNU CC
+   into options for GNU CC to pass to the linker.  */
+
+/* The Intel linker does not support dynamic linking, so we need -dn.
+   The Intel linker gives annoying messages unless -N so is used.  */
+#if ((TARGET_CPU_DEFAULT | TARGET_DEFAULT) & MASK_GNU_LD) != 0
+/* GNU LD.  */
+#define LINK_SPEC "%{mno-gnu-ld:-dn -N so}"
+#else
+/* Intel ild.  */
+#define LINK_SPEC "%{!mgnu-ld:-dn -N so}"
+#endif
 
 /* svr4.h links with crti.o/crtn.o, but elfos.h does not.  We override elfos.h
    so that we can use the standard ELF Unix method.  */
Index: config/ia64/hpux.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/ia64/hpux.h,v
retrieving revision 1.2
diff -u -r1.2 hpux.h
--- hpux.h	2001/03/16 05:21:42	1.2
+++ hpux.h	2001/05/18 12:06:12
@@ -20,6 +20,11 @@
 the Free Software Foundation, 59 Temple Place - Suite 330,
 Boston, MA 02111-1307, USA.  */
 
+/* This macro is a C statement to print on `stderr' a string describing the
+   particular machine description choice.  */
+
+#define TARGET_VERSION fprintf (stderr, " (IA-64)");
+
 #undef CPP_PREDEFINES
 #define CPP_PREDEFINES "\
   -D__IA64__ -D__ia64 -D__ia64__ -D__hpux -D__hpux__ -Dhpux -Dunix \
Index: config/ia64/ia64.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/ia64/ia64.h,v
retrieving revision 1.66
diff -u -r1.66 ia64.h
--- ia64.h	2001/05/12 06:03:20	1.66
+++ ia64.h	2001/05/18 12:06:13
@@ -31,12 +31,30 @@
 
 /* Run-time target specifications */
 
-/* Define this to be a string constant containing `-D' options to define the
-   predefined macros that identify this machine and system.  These macros will
-   be predefined unless the `-ansi' option is specified.  */
-/* ??? This is undefed in svr4.h.  */
-#define CPP_PREDEFINES "-Dia64 -Amachine=ia64"
+#define CPP_CPU_SPEC "\
+  -Acpu=ia64 -Amachine=ia64 \
+  -D__ia64 -D__ia64__ -D__IA64__"
+
+/* This macro defines names of additional specifications to put in the
+   specs that can be used in various specifications like CC1_SPEC.  Its
+   definition is an initializer with a subgrouping for each command option.
+
+   Each subgrouping contains a string constant, that defines the
+   specification name, and a string constant that used by the GNU CC driver
+   program.
 
+   Do not define this macro if it does not need to do anything.  */
+
+#ifndef SUBTARGET_EXTRA_SPECS
+#define SUBTARGET_EXTRA_SPECS
+#endif
+
+#define EXTRA_SPECS				\
+  { "cpp_cpu", CPP_CPU_SPEC },			\
+  SUBTARGET_EXTRA_SPECS
+
+#define CC1_SPEC "%(cc1_cpu) "
+
 /* This declaration should be present.  */
 extern int target_flags;
 
@@ -169,11 +187,6 @@
       N_("Specify range of registers to make fixed.")},			\
 }
 
-/* This macro is a C statement to print on `stderr' a string describing the
-   particular machine description choice.  */
-
-#define TARGET_VERSION fprintf (stderr, " (IA-64)");
-
 /* Sometimes certain combinations of command options do not make sense on a
    particular target machine.  You can define a macro `OVERRIDE_OPTIONS' to
    take account of this.  This macro, if defined, is executed once just after
@@ -201,6 +214,7 @@
    defines in other tm.h files.  */
 #define CPP_SPEC \
   "%{mcpu=itanium:-D__itanium__} %{mbig-endian:-D__BIG_ENDIAN__}	\
+   %{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__}		\
    -D__LONG_MAX__=9223372036854775807L"
 
 /* If this macro is defined, the preprocessor will not define the builtin macro
@@ -235,36 +249,6 @@
    into options for GNU CC to pass to the `cc1plus'.  */
 
 /* #define CC1PLUS_SPEC "" */
-
-/* A C string constant that tells the GNU CC driver program options to pass to
-   the assembler.  It can also specify how to translate options you give to GNU
-   CC into options for GNU CC to pass to the assembler.  */
-
-#if ((TARGET_CPU_DEFAULT | TARGET_DEFAULT) & MASK_GNU_AS) != 0
-/* GNU AS.  */
-#define ASM_SPEC \
-  "%{mno-gnu-as:-N so} %{!mno-gnu-as:-x} %{mconstant-gp} %{mauto-pic}"
-#else
-/* Intel ias.  */
-#define ASM_SPEC \
-  "%{!mgnu-as:-N so} %{mgnu-as:-x} %{mconstant-gp:-M const_gp}\
-   %{mauto-pic:-M no_plabel}"
-#endif
-
-/* A C string constant that tells the GNU CC driver program options to pass to
-   the linker.  It can also specify how to translate options you give to GNU CC
-   into options for GNU CC to pass to the linker.  */
-
-/* The Intel linker does not support dynamic linking, so we need -dn.
-   The Intel linker gives annoying messages unless -N so is used.  */
-#if ((TARGET_CPU_DEFAULT | TARGET_DEFAULT) & MASK_GNU_LD) != 0
-/* GNU LD.  */
-#define LINK_SPEC "%{mno-gnu-ld:-dn -N so}"
-#else
-/* Intel ild.  */
-#define LINK_SPEC "%{!mgnu-ld:-dn -N so}"
-#endif
-
 
 /* Storage Layout */
 
Index: config/ia64/linux.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/ia64/linux.h,v
retrieving revision 1.9
diff -u -r1.9 linux.h
--- linux.h	2001/04/25 21:06:10	1.9
+++ linux.h	2001/05/18 12:06:13
@@ -1,9 +1,3 @@
-/* Definitions for ia64-linux target.  */
-#include "ia64/ia64.h"
-#include <linux.h>
-#include "sysv4.h"
-
-/* This is for -profile to use -lc_p instead of -lc. */
 #undef CC1_SPEC
 #define CC1_SPEC "%{profile:-p} %{G*}"
 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]