diff mbox

Add SPARC Solaris options from specs to new sparc/sol2.opt

Message ID Pine.LNX.4.64.1102040140400.18971@digraph.polyomino.org.uk
State New
Headers show

Commit Message

Joseph Myers Feb. 4, 2011, 1:42 a.m. UTC
In preparation for the driver only accepting options listed in .opt
files, and not other options that simply happen to match some spec,
this patch adds options from specs in sparc/sol2-bi.h to a new
sparc/sol2.opt.

The options in question are -sun4 and -target.  As noted in
<http://gcc.gnu.org/ml/gcc-patches/2011-01/msg00909.html>, where I
removed them for non-Solaris targets, I'm not sure they make sense
even for Solaris; an alternative would be to remove the specs in
question from sol2-bi.h.

In particular, one comment removed by that previous patch said
"Prevent error on `-sun4' and `-target sun4' options.", but "-target
sun4" would never have worked because this was not marked as an option
that takes an argument.  So if that is the form with which
compatibility was intended, there has never been actual compatibility
for -target for Solaris.  Note that old versions of GCC did define
WORD_SWITCH_TAKES_ARG in sparc.h to make -target take an argument -
and then undefined it in sysv4.h with the comment 'Undefine some
symbols which are defined in "sparc.h" but which are appropriate only
for SunOS 4.x, and not for svr4.', so that particular option could be
a left-over relic of SunOS 4 support.

Tested building cc1 and xgcc for cross to sparc-solaris2.8.  OK to
commit?  (Or, in the alternative, OK to commit the obvious patch to
remove %{sun4:} %{target:} from specs in sol2-bi.h?)

2011-02-03  Joseph Myers  <joseph@codesourcery.com>

	* config/sparc/sol2.opt: New.
	* config.gcc (sparc*-*-solaris2*): Use sparc/sol2.opt.

Comments

Eric Botcazou Feb. 4, 2011, 8:55 a.m. UTC | #1
> Tested building cc1 and xgcc for cross to sparc-solaris2.8.  OK to
> commit?  (Or, in the alternative, OK to commit the obvious patch to
> remove %{sun4:} %{target:} from specs in sol2-bi.h?)

I'd personally be in favor of the latter solution.  What do you think, Rainer?
Rainer Orth Feb. 4, 2011, 3:05 p.m. UTC | #2
Eric Botcazou <ebotcazou@adacore.com> writes:

>> Tested building cc1 and xgcc for cross to sparc-solaris2.8.  OK to
>> commit?  (Or, in the alternative, OK to commit the obvious patch to
>> remove %{sun4:} %{target:} from specs in sol2-bi.h?)
>
> I'd personally be in favor of the latter solution.  What do you think, Rainer?

Me too.  I couldn't find any hint of -sun4 or -target (with or without
sun4) in not-too-ancient Studio compilers.  This stuff seems like
ancient (as in SunOS 4) history to me, so good riddance.

Thanks.
	Rainer
diff mbox

Patch

Index: config.gcc
===================================================================
--- config.gcc	(revision 169769)
+++ config.gcc	(working copy)
@@ -2552,6 +2552,7 @@  sparc*-*-solaris2*)
 		;;
 	esac
 	tm_file="${tm_file} sparc/sol2-bi.h"
+	extra_options="${extra_options} sparc/sol2.opt"
 	if test x$gas = xyes; then
 		tm_file="${tm_file} sparc/sol2-gas.h sparc/sol2-gas-bi.h"
 	fi
Index: config/sparc/sol2.opt
===================================================================
--- config/sparc/sol2.opt	(revision 0)
+++ config/sparc/sol2.opt	(revision 0)
@@ -0,0 +1,33 @@ 
+; SPARC Solaris options.
+
+; Copyright (C) 2011
+; Free Software Foundation, Inc.
+;
+; This file is part of GCC.
+;
+; GCC is free software; you can redistribute it and/or modify it under
+; the terms of the GNU General Public License as published by the Free
+; Software Foundation; either version 3, or (at your option) any later
+; version.
+;
+; GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+; WARRANTY; without even the implied warranty of MERCHANTABILITY or
+; FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+; for more details.
+;
+; You should have received a copy of the GNU General Public License
+; along with GCC; see the file COPYING3.  If not see
+; <http://www.gnu.org/licenses/>.
+
+; See the GCC internals manual (options.texi) for a description of
+; this file's format.
+
+; Please try to keep this file in ASCII collating order.
+
+sun4
+Driver
+
+target
+Driver
+
+; This comment is to ensure we retain the blank line above.