This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] NetBSD/PowerPC/ELF option list fix
- From: Allen Briggs <briggs at wasabisystems dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Tue, 8 Mar 2005 11:04:27 -0500
- Subject: [PATCH] NetBSD/PowerPC/ELF option list fix
I found that NetBSD/PowerPC was treating an option a little
differently than NetBSD on other architectures. Specifically,
-R is defined in SWITCH_TAKES_ARG() in config/netbsd-elf.h and
overridden in config/rs6000/sysv4.h. The following patch against
3.3.3 addresses this.
2005-03-08 Allen Briggs <briggs@wasabisystems.com>
* config/rs6000/netbsd.h
Override SWITCH_TAKES_ARG() definition from sysv4.h to include
NetBSD options. Allows powerpc-*-netbsd* to accept "-R <arg>"
when <arg> doesn't exist in the host environment. As with MIPS,
accept -G NUM, too.
Index: config/rs6000/netbsd.h
===================================================================
RCS file: /cvsroot/src/gnu/dist/gcc/gcc/config/rs6000/netbsd.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -p -u -r1.5 -r1.6
--- config/rs6000/netbsd.h 9 Dec 2004 23:23:23 -0000 1.5
+++ config/rs6000/netbsd.h 8 Mar 2005 15:36:10 -0000 1.6
@@ -20,6 +20,22 @@ along with GNU CC; see the file COPYING.
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
+/* This defines which switch letters take arguments. On NetBSD, most
+ of the normal cases (defined by gcc.c) apply, and we also have -h*
+ and -z* options (for the linker) (coming from SVR4).
+ Copied from ../netbsd-elf.h and re{undef,defined} here to
+ override the powerpc sysv4.h definition.
+ netbsd-elf.h defines the default list + 'h' + 'z' + 'R'.
+ rs6000/sysv4.h defines the default list + 'G'. */
+
+#undef SWITCH_TAKES_ARG
+#define SWITCH_TAKES_ARG(CHAR) \
+ (DEFAULT_SWITCH_TAKES_ARG (CHAR) \
+ || (CHAR) == 'h' \
+ || (CHAR) == 'z' \
+ || (CHAR) == 'R' \
+ || (CHAR) == 'G')
+
#undef TARGET_OS_CPP_BUILTINS /* FIXME: sysv4.h should not define this! */
#define TARGET_OS_CPP_BUILTINS() \
do \
--
Allen Briggs briggs@wasabisystems.com
Wasabi Systems Inc. http://www.wasabisystems.com/