svr4.h avoidance: mcore

Joseph S. Myers joseph@codesourcery.com
Wed Dec 8 23:38:00 GMT 2010


This patch in the series removing svr4.h from the headers used by
particular targets in GCC stops mcore-*-elf from using svr4.h.

There are two mcore-* targets, mcore-elf and mcore-pe.  The former
used svr4.h before this patch; the latter uses svr3.h, and is the only
target using svr3.h (so that header really should go away and be
merged into mcore-pe.h - or perhaps mcore-pe should be deprecated in
the general principle that bare-metal targets should be ELF and most
of the non-ELF bare-metal targets were removed some time ago).  The
only macros mcore-elf got from svr4.h were PTRDIFF_TYPE, WCHAR_TYPE
and WCHAR_TYPE_SIZE (unusually, mcore.h defined SIZE_TYPE but not
PTRDIFF_TYPE).  The definitions of all these macros are the same in
svr4.h and svr3.h so we may as well put them in mcore.h, and remove
the svr3.h definitions as unused, which this patch does.

Tested building cc1 and xgcc for crosses to mcore-elf and mcore-pe.
OK to commit?

2010-12-08  Joseph Myers  <joseph@codesourcery.com>

	* config/mcore/mcore.h (PTRDIFF_TYPE, WCHAR_TYPE,
	WCHAR_TYPE_SIZE): Define.
	* config/svr3.h (SIZE_TYPE, PTRDIFF_TYPE, WCHAR_TYPE,
	WCHAR_TYPE_SIZE): Don't define.
	* config.gcc (mcore-*-elf): Don't use svr4.h.

diff -rupN --exclude=.svn gcc-mainline-3/gcc/config/mcore/mcore.h gcc-mainline/gcc/config/mcore/mcore.h
--- gcc-mainline-3/gcc/config/mcore/mcore.h	2010-11-19 05:28:30.000000000 -0800
+++ gcc-mainline/gcc/config/mcore/mcore.h	2010-12-08 15:16:08.000000000 -0800
@@ -692,9 +692,18 @@ extern const enum reg_class reg_class_fr
 /* 'char' is signed by default.  */
 #define DEFAULT_SIGNED_CHAR  0
 
-/* The type of size_t unsigned int.  */
+#undef SIZE_TYPE
 #define SIZE_TYPE "unsigned int"
 
+#undef PTRDIFF_TYPE
+#define PTRDIFF_TYPE "int"
+
+#undef WCHAR_TYPE
+#define WCHAR_TYPE "long int"
+
+#undef WCHAR_TYPE_SIZE
+#define WCHAR_TYPE_SIZE BITS_PER_WORD
+
 /* Max number of bytes we can move from memory to memory
    in one reasonably fast instruction.  */
 #define MOVE_MAX 4
diff -rupN --exclude=.svn gcc-mainline-3/gcc/config/svr3.h gcc-mainline/gcc/config/svr3.h
--- gcc-mainline-3/gcc/config/svr3.h	2009-03-28 00:38:54.000000000 -0700
+++ gcc-mainline/gcc/config/svr3.h	2010-12-08 15:17:54.000000000 -0800
@@ -1,6 +1,7 @@
 /* Operating system specific defines to be used when targeting GCC for
    generic System V Release 3 system.
-   Copyright (C) 1991, 1996, 2000, 2002, 2004, 2007 Free Software Foundation, Inc.
+   Copyright (C) 1991, 1996, 2000, 2002, 2004, 2007, 2010
+   Free Software Foundation, Inc.
    Contributed by Ron Guilmette (rfg@monkeys.com).
 
 This file is part of GCC.
@@ -77,21 +78,6 @@ along with GCC; see the file COPYING3.  
 
 #undef DBX_DEBUGGING_INFO
 
-/* Define the actual types of some ANSI-mandated types.  These
-   definitions should work for most SVR3 systems.  */
-
-#undef SIZE_TYPE
-#define SIZE_TYPE "unsigned int"
-
-#undef PTRDIFF_TYPE
-#define PTRDIFF_TYPE "int"
-
-#undef WCHAR_TYPE
-#define WCHAR_TYPE "long int"
-
-#undef WCHAR_TYPE_SIZE
-#define WCHAR_TYPE_SIZE BITS_PER_WORD
-
 /* The prefix to add to user-visible assembler symbols.
 
    For System V Release 3 the convention is to prepend a leading
diff -rupN --exclude=.svn gcc-mainline-3/gcc/config.gcc gcc-mainline/gcc/config.gcc
--- gcc-mainline-3/gcc/config.gcc	2010-12-06 03:31:49.000000000 -0800
+++ gcc-mainline/gcc/config.gcc	2010-12-08 15:17:24.000000000 -0800
@@ -1755,7 +1755,7 @@ m68k-*-rtems*)
 	extra_parts="crtbegin.o crtend.o"
 	;;
 mcore-*-elf)
-	tm_file="dbxelf.h elfos.h svr4.h newlib-stdint.h ${tm_file} mcore/mcore-elf.h"
+	tm_file="dbxelf.h elfos.h newlib-stdint.h ${tm_file} mcore/mcore-elf.h"
 	tmake_file=mcore/t-mcore
 	inhibit_libc=true
 	;;

-- 
Joseph S. Myers
joseph@codesourcery.com



More information about the Gcc-patches mailing list