From patchwork Wed Dec 8 23:34:50 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joseph Myers X-Patchwork-Id: 74795 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 6979EB6F1E for ; Thu, 9 Dec 2010 10:36:56 +1100 (EST) Received: (qmail 5265 invoked by alias); 8 Dec 2010 23:36:46 -0000 Received: (qmail 5077 invoked by uid 22791); 8 Dec 2010 23:36:41 -0000 X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL, BAYES_00, 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; Wed, 08 Dec 2010 23:34:53 +0000 Received: (qmail 17431 invoked from network); 8 Dec 2010 23:34:51 -0000 Received: from unknown (HELO digraph.polyomino.org.uk) (joseph@127.0.0.2) by mail.codesourcery.com with ESMTPA; 8 Dec 2010 23:34:51 -0000 Received: from jsm28 (helo=localhost) by digraph.polyomino.org.uk with local-esmtp (Exim 4.72) (envelope-from ) id 1PQTX8-0003jv-9O; Wed, 08 Dec 2010 23:34:50 +0000 Date: Wed, 8 Dec 2010 23:34:50 +0000 (UTC) From: "Joseph S. Myers" To: gcc-patches@gcc.gnu.org cc: nickc@redhat.com Subject: svr4.h avoidance: mcore 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 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 * 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 ;;