Subject: toolchain/20554: gcc should predefine __sparcv9
To: None <>
From: john heasley <>
List: netbsd-bugs
Date: 03/02/2003 22:22:32
>Number:         20554
>Category:       toolchain
>Synopsis:       gcc should predefine __sparcv9
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    toolchain-manager
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Sun Mar 02 14:23:00 PST 2003
>Originator:     john heasley
>Release:        NetBSD 1.6L
System: NetBSD guelah 1.6L NetBSD 1.6L (guelah) #3: Thu Jan 23 06:35:30 UTC 2003 root@guelah:/sys/arch/sparc64/compile/guelah sparc64
Architecture: sparc64
Machine: sparc64
	some 3rd-party source, xfree among them, uses __sparcv9 to determine
	size of long long and among other things.  gcc 3.1 (on solaris 2.9)
	and sun CC (solaris 2.8) define this for 64-bit compilation.
	inspection of xfree imake templates and gcc/sunCC predefines.
	apply this patch (i believe this is correct; "works for me").

Index: sparc.h
RCS file: /cvsroot/src/gnu/dist/toolchain/gcc/config/sparc/sparc.h,v
retrieving revision 1.4
diff -u -u -r1.4 sparc.h
--- sparc.h	2002/05/03 17:47:57	1.4
+++ sparc.h	2003/03/02 22:21:39
@@ -129,8 +129,8 @@
 #define ASM_CPU32_DEFAULT_SPEC ""
-/* ??? What does Sun's CC pass?  */
-#define CPP_CPU64_DEFAULT_SPEC "-D__sparc_v9__"
+/* Sun's CC passes __sparcv9 */
+#define CPP_CPU64_DEFAULT_SPEC "-D__sparc_v9__ -D__sparcv9"
 /* ??? It's not clear how other assemblers will handle this, so by default
    use GAS.  Sun's Solaris assembler recognizes -xarch=v8plus, but this case
    is handled in sol2.h.  */