From patchwork Sat Feb 5 00:41:50 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joseph Myers X-Patchwork-Id: 81986 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 5F01DB7120 for ; Sat, 5 Feb 2011 11:42:02 +1100 (EST) Received: (qmail 31396 invoked by alias); 5 Feb 2011 00:42:00 -0000 Received: (qmail 31384 invoked by uid 22791); 5 Feb 2011 00:41:59 -0000 X-SWARE-Spam-Status: No, hits=-1.8 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; Sat, 05 Feb 2011 00:41:54 +0000 Received: (qmail 27320 invoked from network); 5 Feb 2011 00:41:52 -0000 Received: from unknown (HELO digraph.polyomino.org.uk) (joseph@127.0.0.2) by mail.codesourcery.com with ESMTPA; 5 Feb 2011 00:41:52 -0000 Received: from jsm28 (helo=localhost) by digraph.polyomino.org.uk with local-esmtp (Exim 4.72) (envelope-from ) id 1PlWDm-0002TZ-Nz; Sat, 05 Feb 2011 00:41:50 +0000 Date: Sat, 5 Feb 2011 00:41:50 +0000 (UTC) From: "Joseph S. Myers" To: gcc-patches@gcc.gnu.org cc: rth@redhat.com, davem@redhat.com, jakub@redhat.com, ebotcazou@libertysurf.fr, Nathan Sidwell , ljrittle@acm.org Subject: Avoid bad ASM_SPEC specs for SPARC VxWorks and FreeBSD 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 I previously proposed removal of various options from ASM_SPEC , which was approved except for sparc/sysv4.h. This left specs in sparc/sysv4.h that accepted the -Ym, option, which is not actually a valid assembler option for the GNU assembler (although it is for the Solaris system assembler). This definition of ASM_SPEC turns out to be used only for FreeBSD and VxWorks, where non-GNU assemblers are irrelevant. Thus, this patch adds definitions of ASM_SPEC without the irrelevant options for those targets. (Consequently, the definition of ASM_SPEC in sparc/sysv4.h is unused after this patch, but as per is not removed.) Tested building cc1 and xgcc for crosses to sparc-wrs-vxworks and sparc64-freebsd8. OK to commit? 2011-02-04 Joseph Myers * config/sparc/freebsd.h (ASM_SPEC): Define. * config/sparc/vxworks.h (ASM_SPEC): Define. Index: gcc/config/sparc/freebsd.h =================================================================== --- gcc/config/sparc/freebsd.h (revision 169841) +++ gcc/config/sparc/freebsd.h (working copy) @@ -1,5 +1,5 @@ /* Definitions for Sun SPARC64 running FreeBSD using the ELF format - Copyright (C) 2001, 2002, 2004, 2005, 2006, 2007, 2010 + Copyright (C) 2001, 2002, 2004, 2005, 2006, 2007, 2010, 2011 Free Software Foundation, Inc. Contributed by David E. O'Brien and BSDi. @@ -30,6 +30,9 @@ along with GCC; see the file COPYING3. #define CPP_CPU64_DEFAULT_SPEC \ "-D__sparc64__ -D__sparc_v9__ -D__sparcv9 -D__arch64__" +#undef ASM_SPEC +#define ASM_SPEC "%{fpic|fPIC|fpie|fPIE:-K PIC} %(asm_cpu)" + #define LINK_SPEC "%(link_arch) \ %{!mno-relax:%{!r:-relax}} \ %{p:%nconsider using '-pg' instead of '-p' with gprof(1)} \ Index: gcc/config/sparc/vxworks.h =================================================================== --- gcc/config/sparc/vxworks.h (revision 169841) +++ gcc/config/sparc/vxworks.h (working copy) @@ -1,6 +1,6 @@ /* Definitions of target machine for GNU compiler, for SPARC targeting the VxWorks run time environment. - Copyright (C) 2007, 2010 Free Software Foundation, Inc. + Copyright (C) 2007, 2010, 2011 Free Software Foundation, Inc. This file is part of GCC. @@ -33,6 +33,9 @@ along with GCC; see the file COPYING3. #undef CPP_SUBTARGET_SPEC #define CPP_SUBTARGET_SPEC VXWORKS_ADDITIONAL_CPP_SPEC +#undef ASM_SPEC +#define ASM_SPEC "%{fpic|fPIC|fpie|fPIE:-K PIC} %(asm_cpu)" + #undef LIB_SPEC #define LIB_SPEC VXWORKS_LIB_SPEC #undef LINK_SPEC