public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* svr4.h avoidance: i386
@ 2010-12-15  2:19 Joseph S. Myers
  2010-12-15 13:44 ` Rainer Orth
  2010-12-17 21:17 ` Richard Henderson
  0 siblings, 2 replies; 3+ messages in thread
From: Joseph S. Myers @ 2010-12-15  2:19 UTC (permalink / raw)
  To: gcc-patches; +Cc: rth, jh, ubizjak

This patch in the series removing svr4.h from the headers used by
particular targets in GCC stops i?86-* and x86_64-* targets from using
svr4.h.

There are several config.gcc stanzas involved, with varying sets of
macros involved; the i[34567]86-*-linux* | i[34567]86-*-kfreebsd*-gnu
| i[34567]86-*-knetbsd*-gnu | i[34567]86-*-gnu* |
i[34567]86-*-kopensolaris*-gnu and x86_64-*-linux* |
x86_64-*-kfreebsd*-gnu | x86_64-*-knetbsd*-gnu stanzas do not end up
using any of the macros from svr4.h at all, while the
i[4567]86-wrs-vxworks|i[4567]86-wrs-vxworksae stanza only uses any of
the macros in the vxworksae case, and i[34567]86-*-solaris2* ends up
not using the macros from svr4.h in the Solaris 2.10 (or later) case.
This patch adds macro definitions to the appropriate target-specific
headers as needed.

Bootstrapped with no regressions on x86_64-unknown-linux-gnu, and
tested building cc1 and xgcc for crosses to: i686-linux-gnu
i686-kfreebsd-gnu i686-knetbsd-gnu i686-gnu i686-kopensolaris-gnu
x86_64-kfreebsd-gnu x86_64-knetbsd-gnu i686-netware i686-nto-qnx
i686-solaris2.8 i686-solaris2.10 i686-wrs-vxworks i686-wrs-vxworksae.
OK to commit?

(The patch is relative to a tree with
<http://gcc.gnu.org/ml/gcc-patches/2010-12/msg00672.html> (pending
review) applied, but does not depend on that patch at all; it was used
in testing simply because it is required for several of the tested
targets to build at all.)

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

	* config/i386/netware.h (ASM_SPEC, SIZE_TYPE, PTRDIFF_TYPE):
	Define.
	* config/i386/nto.h (LIB_SPEC, ASM_SPEC): Define.
	(DBX_REGISTER_NUMBER): Undefine.
	* config/i386/sol2.h (SIZE_TYPE, PTRDIFF_TYPE): Define.
	* config/i386/vxworksae.h (ASM_SPEC, SIZE_TYPE, PTRDIFF_TYPE):
	Define.
	* config.gcc (i[34567]86-*-linux* | i[34567]86-*-kfreebsd*-gnu |
	i[34567]86-*-knetbsd*-gnu | i[34567]86-*-gnu* |
	i[34567]86-*-kopensolaris*-gnu, x86_64-*-linux* |
	x86_64-*-kfreebsd*-gnu | x86_64-*-knetbsd*-gnu,
	i[3456x]86-*-netware*, i[34567]86-*-nto-qnx*,
	i[34567]86-*-solaris2*,
	i[4567]86-wrs-vxworks|i[4567]86-wrs-vxworksae): Don't use svr4.h.

diff -rupN --exclude=.svn gcc-mainline-0/gcc/config/i386/netware.h gcc-mainline/gcc/config/i386/netware.h
--- gcc-mainline-0/gcc/config/i386/netware.h	2010-12-06 10:10:24.000000000 -0800
+++ gcc-mainline/gcc/config/i386/netware.h	2010-12-14 15:19:07.000000000 -0800
@@ -26,6 +26,9 @@ along with GCC; see the file COPYING3.  
 #undef  CPP_SPEC
 #define CPP_SPEC "%{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}"
 
+#undef  ASM_SPEC
+#define ASM_SPEC ""
+
 #undef	LIB_SPEC
 #define LIB_SPEC ""
 
@@ -107,6 +110,12 @@ do {									\
 /* Default structure packing is 1-byte. */
 #define TARGET_DEFAULT_PACK_STRUCT 1
 
+#undef  SIZE_TYPE
+#define SIZE_TYPE "unsigned int"
+
+#undef  PTRDIFF_TYPE
+#define PTRDIFF_TYPE "int"
+
 #undef WCHAR_TYPE
 #define WCHAR_TYPE "short unsigned int"
 
diff -rupN --exclude=.svn gcc-mainline-0/gcc/config/i386/nto.h gcc-mainline/gcc/config/i386/nto.h
--- gcc-mainline-0/gcc/config/i386/nto.h	2010-12-06 10:10:42.000000000 -0800
+++ gcc-mainline/gcc/config/i386/nto.h	2010-12-14 15:20:36.000000000 -0800
@@ -83,6 +83,11 @@ crti.o%s \
    -m i386nto \
    %{!shared: --dynamic-linker /usr/lib/ldqnx.so.2}"
 
+#undef	LIB_SPEC
+#define LIB_SPEC "%{!shared:%{!symbolic:-lc}}"
+
+#undef  ASM_SPEC
+#define ASM_SPEC ""
 
 #undef SIZE_TYPE
 #define SIZE_TYPE "unsigned int"
@@ -99,3 +104,5 @@ crti.o%s \
 #define NO_IMPLICIT_EXTERN_C 1
 
 #define TARGET_POSIX_IO
+
+#undef DBX_REGISTER_NUMBER
diff -rupN --exclude=.svn gcc-mainline-0/gcc/config/i386/sol2.h gcc-mainline/gcc/config/i386/sol2.h
--- gcc-mainline-0/gcc/config/i386/sol2.h	2010-12-09 05:38:51.000000000 -0800
+++ gcc-mainline/gcc/config/i386/sol2.h	2010-12-14 15:23:38.000000000 -0800
@@ -176,4 +176,10 @@ along with GCC; see the file COPYING3.  
 #define LIBGCC2_TF_CEXT q
 #define TF_SIZE 113
 
+#undef  SIZE_TYPE
+#define SIZE_TYPE "unsigned int"
+
+#undef  PTRDIFF_TYPE
+#define PTRDIFF_TYPE "int"
+
 #define MD_UNWIND_SUPPORT "config/i386/sol2-unwind.h"
diff -rupN --exclude=.svn gcc-mainline-0/gcc/config/i386/vxworksae.h gcc-mainline/gcc/config/i386/vxworksae.h
--- gcc-mainline-0/gcc/config/i386/vxworksae.h	2009-03-28 00:38:14.000000000 -0700
+++ gcc-mainline/gcc/config/i386/vxworksae.h	2010-12-14 15:25:04.000000000 -0800
@@ -1,5 +1,5 @@
 /* IA32 VxWorks AE target definitions for GNU compiler.
-   Copyright (C) 2005, 2007 Free Software Foundation, Inc.
+   Copyright (C) 2005, 2007, 2010 Free Software Foundation, Inc.
    Contributed by CodeSourcery, LLC.
 
 This file is part of GCC.
@@ -24,3 +24,12 @@ along with GCC; see the file COPYING3.  
   do						\
     builtin_define ("CPU=SIMNT");		\
   while (0)
+
+#undef  ASM_SPEC
+#define ASM_SPEC ""
+
+#undef  SIZE_TYPE
+#define SIZE_TYPE "unsigned int"
+
+#undef  PTRDIFF_TYPE
+#define PTRDIFF_TYPE "int"
diff -rupN --exclude=.svn gcc-mainline-0/gcc/config.gcc gcc-mainline/gcc/config.gcc
--- gcc-mainline-0/gcc/config.gcc	2010-12-14 14:13:10.000000000 -0800
+++ gcc-mainline/gcc/config.gcc	2010-12-14 15:09:07.000000000 -0800
@@ -1215,7 +1215,7 @@ i[34567]86-*-openbsd*)
 i[34567]86-*-linux* | i[34567]86-*-kfreebsd*-gnu | i[34567]86-*-knetbsd*-gnu | i[34567]86-*-gnu* | i[34567]86-*-kopensolaris*-gnu)
 			# Intel 80386's running GNU/*
 			# with ELF format using glibc 2
-	tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h svr4.h linux.h glibc-stdint.h"
+	tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h linux.h glibc-stdint.h"
 	case ${target} in
 	i[34567]86-*-linux*)
 		# Assume modern glibc
@@ -1252,7 +1252,7 @@ i[34567]86-*-linux* | i[34567]86-*-kfree
 	tmake_file="${tmake_file} i386/t-crtstuff i386/t-crtpc i386/t-crtfm t-dfprules"
 	;;
 x86_64-*-linux* | x86_64-*-kfreebsd*-gnu | x86_64-*-knetbsd*-gnu)
-	tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h svr4.h linux.h glibc-stdint.h \
+	tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h linux.h glibc-stdint.h \
 		 i386/x86-64.h i386/linux64.h"
 	case ${target} in
 	x86_64-*-linux*)
@@ -1282,7 +1282,7 @@ i[34567]86-*-lynxos*)
 	gas=yes
 	;;
 i[3456x]86-*-netware*)
-	tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h svr4.h tm-dwarf2.h i386/netware.h"
+	tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h tm-dwarf2.h i386/netware.h"
  	tmake_file="${tmake_file} i386/t-netware"
 	extra_objs=netware.o
 	case /${with_ld} in
@@ -1301,7 +1301,7 @@ i[3456x]86-*-netware*)
 	esac
 	;;
 i[34567]86-*-nto-qnx*)
-	tm_file="${tm_file} i386/att.h dbxelf.h tm-dwarf2.h elfos.h svr4.h i386/unix.h i386/nto.h"
+	tm_file="${tm_file} i386/att.h dbxelf.h tm-dwarf2.h elfos.h i386/unix.h i386/nto.h"
 	tmake_file="${tmake_file} i386/t-nto"
 	gnu_ld=yes
 	gas=yes
@@ -1312,7 +1312,7 @@ i[34567]86-*-rtems*)
 	tmake_file="${tmake_file} i386/t-rtems-i386 i386/t-crtstuff t-rtems"
 	;;
 i[34567]86-*-solaris2*)
-	tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h svr4.h i386/sysv4.h sol2.h"
+	tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h i386/sysv4.h sol2.h"
 	# Set default arch_32 to pentium4, tune_32 to generic like the other
 	# i386 targets, although config.guess defaults to i386-pc-solaris2*.
 	case ${target} in
@@ -1393,7 +1393,7 @@ i[34567]86-*-solaris2*)
 	esac
 	;;
 i[4567]86-wrs-vxworks|i[4567]86-wrs-vxworksae)
-	tm_file="${tm_file} i386/unix.h i386/att.h elfos.h svr4.h vx-common.h"
+	tm_file="${tm_file} i386/unix.h i386/att.h elfos.h vx-common.h"
 	case ${target} in
 	  *-vxworksae*)
 	    tm_file="${tm_file} vxworksae.h i386/vx-common.h i386/vxworksae.h"

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: svr4.h avoidance: i386
  2010-12-15  2:19 svr4.h avoidance: i386 Joseph S. Myers
@ 2010-12-15 13:44 ` Rainer Orth
  2010-12-17 21:17 ` Richard Henderson
  1 sibling, 0 replies; 3+ messages in thread
From: Rainer Orth @ 2010-12-15 13:44 UTC (permalink / raw)
  To: Joseph S. Myers; +Cc: gcc-patches, rth, jh, ubizjak

"Joseph S. Myers" <joseph@codesourcery.com> writes:

> Bootstrapped with no regressions on x86_64-unknown-linux-gnu, and
> tested building cc1 and xgcc for crosses to: i686-linux-gnu
> i686-kfreebsd-gnu i686-knetbsd-gnu i686-gnu i686-kopensolaris-gnu
> x86_64-kfreebsd-gnu x86_64-knetbsd-gnu i686-netware i686-nto-qnx
> i686-solaris2.8 i686-solaris2.10 i686-wrs-vxworks i686-wrs-vxworksae.
> OK to commit?

The config/i386/sol2.h and config.gcc Solaris/x86 bits are ok.

Thanks.
	Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: svr4.h avoidance: i386
  2010-12-15  2:19 svr4.h avoidance: i386 Joseph S. Myers
  2010-12-15 13:44 ` Rainer Orth
@ 2010-12-17 21:17 ` Richard Henderson
  1 sibling, 0 replies; 3+ messages in thread
From: Richard Henderson @ 2010-12-17 21:17 UTC (permalink / raw)
  To: Joseph S. Myers; +Cc: gcc-patches, jh, ubizjak

On 12/14/2010 05:50 PM, Joseph S. Myers wrote:
> 	* config/i386/netware.h (ASM_SPEC, SIZE_TYPE, PTRDIFF_TYPE):
> 	Define.
> 	* config/i386/nto.h (LIB_SPEC, ASM_SPEC): Define.
> 	(DBX_REGISTER_NUMBER): Undefine.
> 	* config/i386/sol2.h (SIZE_TYPE, PTRDIFF_TYPE): Define.
> 	* config/i386/vxworksae.h (ASM_SPEC, SIZE_TYPE, PTRDIFF_TYPE):
> 	Define.
> 	* config.gcc (i[34567]86-*-linux* | i[34567]86-*-kfreebsd*-gnu |
> 	i[34567]86-*-knetbsd*-gnu | i[34567]86-*-gnu* |
> 	i[34567]86-*-kopensolaris*-gnu, x86_64-*-linux* |
> 	x86_64-*-kfreebsd*-gnu | x86_64-*-knetbsd*-gnu,
> 	i[3456x]86-*-netware*, i[34567]86-*-nto-qnx*,
> 	i[34567]86-*-solaris2*,
> 	i[4567]86-wrs-vxworks|i[4567]86-wrs-vxworksae): Don't use svr4.h.

Ok.


r~

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-12-17 20:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-12-15  2:19 svr4.h avoidance: i386 Joseph S. Myers
2010-12-15 13:44 ` Rainer Orth
2010-12-17 21:17 ` Richard Henderson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).