diff mbox

Clean up TARGET_POSIX_IO definitions

Message ID Pine.LNX.4.64.1012062112200.692@digraph.polyomino.org.uk
State New
Headers show

Commit Message

Joseph Myers Dec. 6, 2010, 9:13 p.m. UTC
This patch, relative to a tree with my previous svr4.h-related cleanup
patches <http://gcc.gnu.org/ml/gcc-patches/2010-12/msg00362.html> and
<http://gcc.gnu.org/ml/gcc-patches/2010-12/msg00460.html> (pending
review) applied, cleans up TARGET_POSIX_IO definitions in GCC,
eliminating that in svr4.h.

Again, a macro was inherited by many bare metal targets for which it
is inappropriate (bare metal targets are generic and libc is not
guaranteed to have particular features such as POSIX I/O).  This patch
causes the macro no longer to be defined for those targets.  By adding
it to openbsd.h and rtems.h it causes it to be defined for all OpenBSD
and RTEMS targets rather than just the subsets using svr4.h (I'm
supposing that this is correct for RTEMS though I don't actually
know).  Note that it remains the case that it is defined for IA64
HP-UX but not PA HP-UX (only the former uses svr4.h, and there is no
common hpux.h header).

Bootstrapped with no regressions on x86_64-unknown-linux-gnu.  Also
tested building cc1 and xgcc for crosses to: i686-netware i686-nto-qnx
ia64-hp-hpux11.23 moxie-elf i686-openbsd arm-rtems sh-elf
i686-solaris2.10 i686-wrs-vxworksae.  OK to commit?

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

	* config/i386/netware.h (TARGET_POSIX_IO): Define.
	* config/i386/nto.h (TARGET_POSIX_IO): Define.
	* config/ia64/hpux.h (TARGET_POSIX_IO): Define.
	* config/moxie/moxie.h (TARGET_POSIX_IO): Don't undefine.
	* config/openbsd.h (TARGET_POSIX_IO): Define.
	* config/rtems.h (TARGET_POSIX_IO): Define.
	* config/sh/embed-elf.h (TARGET_POSIX_IO): Don't undefine.
	* config/sol2.h (TARGET_POSIX_IO): Define.
	* config/svr4.h (TARGET_POSIX_IO): Don't define.
	* config/vxworksae.h (TARGET_POSIX_IO): Define.

Comments

Ian Lance Taylor Dec. 9, 2010, 4:51 p.m. UTC | #1
On Mon, Dec 6, 2010 at 1:13 PM, Joseph S. Myers <joseph@codesourcery.com> wrote:

> 2010-12-06  Joseph Myers  <joseph@codesourcery.com>
>
>        * config/i386/netware.h (TARGET_POSIX_IO): Define.
>        * config/i386/nto.h (TARGET_POSIX_IO): Define.
>        * config/ia64/hpux.h (TARGET_POSIX_IO): Define.
>        * config/moxie/moxie.h (TARGET_POSIX_IO): Don't undefine.
>        * config/openbsd.h (TARGET_POSIX_IO): Define.
>        * config/rtems.h (TARGET_POSIX_IO): Define.
>        * config/sh/embed-elf.h (TARGET_POSIX_IO): Don't undefine.
>        * config/sol2.h (TARGET_POSIX_IO): Define.
>        * config/svr4.h (TARGET_POSIX_IO): Don't define.
>        * config/vxworksae.h (TARGET_POSIX_IO): Define.

This is OK.

Thanks.

Ian
diff mbox

Patch

diff -rupN --exclude=.svn gcc-mainline-2/gcc/config/i386/netware.h gcc-mainline/gcc/config/i386/netware.h
--- gcc-mainline-2/gcc/config/i386/netware.h	2010-12-02 09:40:30.000000000 -0800
+++ gcc-mainline/gcc/config/i386/netware.h	2010-12-06 10:10:24.000000000 -0800
@@ -165,3 +165,5 @@  const char *i386_nlm_strip_name_encoding
 #define TARGET_MANGLE_DECL_ASSEMBLER_NAME i386_nlm_mangle_decl_assembler_name
 #undef  TARGET_STRIP_NAME_ENCODING
 #define TARGET_STRIP_NAME_ENCODING  i386_nlm_strip_name_encoding
+
+#define TARGET_POSIX_IO
diff -rupN --exclude=.svn gcc-mainline-2/gcc/config/i386/nto.h gcc-mainline/gcc/config/i386/nto.h
--- gcc-mainline-2/gcc/config/i386/nto.h	2010-12-06 06:49:06.000000000 -0800
+++ gcc-mainline/gcc/config/i386/nto.h	2010-12-06 10:10:42.000000000 -0800
@@ -98,3 +98,4 @@  crti.o%s \
 
 #define NO_IMPLICIT_EXTERN_C 1
 
+#define TARGET_POSIX_IO
diff -rupN --exclude=.svn gcc-mainline-2/gcc/config/ia64/hpux.h gcc-mainline/gcc/config/ia64/hpux.h
--- gcc-mainline-2/gcc/config/ia64/hpux.h	2010-12-06 06:39:16.000000000 -0800
+++ gcc-mainline/gcc/config/ia64/hpux.h	2010-12-06 10:11:01.000000000 -0800
@@ -231,3 +231,5 @@  do {								\
    .text.hot.  */
 
 #define TARGET_ASM_FUNCTION_SECTION ia64_hpux_function_section
+
+#define TARGET_POSIX_IO
diff -rupN --exclude=.svn gcc-mainline-2/gcc/config/moxie/moxie.h gcc-mainline/gcc/config/moxie/moxie.h
--- gcc-mainline-2/gcc/config/moxie/moxie.h	2010-11-21 06:47:48.000000000 -0800
+++ gcc-mainline/gcc/config/moxie/moxie.h	2010-12-06 10:31:16.000000000 -0800
@@ -21,12 +21,6 @@ 
 #ifndef GCC_MOXIE_H
 #define GCC_MOXIE_H
 
-/* This is defined by svr4.h, which is included prior to this file.
-   However, we should undefine it for moxie-elf, since we don't provide
-   functions like access() and mkdir() in newlib.  This will have to
-   be defined again for a Linux port.  */
-#undef TARGET_POSIX_IO
-
 /* Another C string constant used much like `LINK_SPEC'.  The difference
    between the two is that `STARTFILE_SPEC' is used at the very beginning of
    the command given to the linker.
diff -rupN --exclude=.svn gcc-mainline-2/gcc/config/openbsd.h gcc-mainline/gcc/config/openbsd.h
--- gcc-mainline-2/gcc/config/openbsd.h	2010-11-19 13:19:41.000000000 -0800
+++ gcc-mainline/gcc/config/openbsd.h	2010-12-06 10:08:54.000000000 -0800
@@ -144,6 +144,7 @@  while (0)
 #define LIB_SPEC OBSD_LIB_SPEC
 #endif
 
+#define TARGET_POSIX_IO
 
 /* Runtime target specification.  */
 
diff -rupN --exclude=.svn gcc-mainline-2/gcc/config/rtems.h gcc-mainline/gcc/config/rtems.h
--- gcc-mainline-2/gcc/config/rtems.h	2010-04-24 14:15:10.000000000 -0700
+++ gcc-mainline/gcc/config/rtems.h	2010-12-06 10:09:04.000000000 -0800
@@ -40,3 +40,5 @@  along with GCC; see the file COPYING3.  
 "%{!nostdlib: %{qrtems: --start-group \
  -lrtemsbsp -lrtemscpu \
  -lc -lgcc --end-group %{!qnolinkcmds: -T linkcmds%s}}}"
+
+#define TARGET_POSIX_IO
diff -rupN --exclude=.svn gcc-mainline-2/gcc/config/sh/embed-elf.h gcc-mainline/gcc/config/sh/embed-elf.h
--- gcc-mainline-2/gcc/config/sh/embed-elf.h	2009-03-28 00:38:19.000000000 -0700
+++ gcc-mainline/gcc/config/sh/embed-elf.h	2010-12-06 10:31:27.000000000 -0800
@@ -22,8 +22,6 @@  along with GCC; see the file COPYING3.  
 #undef USER_LABEL_PREFIX
 #define USER_LABEL_PREFIX "_"
 
-#undef TARGET_POSIX_IO
-
 /* While the speed-optimized implementations of udivsi3_i4i / sdivsi3_i4i
    in libgcc are not available for SH2, the space-optimized ones in
    libgcc-Os-4-200 are.  Thus, when not optimizing for space, link
diff -rupN --exclude=.svn gcc-mainline-2/gcc/config/sol2.h gcc-mainline/gcc/config/sol2.h
--- gcc-mainline-2/gcc/config/sol2.h	2010-12-06 06:37:58.000000000 -0800
+++ gcc-mainline/gcc/config/sol2.h	2010-12-06 10:09:13.000000000 -0800
@@ -310,3 +310,5 @@  extern GTY(()) tree solaris_pending_fini
 
 /* Allow macro expansion in #pragma pack.  */
 #define HANDLE_PRAGMA_PACK_WITH_EXPANSION
+
+#define TARGET_POSIX_IO
diff -rupN --exclude=.svn gcc-mainline-2/gcc/config/svr4.h gcc-mainline/gcc/config/svr4.h
--- gcc-mainline-2/gcc/config/svr4.h	2010-12-06 06:39:27.000000000 -0800
+++ gcc-mainline/gcc/config/svr4.h	2010-12-06 10:13:01.000000000 -0800
@@ -175,5 +175,3 @@  see the files COPYING3 and COPYING.RUNTI
 
 #undef  WCHAR_TYPE_SIZE
 #define WCHAR_TYPE_SIZE BITS_PER_WORD
-
-#define TARGET_POSIX_IO
diff -rupN --exclude=.svn gcc-mainline-2/gcc/config/vxworksae.h gcc-mainline/gcc/config/vxworksae.h
--- gcc-mainline-2/gcc/config/vxworksae.h	2010-10-05 07:27:06.000000000 -0700
+++ gcc-mainline/gcc/config/vxworksae.h	2010-12-06 10:09:45.000000000 -0800
@@ -56,6 +56,9 @@  along with GCC; see the file COPYING3.  
 
 #define VXWORKS_KIND VXWORKS_KIND_AE
 
+/* Both kernels and RTPs have the facilities required by this macro.  */
+#define TARGET_POSIX_IO
+
 /* A VxWorks 653 implementation of TARGET_OS_CPP_BUILTINS.  */
 #define VXWORKS_OS_CPP_BUILTINS()                                       \
   do                                                                    \