Patchwork Avoid bad ASM_SPEC specs for SPARC VxWorks and FreeBSD

login
register
mail settings
Submitter Joseph S. Myers
Date Feb. 5, 2011, 12:41 a.m.
Message ID <Pine.LNX.4.64.1102050040180.5791@digraph.polyomino.org.uk>
Download mbox | patch
Permalink /patch/81986/
State New
Headers show

Comments

Joseph S. Myers - Feb. 5, 2011, 12:41 a.m.
I previously proposed removal of various options from ASM_SPEC
<http://gcc.gnu.org/ml/gcc-patches/2011-01/msg00891.html>
<http://gcc.gnu.org/ml/gcc-patches/2011-01/msg00913.html>
<http://gcc.gnu.org/ml/gcc-patches/2011-01/msg00914.html>, 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
<http://gcc.gnu.org/ml/gcc-patches/2011-01/msg00935.html> 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  <joseph@codesourcery.com>

	* config/sparc/freebsd.h (ASM_SPEC): Define.
	* config/sparc/vxworks.h (ASM_SPEC): Define.
Eric Botcazou - Feb. 5, 2011, 8:30 a.m.
> Tested building cc1 and xgcc for crosses to sparc-wrs-vxworks and
> sparc64-freebsd8.  OK to commit?
>
> 2011-02-04  Joseph Myers  <joseph@codesourcery.com>
>
> 	* config/sparc/freebsd.h (ASM_SPEC): Define.
> 	* config/sparc/vxworks.h (ASM_SPEC): Define.

OK, thanks.
Nathan Sidwell - Feb. 7, 2011, 7:15 a.m.
On 02/05/11 00:41, Joseph S. Myers wrote:

> Tested building cc1 and xgcc for crosses to sparc-wrs-vxworks and
> sparc64-freebsd8.  OK to commit?
>
> 2011-02-04  Joseph Myers<joseph@codesourcery.com>
>
> 	* config/sparc/freebsd.h (ASM_SPEC): Define.
> 	* config/sparc/vxworks.h (ASM_SPEC): Define.

vxworks ok.

nathan

Patch

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 <obrien@FreeBSD.org> 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