PERFORCE change 158003 for review

Nathan Whitehorn nwhitehorn at FreeBSD.org
Fri Feb 20 20:13:17 PST 2009


http://perforce.freebsd.org/chv.cgi?CH=158003

Change 158003 by nwhitehorn at nwhitehorn_trantor on 2009/02/21 04:12:16

	Toolchain build infrastructure for 64-bit PowerPC. Kind of, sort of
	working.

Affected files ...

.. //depot/projects/ppc-g5/contrib/gcc/config/rs6000/freebsd.h#2 edit
.. //depot/projects/ppc-g5/gnu/usr.bin/binutils/as/Makefile#3 edit
.. //depot/projects/ppc-g5/gnu/usr.bin/binutils/as/ppc64-freebsd/itbl-cpu.h#1 add
.. //depot/projects/ppc-g5/gnu/usr.bin/binutils/as/ppc64-freebsd/targ-cpu.h#1 add
.. //depot/projects/ppc-g5/gnu/usr.bin/binutils/gdb/Makefile#2 edit
.. //depot/projects/ppc-g5/gnu/usr.bin/binutils/ld/Makefile.ppc64#1 add
.. //depot/projects/ppc-g5/gnu/usr.bin/binutils/libbfd/Makefile#2 edit
.. //depot/projects/ppc-g5/gnu/usr.bin/binutils/libbfd/Makefile.ppc64#1 add
.. //depot/projects/ppc-g5/gnu/usr.bin/binutils/libopcodes/Makefile.ppc64#1 add
.. //depot/projects/ppc-g5/gnu/usr.bin/cc/Makefile.tgt#3 edit
.. //depot/projects/ppc-g5/gnu/usr.bin/cc/cc_tools/Makefile#3 edit
.. //depot/projects/ppc-g5/gnu/usr.bin/cc/include/Makefile#2 edit
.. //depot/projects/ppc-g5/gnu/usr.bin/gdb/arch/ppc64/Makefile#1 add
.. //depot/projects/ppc-g5/gnu/usr.bin/gdb/arch/ppc64/config.h#1 add
.. //depot/projects/ppc-g5/gnu/usr.bin/gdb/arch/ppc64/init.c#1 add
.. //depot/projects/ppc-g5/lib/libc/Makefile#2 edit
.. //depot/projects/ppc-g5/share/mk/bsd.cpu.mk#2 edit
.. //depot/projects/ppc-g5/share/mk/bsd.endian.mk#2 edit
.. //depot/projects/ppc-g5/usr.bin/xlint/arch/ppc64/targparam.h#1 add

Differences ...

==== //depot/projects/ppc-g5/contrib/gcc/config/rs6000/freebsd.h#2 (text+ko) ====

@@ -21,6 +21,23 @@
 
 /* Override the defaults, which exist to force the proper definition.  */
 
+#ifdef IN_LIBGCC2
+#undef TARGET_64BIT
+#ifdef __powerpc64__
+#define TARGET_64BIT 1
+#else
+#define TARGET_64BIT 0
+#endif
+#endif
+
+#undef TARGET_64BIT
+#ifdef TARGET_CPU_DEFAULT
+#define TARGET_64BIT 1
+#else
+#error 32 bit
+#define TARGET_64BIT 0
+#endif
+
 #undef	CPP_OS_DEFAULT_SPEC
 #define CPP_OS_DEFAULT_SPEC "%(cpp_os_freebsd)"
 
@@ -29,6 +46,19 @@
   -D__PPC__ -D__ppc__ -D__PowerPC__ -D__powerpc__ \
   -Acpu=powerpc -Amachine=powerpc "
 
+#undef  FBSD_TARGET_CPU_CPP_BUILTINS
+#define FBSD_TARGET_CPU_CPP_BUILTINS()		\
+  do						\
+    {						\
+      if (TARGET_64BIT)				\
+	{					\
+	  builtin_define ("__LP64__");		\
+	  builtin_define ("__ppc64__");		\
+	  builtin_define ("__arch64__");	\
+	}					\
+    }						\
+  while (0)
+
 #undef	STARTFILE_DEFAULT_SPEC
 #define STARTFILE_DEFAULT_SPEC "%(startfile_freebsd)"
 
@@ -57,7 +87,7 @@
    c-common.c, and config/<arch>/<arch>.h.  */
 
 #undef  SIZE_TYPE
-#define SIZE_TYPE "unsigned int"
+#define SIZE_TYPE	(TARGET_64BIT ? "long unsigned int" : "unsigned int")
 
 /* rs6000.h gets this wrong for FreeBSD.  We use the GCC defaults instead.  */
 #undef WCHAR_TYPE

==== //depot/projects/ppc-g5/gnu/usr.bin/binutils/as/Makefile#3 (text+ko) ====

@@ -26,7 +26,7 @@
 
 .if ${TARGET_ARCH} == "amd64"
 SRCS+=	tc-i386.c
-.elif ${TARGET_ARCH} == "powerpc"
+.elif ${TARGET_ARCH} == "powerpc" || ${TARGET_ARCH} == "ppc64"
 SRCS+=	tc-ppc.c
 .elif ${TARGET_ARCH} == "sparc64"
 # change back to tc-sparc.c when new binutils is imported

==== //depot/projects/ppc-g5/gnu/usr.bin/binutils/gdb/Makefile#2 (text+ko) ====

@@ -12,6 +12,8 @@
 GDB_CPU=	sparc
 .elif ${TARGET_ARCH} == "amd64"
 GDB_CPU=	i386
+.elif ${TARGET_ARCH} == "ppc64"
+GDB_CPU=	powerpc
 .else
 GDB_CPU=	${TARGET_ARCH}
 .endif

==== //depot/projects/ppc-g5/gnu/usr.bin/binutils/libbfd/Makefile#2 (text+ko) ====

@@ -25,6 +25,8 @@
 SELARCH= &bfd_i386_arch
 .elif ${TARGET_ARCH} == "sparc64"
 SELARCH= &bfd_sparc_arch
+.elif ${TARGET_ARCH} == "ppc64"
+SELARCH= &bfd_powerpc_arch
 .else
 .for _a in ${ARCHS}
 .if ${SELARCH} == ""

==== //depot/projects/ppc-g5/gnu/usr.bin/cc/Makefile.tgt#3 (text+ko) ====

@@ -4,7 +4,7 @@
 
 .if ${TARGET_ARCH} == "amd64"
 GCC_CPU=	i386
-.elif ${TARGET_ARCH} == "powerpc"
+.elif ${TARGET_ARCH} == "powerpc" || ${TARGET_ARCH} == "ppc64"
 GCC_CPU=	rs6000
 .elif ${TARGET_ARCH} == "sparc64"
 GCC_CPU=	sparc
@@ -21,3 +21,7 @@
 .if ${TARGET_ARCH} == "sparc64"
 TARGET_CPU_DEFAULT= TARGET_CPU_ultrasparc
 .endif
+.if ${TARGET_ARCH} == "ppc64"
+TARGET_CPU_DEFAULT= \"powerpc64\"
+.endif
+

==== //depot/projects/ppc-g5/gnu/usr.bin/cc/cc_tools/Makefile#3 (text+ko) ====

@@ -171,7 +171,7 @@
 OPT_FILES+=	${.CURDIR}/${GCC_CPU}-freebsd.opt
 .endif
 
-.if ${TARGET_ARCH} == "powerpc"
+.if ${TARGET_ARCH} == "powerpc" || ${TARGET_ARCH} == "ppc64"
 OPT_FILES+=	${GCCDIR}/config/${GCC_CPU}/sysv4.opt
 .endif
 

==== //depot/projects/ppc-g5/gnu/usr.bin/cc/include/Makefile#2 (text+ko) ====

@@ -10,7 +10,7 @@
 INCS=	ia64intrin.h
 .elif ${TARGET_ARCH} == "arm"
 INCS=	mmintrin.h
-.elif ${TARGET_ARCH} == "powerpc"
+.elif ${TARGET_ARCH} == "powerpc" || ${TARGET_ARCH} == "ppc64"
 INCS=	ppc-asm.h altivec.h spe.h
 .endif
 

==== //depot/projects/ppc-g5/lib/libc/Makefile#2 (text+ko) ====

@@ -50,6 +50,7 @@
 .include "${.CURDIR}/posix1e/Makefile.inc"
 .if ${MACHINE_ARCH} != "amd64" && \
     ${MACHINE_ARCH} != "ia64" && \
+    ${MACHINE_ARCH} != "pcc64" && \
     ${MACHINE_ARCH} != "sparc64"
 .include "${.CURDIR}/quad/Makefile.inc"
 .endif

==== //depot/projects/ppc-g5/share/mk/bsd.cpu.mk#2 (text+ko) ====

@@ -12,6 +12,8 @@
 MACHINE_CPU = amd64 sse2 sse
 . elif ${MACHINE_ARCH} == "ia64"
 MACHINE_CPU = itanium
+. elif ${MACHINE_ARCH} == "ppc64"
+MACHINE_CPU = aim powerpc64
 . elif ${MACHINE_ARCH} == "powerpc"
 MACHINE_CPU = aim
 . elif ${MACHINE_ARCH} == "sparc64"

==== //depot/projects/ppc-g5/share/mk/bsd.endian.mk#2 (text+ko) ====

@@ -7,6 +7,7 @@
     (${MACHINE_ARCH} == "mips" && !defined(TARGET_BIG_ENDIAN))
 TARGET_ENDIANNESS= 1234
 .elif ${MACHINE_ARCH} == "powerpc" || \
+    ${MACHINE_ARCH} == "ppc64" || \
     ${MACHINE_ARCH} == "sparc64" || \
     ${MACHINE_ARCH} == "arm" || \
     ${MACHINE_ARCH} == "mips"


More information about the p4-projects mailing list