Patchwork Add Interix options from specs to interix.opt

login
register
mail settings
Submitter Joseph S. Myers
Date Dec. 17, 2010, 4:54 p.m.
Message ID <Pine.LNX.4.64.1012171646150.5744@digraph.polyomino.org.uk>
Download mbox | patch
Permalink /patch/75924/
State New
Headers show

Comments

Joseph S. Myers - Dec. 17, 2010, 4:54 p.m.
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 Interix options matched by specs to a new interix.opt file.

There are two such options added, -dynamic and -G (the form as a linker 
option with no argument meaning -shared, not the form used on some targets 
for small data).  There was also a spec %{soname*:--soname %*}, but since 
-soname wasn't listed as taking an argument for this target I removed the 
spec as non-functional (it would accept options such as -sonamefoo.so 
which clearly seems not as intended, whereas -soname=foo.so would put the 
initial '=' in the soname) rather than adding the option to the .opt file.

Tested building options.c and options.h for cross to i686-interix3 (as 
previously noted, cc1 doesn't build and I've suggested this target be 
considered for deprecation) and committed as preapproved cleanup to an 
unmaintained target (there is no Interix OS target maintainer).

Patch

Index: gcc/ChangeLog
===================================================================
--- gcc/ChangeLog	(revision 167991)
+++ gcc/ChangeLog	(revision 167992)
@@ -1,3 +1,9 @@ 
+2010-12-17  Joseph Myers  <joseph@codesourcery.com>
+
+	* config/interix.opt: New.
+	* config/interix.h (LINK_SPEC): Don't handle -soname*.
+	* config.gcc (i[34567]86-*-interix3*): Use interix.opt.
+
 2010-12-17  Andrew Stubbs  <ams@codesourcery.com>
 
 	* config/arm/arm.md (maddhisi4, *maddhidi4): Use the canonical
Index: gcc/config.gcc
===================================================================
--- gcc/config.gcc	(revision 167991)
+++ gcc/config.gcc	(revision 167992)
@@ -1522,7 +1522,7 @@ 
 i[34567]86-*-interix3*)
 	tm_file="${tm_file} i386/unix.h i386/bsd.h i386/gas.h i386/i386-interix.h i386/i386-interix3.h interix.h interix3.h"
 	tmake_file="${tmake_file} i386/t-interix"
-	extra_options="${extra_options} rpath.opt"
+	extra_options="${extra_options} rpath.opt interix.opt"
 	extra_objs=winnt.o
 	target_gtfiles="\$(srcdir)/config/i386/winnt.c"
 	if test x$enable_threads = xyes ; then
Index: gcc/config/interix.opt
===================================================================
--- gcc/config/interix.opt	(revision 0)
+++ gcc/config/interix.opt	(revision 167992)
@@ -0,0 +1,33 @@ 
+; Interix options.
+
+; Copyright (C) 2010
+; 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.
+
+dynamic
+Driver
+
+G
+Driver
+
+; This comment is to ensure we retain the blank line above.
Index: gcc/config/interix.h
===================================================================
--- gcc/config/interix.h	(revision 167991)
+++ gcc/config/interix.h	(revision 167992)
@@ -50,7 +50,6 @@ 
 		   %{shared:--shared -Bdynamic} \
 		   %{G:--shared -Bdynamic} \
 		   %{symbolic:--shared -Bsymbolic -Bdynamic} \
-		   %{soname*:--soname %*} \
    		   %{rpath*:--rpath %*} \
 		   "