This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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.

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.

-- 
Joseph S. Myers
joseph@codesourcery.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]