From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14365 invoked by alias); 14 Jan 2011 00:08:34 -0000 Received: (qmail 14350 invoked by uid 22791); 14 Jan 2011 00:08:32 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,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; Fri, 14 Jan 2011 00:08:27 +0000 Received: (qmail 12323 invoked from network); 14 Jan 2011 00:08:25 -0000 Received: from unknown (HELO digraph.polyomino.org.uk) (joseph@127.0.0.2) by mail.codesourcery.com with ESMTPA; 14 Jan 2011 00:08:25 -0000 Received: from jsm28 (helo=localhost) by digraph.polyomino.org.uk with local-esmtp (Exim 4.72) (envelope-from ) id 1PdXDM-0002PR-Jg; Fri, 14 Jan 2011 00:08:24 +0000 Date: Fri, 14 Jan 2011 00:10:00 -0000 From: "Joseph S. Myers" To: gcc-patches@gcc.gnu.org cc: hp@axis.com Subject: [09/25] Specs cleanup: CRIS In-Reply-To: Message-ID: References: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2011-01/txt/msg00901.txt.bz2 This patch fixes some issues with the specs for CRIS targets. * Various specs checked for a -cpu option that should have been -mcpu. (These could probably be simplified further by making -mcpu= a .opt alias for -march=, after which specs wouldn't need to check for it at all, but I'm not doing that in this patch series.) * cris/linux.h had specs passing -rpath-link options in some cases (-B, or not -nostdlib). This is not needed for any properly configured cross toolchain (for GNU/Linux targets, that means using a sysroot). And if it were appropriate, it should be done for all GNU/Linux targets since there is nothing meaningfully CRIS-specific about it. * cris/link.h had a spec %{shlib:-Bdynamic} - that is, defining a -shlib option to mean that -Bdynamic is passed to the linker. Again, this is not logically CRIS-specific; if there were a need for such an option rather than -Wl,-Bdynamic (and -Bstatic and -Bdynamic are generally passed in pairs) it should be for all GNU/Linux targets. This undocumented option is removed in this patch. OK to commit? 2011-01-13 Joseph Myers * config/cris/cris.h (ASM_SPEC, CRIS_ASM_SUBTARGET_SPEC): Check for mcpu not cpu. * config/cris/linux.h (CRIS_CPP_SUBTARGET_SPEC, CRIS_CC1_SUBTARGET_SPEC, CRIS_ASM_SUBTARGET_SPEC): Check for mcpu not cpu. (CRIS_LINK_SUBTARGET_SPEC): Don't generate -rpath-link options. Don't handle -shlib. diff -rupN --exclude=.svn gcc-mainline-8/gcc/config/cris/cris.h gcc-mainline/gcc/config/cris/cris.h --- gcc-mainline-8/gcc/config/cris/cris.h 2010-12-20 12:57:45.000000000 -0800 +++ gcc-mainline/gcc/config/cris/cris.h 2011-01-12 14:16:34.000000000 -0800 @@ -193,12 +193,12 @@ extern int cris_cpu_version; #define ASM_SPEC \ MAYBE_AS_NO_MUL_BUG_ABORT \ "%(asm_subtarget)\ - %{march=*:%{cpu=*:%edo not specify both -march=... and -mcpu=...}}\ + %{march=*:%{mcpu=*:%edo not specify both -march=... and -mcpu=...}}\ %{march=v32:--march=v32} %{mcpu=v32:--march=v32}" /* For the cris-*-elf subtarget. */ #define CRIS_ASM_SUBTARGET_SPEC \ - "--em=criself %{!march=*:%{!cpu=*:" CRIS_DEFAULT_ASM_ARCH_OPTION "}}" + "--em=criself %{!march=*:%{!mcpu=*:" CRIS_DEFAULT_ASM_ARCH_OPTION "}}" /* FIXME: We should propagate the -melf option to make the criself "emulation" unless a linker script is provided (-T*), but I don't know diff -rupN --exclude=.svn gcc-mainline-8/gcc/config/cris/linux.h gcc-mainline/gcc/config/cris/linux.h --- gcc-mainline-8/gcc/config/cris/linux.h 2010-12-09 09:41:27.000000000 -0800 +++ gcc-mainline/gcc/config/cris/linux.h 2011-01-12 14:17:47.000000000 -0800 @@ -56,21 +56,21 @@ along with GCC; see the file COPYING3. #if TARGET_CPU_DEFAULT == 32 # define CRIS_CPP_SUBTARGET_SPEC \ "%{pthread:-D_REENTRANT}\ - %{!march=*:%{!cpu=*:-D__arch_v32 -D__CRIS_arch_version=32}}" + %{!march=*:%{!mcpu=*:-D__arch_v32 -D__CRIS_arch_version=32}}" #else # define CRIS_CPP_SUBTARGET_SPEC \ "%{pthread:-D_REENTRANT}\ - %{!march=*:%{!cpu=*:-D__arch_v10 -D__CRIS_arch_version=10}}" + %{!march=*:%{!mcpu=*:-D__arch_v10 -D__CRIS_arch_version=10}}" #endif #undef CRIS_CC1_SUBTARGET_SPEC #if TARGET_CPU_DEFAULT == 32 # define CRIS_CC1_SUBTARGET_SPEC \ - "%{!march=*:%{!cpu=*:-march=v32}}" + "%{!march=*:%{!mcpu=*:-march=v32}}" #define CRIS_SUBTARGET_DEFAULT_ARCH MASK_AVOID_GOTPLT #else # define CRIS_CC1_SUBTARGET_SPEC \ - "%{!march=*:%{!cpu=*:-march=v10}}" + "%{!march=*:%{!mcpu=*:-march=v10}}" #define CRIS_SUBTARGET_DEFAULT_ARCH 0 #endif @@ -78,13 +78,13 @@ along with GCC; see the file COPYING3. #if TARGET_CPU_DEFAULT == 32 # define CRIS_ASM_SUBTARGET_SPEC \ "--em=criself \ - %{!march=*:%{!cpu=*:--march=v32}} \ + %{!march=*:%{!mcpu=*:--march=v32}} \ %{!fleading-underscore:--no-underscore}\ %{fPIC|fpic|fPIE|fpie: --pic}" #else # define CRIS_ASM_SUBTARGET_SPEC \ "--em=criself \ - %{!march=*:%{!cpu=*:--march=v10}} \ + %{!march=*:%{!mcpu=*:--march=v10}} \ %{!fleading-underscore:--no-underscore}\ %{fPIC|fpic|fPIE|fpie: --pic}" #endif @@ -105,15 +105,11 @@ along with GCC; see the file COPYING3. #define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1" -/* We need an -rpath-link to ld.so.1, and presumably to each directory - specified with -B. */ #undef CRIS_LINK_SUBTARGET_SPEC #define CRIS_LINK_SUBTARGET_SPEC \ "-mcrislinux\ - %{B*:-rpath-link %*}\ - %{!nostdlib:-rpath-link ../sys-include/asm/../../lib%s}\ %{shared} %{static}\ - %{symbolic:-Bdynamic} %{shlib:-Bdynamic} %{static:-Bstatic}\ + %{symbolic:-Bdynamic} %{static:-Bstatic}\ %{!shared:%{!static:\ %{rdynamic:-export-dynamic}\ -dynamic-linker " LINUX_DYNAMIC_LINKER "}}\ -- Joseph S. Myers joseph@codesourcery.com