From patchwork Tue Dec 7 18:15:10 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joseph Myers X-Patchwork-Id: 74590 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 B4BB7B6F11 for ; Wed, 8 Dec 2010 05:15:23 +1100 (EST) Received: (qmail 9942 invoked by alias); 7 Dec 2010 18:15:20 -0000 Received: (qmail 9929 invoked by uid 22791); 7 Dec 2010 18:15:18 -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; Tue, 07 Dec 2010 18:15:13 +0000 Received: (qmail 12939 invoked from network); 7 Dec 2010 18:15:12 -0000 Received: from unknown (HELO digraph.polyomino.org.uk) (joseph@127.0.0.2) by mail.codesourcery.com with ESMTPA; 7 Dec 2010 18:15:12 -0000 Received: from jsm28 (helo=localhost) by digraph.polyomino.org.uk with local-esmtp (Exim 4.72) (envelope-from ) id 1PQ24E-0004sa-RZ; Tue, 07 Dec 2010 18:15:10 +0000 Date: Tue, 7 Dec 2010 18:15:10 +0000 (UTC) From: "Joseph S. Myers" To: gcc-patches@gcc.gnu.org cc: green@moxielogic.com Subject: svr4.h avoidance: moxie 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 moxie-*-elf and moxie-*-uclinux* from using svr4.h, defining the macros used from that header in moxie.h instead. The same simplified LINK_SPEC as in the fr30 patch is used. There is a third moxie target that doesn't use svr4.h, moxie-*-rtems*, although some RTEMS targets do use svr4.h. To avoid perturbing that target I made moxie/rtems.h undefine the macros added to moxie.h. At least as regards the standard typedefs I wonder if it was actually deliberate that RTEMS use different types (through not using svr4.h). If not, and if the moxie maintainers consider it OK to break ABI compatibility for C++ code (since the choice of int versus long affects name mangling), the moxie maintainers might wish to adjust this port to use the same types for all target OSes. Tested building cc1 and xgcc for crosses to moxie-elf, moxie-uclinux and moxie-rtems. OK to commit? 2010-12-07 Joseph Myers * config/moxie/moxie.h (LINK_SPEC, SIZE_TYPE, PTRDIFF_TYPE, WCHAR_TYPE, WCHAR_TYPE_SIZE): Define. * config/moxie/rtems.h (LINK_SPEC, SIZE_TYPE, PTRDIFF_TYPE, WCHAR_TYPE, WCHAR_TYPE_SIZE): Undefine. * config.gcc (moxie-*-elf, moxie-*-uclinux*): Don't use svr4.h. diff -rupN --exclude=.svn gcc-mainline-3/gcc/config/moxie/moxie.h gcc-mainline/gcc/config/moxie/moxie.h --- gcc-mainline-3/gcc/config/moxie/moxie.h 2010-12-06 10:31:16.000000000 -0800 +++ gcc-mainline/gcc/config/moxie/moxie.h 2010-12-07 09:43:22.000000000 -0800 @@ -48,6 +48,10 @@ #undef LIB_SPEC #define LIB_SPEC "%{!shared:%{!symbolic:-lc}}" +#undef LINK_SPEC +#define LINK_SPEC "%{h*} %{v:-V} \ + %{static:-Bstatic} %{shared:-shared} %{symbolic:-Bsymbolic}" + /* Layout of Source Language Data Types */ #define INT_TYPE_SIZE 32 @@ -61,6 +65,18 @@ #define DEFAULT_SIGNED_CHAR 1 +#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 + /* Registers... $fp - frame pointer diff -rupN --exclude=.svn gcc-mainline-3/gcc/config/moxie/rtems.h gcc-mainline/gcc/config/moxie/rtems.h --- gcc-mainline-3/gcc/config/moxie/rtems.h 2010-07-30 10:03:15.000000000 -0700 +++ gcc-mainline/gcc/config/moxie/rtems.h 2010-12-07 09:42:50.000000000 -0800 @@ -27,3 +27,9 @@ along with GCC; see the file COPYING3. builtin_assert ("system=rtems"); \ } \ while (0) + +#undef LINK_SPEC +#undef SIZE_TYPE +#undef PTRDIFF_TYPE +#undef WCHAR_TYPE +#undef WCHAR_TYPE_SIZE 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-07 09:49:10.000000000 -0800 @@ -979,14 +979,14 @@ frv-*-*linux*) moxie-*-elf) gas=yes gnu_ld=yes - tm_file="dbxelf.h elfos.h svr4.h ${tm_file}" + tm_file="dbxelf.h elfos.h ${tm_file}" extra_parts="crti.o crtn.o crtbegin.o crtend.o" tmake_file="${tmake_file} moxie/t-moxie moxie/t-moxie-softfp soft-fp/t-softfp" ;; moxie-*-uclinux*) gas=yes gnu_ld=yes - tm_file="dbxelf.h elfos.h svr4.h ${tm_file} linux.h glibc-stdint.h moxie/uclinux.h" + tm_file="dbxelf.h elfos.h ${tm_file} linux.h glibc-stdint.h moxie/uclinux.h" extra_parts="crti.o crtn.o crtbegin.o crtend.o" tmake_file="${tmake_file} moxie/t-moxie moxie/t-moxie-softfp soft-fp/t-softfp" tm_defines="${tm_defines} DEFAULT_LIBC=LIBC_UCLIBC"