PERFORCE change 158044 for review
Nathan Whitehorn
nwhitehorn at FreeBSD.org
Sat Feb 21 16:11:39 PST 2009
http://perforce.freebsd.org/chv.cgi?CH=158044
Change 158044 by nwhitehorn at nwhitehorn_trantor on 2009/02/22 00:11:36
Make the hippo dance: after some wrangling, arrive at a working
PPC64 toolchain.
Affected files ...
.. //depot/projects/ppc-g5/contrib/gcc/config/rs6000/freebsd.h#4 edit
.. //depot/projects/ppc-g5/gnu/usr.bin/cc/cc_tools/Makefile#4 edit
Differences ...
==== //depot/projects/ppc-g5/contrib/gcc/config/rs6000/freebsd.h#4 (text+ko) ====
@@ -36,8 +36,8 @@
/* On 64-bit systems, use the AIX ABI like Linux and NetBSD */
-#undef DEFAULT_ABI
-#define DEFAULT_ABI (TARGET_64BIT ? ABI_AIX : ABI_V4)
+#undef DEFAULT_ABI
+#define DEFAULT_ABI (TARGET_64BIT ? ABI_AIX : ABI_V4)
#undef TARGET_AIX
#define TARGET_AIX TARGET_64BIT
@@ -46,8 +46,7 @@
#undef CPP_OS_FREEBSD_SPEC
#define CPP_OS_FREEBSD_SPEC "\
- -D__PPC__ -D__ppc__ -D__PowerPC__ -D__powerpc__ \
- -Acpu=powerpc -Amachine=powerpc "
+ -D__PPC__ -D__ppc__ -D__PowerPC__ -D__powerpc__"
#undef FBSD_TARGET_CPU_CPP_BUILTINS
#define FBSD_TARGET_CPU_CPP_BUILTINS() \
@@ -59,10 +58,57 @@
builtin_define ("__ppc64__"); \
builtin_define ("__powerpc64__"); \
builtin_define ("__arch64__"); \
+ builtin_assert ("cpu=powerpc64"); \
+ builtin_assert ("machine=powerpc64"); \
+ } else { \
+ builtin_assert ("cpu=powerpc"); \
+ builtin_assert ("machine=powerpc"); \
} \
} \
while (0)
+#define INVALID_64BIT "-m%s not supported in this configuration"
+#define INVALID_32BIT INVALID_64BIT
+
+#undef SUBSUBTARGET_OVERRIDE_OPTIONS
+#define SUBSUBTARGET_OVERRIDE_OPTIONS \
+ do \
+ { \
+ if (!rs6000_explicit_options.alignment) \
+ rs6000_alignment_flags = MASK_ALIGN_NATURAL; \
+ if (TARGET_64BIT) \
+ { \
+ if (DEFAULT_ABI != ABI_AIX) \
+ { \
+ rs6000_current_abi = ABI_AIX; \
+ error (INVALID_64BIT, "call"); \
+ } \
+ dot_symbols = !strcmp (rs6000_abi_name, "aixdesc"); \
+ if (target_flags & MASK_RELOCATABLE) \
+ { \
+ target_flags &= ~MASK_RELOCATABLE; \
+ error (INVALID_64BIT, "relocatable"); \
+ } \
+ if (target_flags & MASK_EABI) \
+ { \
+ target_flags &= ~MASK_EABI; \
+ error (INVALID_64BIT, "eabi"); \
+ } \
+ if (target_flags & MASK_PROTOTYPE) \
+ { \
+ target_flags &= ~MASK_PROTOTYPE; \
+ error (INVALID_64BIT, "prototype"); \
+ } \
+ if ((target_flags & MASK_POWERPC64) == 0) \
+ { \
+ target_flags |= MASK_POWERPC64; \
+ error ("32-bit PowerPC unavailable on ppc64"); \
+ } \
+ } \
+ } \
+ while (0)
+
+
#undef STARTFILE_DEFAULT_SPEC
#define STARTFILE_DEFAULT_SPEC "%(startfile_freebsd)"
@@ -78,6 +124,9 @@
#undef LINK_OS_DEFAULT_SPEC
#define LINK_OS_DEFAULT_SPEC "%(link_os_freebsd)"
+#undef ASM_DEFAULT_SPEC
+#define ASM_DEFAULT_SPEC (TARGET_64BIT ? "-mppc64" : "-mppc")
+
/* XXX: This is wrong for many platforms in sysv4.h.
We should work on getting that definition fixed. */
#undef LINK_SHLIB_SPEC
==== //depot/projects/ppc-g5/gnu/usr.bin/cc/cc_tools/Makefile#4 (text+ko) ====
@@ -37,12 +37,12 @@
TARGET_INC+= elfos.h
TARGET_INC+= freebsd-native.h
TARGET_INC+= freebsd-spec.h
-TARGET_INC+= freebsd.h
.if ${TARGET_ARCH} != "i386" && ${TARGET_ARCH} != "amd64"
. if exists(${GCCDIR}/config/${GCC_CPU}/sysv4.h)
TARGET_INC+= ${GCC_CPU}/sysv4.h
. endif
.endif
+TARGET_INC+= freebsd.h
.if ${TARGET_ARCH} == "amd64"
TARGET_INC+= ${GCC_CPU}/x86-64.h
.endif
@@ -56,6 +56,9 @@
.if ${TARGET_ARCH} == "amd64"
TARGET_INC+= ${GCC_CPU}/freebsd64.h
.endif
+.if ${TARGET_ARCH} == "ppc64"
+TARGET_INC+= ${GCC_CPU}/default64.h
+.endif
.if ${TARGET_ARCH} == "arm"
TARGET_INC+= ${GCC_CPU}/arm.h
.endif
More information about the p4-projects
mailing list