Patchwork Add OpenBSD options from specs to openbsd.opt

login
register
mail settings
Submitter Joseph S. Myers
Date Dec. 30, 2010, 10:22 p.m.
Message ID <Pine.LNX.4.64.1012302221170.30514@digraph.polyomino.org.uk>
Download mbox | patch
Permalink /patch/77022/
State New
Headers show

Comments

Joseph S. Myers - Dec. 30, 2010, 10:22 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 OpenBSD options matched by specs in openbsd*.h to a
new .opt file openbsd.opt.

Tested building cc1 and xgcc for crosses to: alpha-openbsd
i686-openbsd3.0 i686-openbsd m68k-openbsd mips-openbsd sparc64-openbsd
vax-openbsd.  (Pre-existing failures: i686-openbsd3.0 PR 47098,
mips-openbsd PR 47110, vax-openbsd PR 47122.)  Committed as
preapproved since there are no OpenBSD target maintainers.

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

	* config/openbsd.opt: New.
	* config.gcc (alpha*-*-openbsd*,
	i[34567]86-*-openbsd2.*|i[34567]86-*openbsd3.[0123],
	i[34567]86-*-openbsd*, m68k*-*-openbsd*, mips*-*-openbsd*,
	sparc64-*-openbsd*, vax-*-openbsd*): Use openbsd.opt.

Patch

Index: gcc/config.gcc
===================================================================
--- gcc/config.gcc	(revision 168348)
+++ gcc/config.gcc	(working copy)
@@ -717,6 +717,7 @@  alpha*-*-netbsd*)
 alpha*-*-openbsd*)
 	tm_defines="${tm_defines} OBSD_HAS_DECLARE_FUNCTION_NAME OBSD_HAS_DECLARE_FUNCTION_SIZE OBSD_HAS_DECLARE_OBJECT"
 	tm_file="alpha/alpha.h alpha/elf.h openbsd.h openbsd-stdint.h alpha/openbsd.h openbsd-libpthread.h"
+	extra_options="${extra_options} openbsd.opt"
 	# default x-alpha is only appropriate for dec-osf.
 	target_cpu_default="MASK_GAS"
 	tmake_file="${tmake_file} alpha/t-alpha alpha/t-ieee"
@@ -1207,6 +1208,7 @@  x86_64-*-netbsd*)
 	;;
 i[34567]86-*-openbsd2.*|i[34567]86-*openbsd3.[0123])
 	tm_file="i386/i386.h i386/unix.h i386/bsd.h i386/gas.h i386/gstabs.h openbsd-oldgas.h openbsd.h i386/openbsd.h"
+	extra_options="${extra_options} openbsd.opt"
 	# needed to unconfuse gdb
 	tmake_file="${tmake_file} t-libc-ok t-openbsd i386/t-openbsd"
 	# we need collect2 until our bug is fixed...
@@ -1215,6 +1217,7 @@  i[34567]86-*-openbsd2.*|i[34567]86-*open
 i[34567]86-*-openbsd*)
 	tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h"
 	tm_file="${tm_file} openbsd.h openbsd-stdint.h openbsd-libpthread.h i386/openbsdelf.h"
+	extra_options="${extra_options} openbsd.opt"
 	gas=yes
 	gnu_ld=yes
 	;;
@@ -1707,6 +1710,7 @@  m68k*-*-openbsd*)
 	# needed to unconfuse gdb
 	tm_defines="${tm_defines} OBSD_OLD_GAS"
 	tm_file="${tm_file} openbsd.h openbsd-stdint.h openbsd-libpthread.h m68k/openbsd.h"
+	extra_options="${extra_options} openbsd.opt"
 	tmake_file="t-libc-ok t-openbsd m68k/t-openbsd"
 	# we need collect2 until our bug is fixed...
 	use_collect2=yes
@@ -1853,6 +1857,7 @@  mips*-*-openbsd*)
 	tm_defines="${tm_defines} OBSD_HAS_DECLARE_FUNCTION_NAME OBSD_HAS_DECLARE_OBJECT OBSD_HAS_CORRECT_SPECS"
 	target_cpu_default="MASK_ABICALLS"
 	tm_file="mips/mips.h openbsd.h openbsd-stdint.h openbsd-libpthread.h mips/openbsd.h mips/sdb.h"
+	extra_options="${extra_options} openbsd.opt"
 	case ${target} in
 	mips*el-*-openbsd*)
 	    tm_defines="${tm_defines} TARGET_ENDIAN_DEFAULT=0";;
@@ -2597,6 +2602,7 @@  sparc64-*-netbsd*)
 sparc64-*-openbsd*)
 	tm_file="sparc/openbsd1-64.h ${tm_file} dbxelf.h elfos.h sparc/sysv4.h sparc/sp64-elf.h"
 	tm_file="${tm_file} openbsd.h openbsd-stdint.h openbsd-libpthread.h sparc/openbsd64.h"
+	extra_options="${extra_options} openbsd.opt"
 	extra_options="${extra_options} sparc/little-endian.opt"
 	gas=yes gnu_ld=yes
 	with_cpu=ultrasparc
@@ -2675,6 +2681,7 @@  vax-*-netbsd*)
 	;;
 vax-*-openbsd*)
 	tm_file="vax/vax.h vax/openbsd1.h openbsd.h openbsd-stdint.h openbsd-pthread.h vax/openbsd.h"
+	extra_options="${extra_options} openbsd.opt"
 	use_collect2=yes
 	;;
 xstormy16-*-elf)
Index: gcc/config/openbsd.opt
===================================================================
--- gcc/config/openbsd.opt	(revision 0)
+++ gcc/config/openbsd.opt	(revision 0)
@@ -0,0 +1,33 @@ 
+; OpenBSD 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.
+
+posix
+Driver
+
+pthread
+Driver
+
+; This comment is to ensure we retain the blank line above.