From patchwork Mon Dec 6 21:13:55 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joseph Myers X-Patchwork-Id: 74466 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 5DC10B6F11 for ; Tue, 7 Dec 2010 08:14:07 +1100 (EST) Received: (qmail 8800 invoked by alias); 6 Dec 2010 21:14:05 -0000 Received: (qmail 8789 invoked by uid 22791); 6 Dec 2010 21:14:04 -0000 X-SWARE-Spam-Status: No, hits=-0.3 required=5.0 tests=AWL, BAYES_50, TW_LG, TW_LR, TW_QN, TW_XG, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 06 Dec 2010 21:13:59 +0000 Received: (qmail 12640 invoked from network); 6 Dec 2010 21:13:57 -0000 Received: from unknown (HELO digraph.polyomino.org.uk) (joseph@127.0.0.2) by mail.codesourcery.com with ESMTPA; 6 Dec 2010 21:13:57 -0000 Received: from jsm28 (helo=localhost) by digraph.polyomino.org.uk with local-esmtp (Exim 4.72) (envelope-from ) id 1PPiNf-0000Zi-TA for gcc-patches@gcc.gnu.org; Mon, 06 Dec 2010 21:13:55 +0000 Date: Mon, 6 Dec 2010 21:13:55 +0000 (UTC) From: "Joseph S. Myers" To: gcc-patches@gcc.gnu.org Subject: Clean up TARGET_POSIX_IO definitions Message-ID: MIME-Version: 1.0 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org This patch, relative to a tree with my previous svr4.h-related cleanup patches and (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 * 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. 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 \