From patchwork Mon Dec 13 23:16:46 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joseph Myers X-Patchwork-Id: 75439 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 7BC11B7043 for ; Tue, 14 Dec 2010 10:16:58 +1100 (EST) Received: (qmail 24474 invoked by alias); 13 Dec 2010 23:16:56 -0000 Received: (qmail 24466 invoked by uid 22791); 13 Dec 2010 23:16:55 -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; Mon, 13 Dec 2010 23:16:50 +0000 Received: (qmail 29707 invoked from network); 13 Dec 2010 23:16:48 -0000 Received: from unknown (HELO digraph.polyomino.org.uk) (joseph@127.0.0.2) by mail.codesourcery.com with ESMTPA; 13 Dec 2010 23:16:48 -0000 Received: from jsm28 (helo=localhost) by digraph.polyomino.org.uk with local-esmtp (Exim 4.72) (envelope-from ) id 1PSHdO-0007SR-Ln; Mon, 13 Dec 2010 23:16:46 +0000 Date: Mon, 13 Dec 2010 23:16:46 +0000 (UTC) From: "Joseph S. Myers" To: gcc-patches@gcc.gnu.org cc: sterling@tensilica.com Subject: svr4.h avoidance: xtensa 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 xtensa*-*-elf* and xtensa*-*-linux* (that is, all xtensa*-* targets) from using svr4.h. Both targets use the SIZE_TYPE and PTRDIFF_TYPE definitions from svr4.h so those are added to xtensa/elf.h and xtensa/linux.h. In addition, because svr4.h is included after xtensa.h they get the #undef of DBX_REGISTER_NUMBER from svr4.h; that also is added to xtensa/elf.h and xtensa/linux.h to avoid this patch changing any semantics. (The target maintainers should note that the xtensa.h definition of DBX_REGISTER_NUMBER is in fact not used by any target configuration, and consider fixing this by either removing the #undefs, if that is correct and does not cause compatibility problems, or removing the xtensa.h definition and associated function.) Tested building cc1 and xgcc for crosses to xtensa-elf and xtensa-linux-gnu. OK to commit? 2010-12-13 Joseph Myers * config/xtensa/elf.h (SIZE_TYPE, PTRDIFF_TYPE): Define. (DBX_REGISTER_NUMBER): Undefine. * config/xtensa/linux.h (SIZE_TYPE, PTRDIFF_TYPE): Define. (DBX_REGISTER_NUMBER): Undefine. * config.gcc (xtensa*-*-elf*, xtensa*-*-linux*): Don't use svr4.h. Index: gcc/config.gcc =================================================================== --- gcc/config.gcc (revision 167746) +++ gcc/config.gcc (working copy) @@ -2660,11 +2660,11 @@ xstormy16-*-elf) extra_parts="crtbegin.o crtend.o" ;; xtensa*-*-elf*) - tm_file="${tm_file} dbxelf.h elfos.h svr4.h newlib-stdint.h xtensa/elf.h" + tm_file="${tm_file} dbxelf.h elfos.h newlib-stdint.h xtensa/elf.h" tmake_file="xtensa/t-xtensa xtensa/t-elf" ;; xtensa*-*-linux*) - tm_file="${tm_file} dbxelf.h elfos.h svr4.h linux.h glibc-stdint.h xtensa/linux.h" + tm_file="${tm_file} dbxelf.h elfos.h linux.h glibc-stdint.h xtensa/linux.h" tmake_file="${tmake_file} xtensa/t-xtensa xtensa/t-linux" ;; am33_2.0-*-linux*) Index: gcc/config/xtensa/linux.h =================================================================== --- gcc/config/xtensa/linux.h (revision 167746) +++ gcc/config/xtensa/linux.h (working copy) @@ -27,6 +27,12 @@ along with GCC; see the file COPYING3. #undef TARGET_VERSION #define TARGET_VERSION fputs (" (Xtensa GNU/Linux with ELF)", stderr); +#undef SIZE_TYPE +#define SIZE_TYPE "unsigned int" + +#undef PTRDIFF_TYPE +#define PTRDIFF_TYPE "int" + #undef WCHAR_TYPE #define WCHAR_TYPE "long int" @@ -60,5 +66,7 @@ along with GCC; see the file COPYING3. /* Always enable "-fpic" for Xtensa Linux. */ #define XTENSA_ALWAYS_PIC 1 +#undef DBX_REGISTER_NUMBER + #define MD_UNWIND_SUPPORT "config/xtensa/linux-unwind.h" Index: gcc/config/xtensa/elf.h =================================================================== --- gcc/config/xtensa/elf.h (revision 167746) +++ gcc/config/xtensa/elf.h (working copy) @@ -32,6 +32,12 @@ along with GCC; see the file COPYING3. #undef TARGET_VERSION #define TARGET_VERSION fputs (" (Xtensa/ELF)", stderr); +#undef SIZE_TYPE +#define SIZE_TYPE "unsigned int" + +#undef PTRDIFF_TYPE +#define PTRDIFF_TYPE "int" + #undef WCHAR_TYPE #define WCHAR_TYPE "short unsigned int" @@ -75,6 +81,8 @@ along with GCC; see the file COPYING3. /* Do not force "-fpic" for this target. */ #define XTENSA_ALWAYS_PIC 0 +#undef DBX_REGISTER_NUMBER + /* Search for headers in $tooldir/arch/include and for libraries and startfiles in $tooldir/arch/lib. */ #define GCC_DRIVER_HOST_INITIALIZATION \