Patchwork Clean up AS_NEEDS_DASH_FOR_PIPED_INPUT definitions

login
register
mail settings
Submitter Joseph S. Myers
Date Dec. 4, 2010, 12:58 a.m.
Message ID <Pine.LNX.4.64.1012040056270.21674@digraph.polyomino.org.uk>
Download mbox | patch
Permalink /patch/74227/
State New
Headers show

Comments

Joseph S. Myers - Dec. 4, 2010, 12:58 a.m.
This patch cleans up AS_NEEDS_DASH_FOR_PIPED_INPUT definitions in GCC,
eliminating that in svr4.h.

Before this patch, this macro is defined by the following headers:
netbsd-aout.h openbsd.h svr4.h m68k/netbsd-elf.h m68k/openbsd.h
mips/openbsd.h sparc/sparc.h.  It is certainly not correct for the GNU
assembler, which covers many of the GNU/Linux, bare-metal and other
targets using svr4.h, such definitions are never appropriate for
headers like sparc.h (that's confusing a CPU with a particular
assembler implementation for the CPU) and the definition in openbsd.h
means no definition is needed in the other OpenBSD headers.  Since at
least some ELF-based NetBSD targets (e.g. x86) do not define this
macro, it seems reasonable to suppose it is not needed for ELF-based
NetBSD either.

Examining the targets using svr4.h suggests the only ones potentially
using a non-GNU assembler for which this macro might be needed are
Solaris and IA64 HP-UX.  Thus, this patch adds the definition for
those targets (non-GNU assembler only) and removes it from svr4.h and
the other places indicated above.  It's quite possible that IA64 HP-UX
doesn't actually need it, given that PA HP-UX doesn't define it.

I have not tried to ascertain whether this macro is needed at all -
that is, whether there are assemblers (supported by GCC) that require
"-" here and those that do not support "-" (since if there is a safe
option supported by all assemblers, that should just be used
unconditionally).

Bootstrapped with no regressions on x86_64-unknown-linux-gnu.  Also
tested building cc1 and xgcc for crosses to: ia64-hp-hpux11.23
m68k-netbsdelf m68k-openbsd mips-openbsd sparc-solaris2.10.
(m68k-netbsdelf fails with "collect2.c:1679: undefined reference to
`m68k_cpu_flags'" when linking collect2, an unrelated problem coming
from a TARGET_VERISON call; TARGET_VERSION itself is pretty useless.
mips-openbsd fails with "mips.c:6092: undefined reference to
`ASM_OUTPUT_DEF'", again an unrelated problem.)  OK to commit?

2010-12-03  Joseph Myers  <joseph@codesourcery.com>

	* config/ia64/hpux.h (AS_NEEDS_DASH_FOR_PIPED_INPUT): Define for
	non-GNU assembler.
	* config/m68k/netbsd-elf.h (AS_NEEDS_DASH_FOR_PIPED_INPUT):
	Remove.
	* config/m68k/openbsd.h (AS_NEEDS_DASH_FOR_PIPED_INPUT): Remove.
	* config/mips/openbsd.h (AS_NEEDS_DASH_FOR_PIPED_INPUT): Remove.
	* config/sol2.h (AS_NEEDS_DASH_FOR_PIPED_INPUT): Define for
	non-GNU assembler.
	* config/sparc/sparc.h (AS_NEEDS_DASH_FOR_PIPED_INPUT): Remove.
	* config/svr4.h (AS_NEEDS_DASH_FOR_PIPED_INPUT): Remove.
Rainer Orth - Dec. 6, 2010, 5:55 p.m.
"Joseph S. Myers" <joseph@codesourcery.com> writes:

> Examining the targets using svr4.h suggests the only ones potentially
> using a non-GNU assembler for which this macro might be needed are
> Solaris and IA64 HP-UX.  Thus, this patch adds the definition for
> those targets (non-GNU assembler only) and removes it from svr4.h and
> the other places indicated above.  It's quite possible that IA64 HP-UX
> doesn't actually need it, given that PA HP-UX doesn't define it.
>
> I have not tried to ascertain whether this macro is needed at all -
> that is, whether there are assemblers (supported by GCC) that require
> "-" here and those that do not support "-" (since if there is a safe
> option supported by all assemblers, that should just be used
> unconditionally).

Sun as needs - from Solaris 8 to 11 inclusively, both SPARC and x86, and
gas can handle it, so the config/sol2.h part is ok.

Thanks.
	Rainer
Ian Taylor - Dec. 9, 2010, 4:25 p.m.
On Fri, Dec 3, 2010 at 4:58 PM, Joseph S. Myers <joseph@codesourcery.com> wrote:

> 2010-12-03  Joseph Myers  <joseph@codesourcery.com>
>
>        * config/ia64/hpux.h (AS_NEEDS_DASH_FOR_PIPED_INPUT): Define for
>        non-GNU assembler.
>        * config/m68k/netbsd-elf.h (AS_NEEDS_DASH_FOR_PIPED_INPUT):
>        Remove.
>        * config/m68k/openbsd.h (AS_NEEDS_DASH_FOR_PIPED_INPUT): Remove.
>        * config/mips/openbsd.h (AS_NEEDS_DASH_FOR_PIPED_INPUT): Remove.
>        * config/sol2.h (AS_NEEDS_DASH_FOR_PIPED_INPUT): Define for
>        non-GNU assembler.
>        * config/sparc/sparc.h (AS_NEEDS_DASH_FOR_PIPED_INPUT): Remove.
>        * config/svr4.h (AS_NEEDS_DASH_FOR_PIPED_INPUT): Remove.

This is OK.

Thanks.

Ian

Patch

Index: gcc/config/sparc/sparc.h
===================================================================
--- gcc/config/sparc/sparc.h	(revision 167432)
+++ gcc/config/sparc/sparc.h	(working copy)
@@ -453,8 +453,6 @@  extern enum cmodel sparc_cmodel;
 %{!pg:%{!p:%{fpic|fPIC|fpie|fPIE:-k}}} %{keep-local-as-symbols:-L} \
 %(asm_cpu) %(asm_relax)"
 
-#define AS_NEEDS_DASH_FOR_PIPED_INPUT
-
 /* This macro defines names of additional specifications to put in the specs
    that can be used in various specifications like CC1_SPEC.  Its definition
    is an initializer with a subgrouping for each command option.
Index: gcc/config/sol2.h
===================================================================
--- gcc/config/sol2.h	(revision 167432)
+++ gcc/config/sol2.h	(working copy)
@@ -291,6 +291,9 @@  __enable_execute_stack (void *addr)					
 #ifndef USE_GAS
 #undef TARGET_ASM_ASSEMBLE_VISIBILITY
 #define TARGET_ASM_ASSEMBLE_VISIBILITY solaris_assemble_visibility
+
+#define AS_NEEDS_DASH_FOR_PIPED_INPUT
+
 #endif
 
 extern GTY(()) tree solaris_pending_aligns;
Index: gcc/config/svr4.h
===================================================================
--- gcc/config/svr4.h	(revision 167432)
+++ gcc/config/svr4.h	(working copy)
@@ -72,8 +72,6 @@  see the files COPYING3 and COPYING.RUNTI
 #undef  ASM_SPEC
 #define ASM_SPEC SVR4_ASM_SPEC
 
-#define AS_NEEDS_DASH_FOR_PIPED_INPUT
-
 /* Under svr4, the normal location of the `ld' and `as' programs is the
    /usr/ccs/bin directory.  */
 
Index: gcc/config/ia64/hpux.h
===================================================================
--- gcc/config/ia64/hpux.h	(revision 167432)
+++ gcc/config/ia64/hpux.h	(working copy)
@@ -68,6 +68,10 @@  do {							\
 #undef  ASM_EXTRA_SPEC
 #define ASM_EXTRA_SPEC "%{milp32:-milp32} %{mlp64:-mlp64}"
 
+#ifndef USE_GAS
+#define AS_NEEDS_DASH_FOR_PIPED_INPUT
+#endif
+
 #undef ENDFILE_SPEC
 
 #undef STARTFILE_SPEC
Index: gcc/config/m68k/openbsd.h
===================================================================
--- gcc/config/m68k/openbsd.h	(revision 167432)
+++ gcc/config/m68k/openbsd.h	(working copy)
@@ -1,5 +1,6 @@ 
 /* Configuration file for an m68k OpenBSD target.
-   Copyright (C) 1999, 2002, 2003, 2007 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2002, 2003, 2007, 2009, 2010
+   Free Software Foundation, Inc.
 
 This file is part of GCC.
 
@@ -36,8 +37,6 @@  along with GCC; see the file COPYING3.  
 #undef ASM_SPEC
 #define ASM_SPEC "%(asm_cpu_spec) %{fpic|fpie:-k} %{fPIC|fPIE:-k -K}"
 
-#define AS_NEEDS_DASH_FOR_PIPED_INPUT
-
 /* Layout of source language data types.  */
 
 /* This must agree with <machine/ansi.h> */
Index: gcc/config/m68k/netbsd-elf.h
===================================================================
--- gcc/config/m68k/netbsd-elf.h	(revision 167432)
+++ gcc/config/m68k/netbsd-elf.h	(working copy)
@@ -1,7 +1,8 @@ 
 /* Definitions of target machine for GNU compiler,
    for m68k (including m68010) NetBSD platforms using the
    ELF object format.
-   Copyright (C) 2002, 2003, 2004, 2006, 2007 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2003, 2004, 2006, 2007, 2009, 2010
+   Free Software Foundation, Inc.
    Contributed by Wasabi Systems. Inc.
 
    This file is derived from <m68k/m68kv4.h>, <m68k/m68kelf.h>,
@@ -73,8 +74,6 @@  along with GCC; see the file COPYING3.  
 #undef ASM_SPEC
 #define ASM_SPEC "%(asm_cpu_spec) %{fpic|fpie:-k} %{fPIC|fPIE:-k -K}"
 
-#define AS_NEEDS_DASH_FOR_PIPED_INPUT
-
 /* Provide a LINK_SPEC appropriate for a NetBSD/m68k ELF target.  */
 
 #undef LINK_SPEC
Index: gcc/config/mips/openbsd.h
===================================================================
--- gcc/config/mips/openbsd.h	(revision 167432)
+++ gcc/config/mips/openbsd.h	(working copy)
@@ -1,5 +1,6 @@ 
 /* Configuration for  a MIPS ABI32 OpenBSD target.
-   Copyright (C) 1999, 2003, 2004, 2007, 2008 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2003, 2004, 2007, 2008, 2009, 2010
+   Free Software Foundation, Inc.
 
 This file is part of GCC.
 
@@ -23,8 +24,6 @@  along with GCC; see the file COPYING3.  
 #undef SUBTARGET_ASM_SPEC
 #define SUBTARGET_ASM_SPEC "%{fPIC|fPIE:-KPIC}"
 
-#define AS_NEEDS_DASH_FOR_PIPED_INPUT
-
 /* CPP specific OpenBSD specs.  */
 #undef SUBTARGET_CPP_SPEC
 #define SUBTARGET_CPP_SPEC OBSD_CPP_SPEC