Date: Tue, 14 Jul 2009 01:56:18 +0000 (UTC) From: Nathan Whitehorn <nwhitehorn@FreeBSD.org> To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r195670 - in projects/ppc64: . contrib/gcc/config/rs6000 gnu/usr.bin/binutils gnu/usr.bin/binutils/as gnu/usr.bin/binutils/as/ppc64-freebsd gnu/usr.bin/binutils/gdb gnu/usr.bin/binutils... Message-ID: <200907140156.n6E1uIWQ041594@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: nwhitehorn Date: Tue Jul 14 01:56:18 2009 New Revision: 195670 URL: http://svn.freebsd.org/changeset/base/195670 Log: Get the toolchain able to build 64-bit PowerPC FreeBSD binaries. Obtained from: \\depot\projects\ppc-g5 Added: projects/ppc64/gnu/usr.bin/binutils/as/ppc64-freebsd/ - copied from r195651, projects/ppc64/gnu/usr.bin/binutils/as/powerpc-freebsd/ projects/ppc64/gnu/usr.bin/binutils/gdb/Makefile.ppc64 - copied, changed from r195651, projects/ppc64/gnu/usr.bin/binutils/gdb/Makefile.powerpc projects/ppc64/gnu/usr.bin/binutils/ld/Makefile.ppc64 - copied, changed from r195651, projects/ppc64/gnu/usr.bin/binutils/ld/Makefile.powerpc projects/ppc64/gnu/usr.bin/binutils/libbfd/Makefile.ppc64 projects/ppc64/gnu/usr.bin/binutils/libopcodes/Makefile.ppc64 - copied unchanged from r195651, projects/ppc64/gnu/usr.bin/binutils/libopcodes/Makefile.powerpc Modified: projects/ppc64/Makefile.inc1 projects/ppc64/contrib/gcc/config/rs6000/freebsd.h projects/ppc64/gnu/usr.bin/binutils/Makefile.inc0 projects/ppc64/gnu/usr.bin/binutils/as/Makefile projects/ppc64/gnu/usr.bin/binutils/gdb/Makefile projects/ppc64/gnu/usr.bin/binutils/libbfd/Makefile projects/ppc64/gnu/usr.bin/cc/Makefile.tgt projects/ppc64/gnu/usr.bin/cc/cc_tools/Makefile projects/ppc64/gnu/usr.bin/cc/include/Makefile projects/ppc64/share/mk/bsd.endian.mk Modified: projects/ppc64/Makefile.inc1 ============================================================================== --- projects/ppc64/Makefile.inc1 Mon Jul 13 23:03:44 2009 (r195669) +++ projects/ppc64/Makefile.inc1 Tue Jul 14 01:56:18 2009 (r195670) @@ -128,7 +128,7 @@ TARGET= ${TARGET_ARCH} TARGET?= ${MACHINE} TARGET_ARCH?= ${MACHINE_ARCH} -KNOWN_ARCHES?= amd64 arm i386 i386/pc98 ia64 mips powerpc sparc64 sparc64/sun4v +KNOWN_ARCHES?= amd64 arm i386 i386/pc98 ia64 mips powerpc ppc64 sparc64 sparc64/sun4v .if ${TARGET} == ${TARGET_ARCH} _t= ${TARGET} .else Modified: projects/ppc64/contrib/gcc/config/rs6000/freebsd.h ============================================================================== --- projects/ppc64/contrib/gcc/config/rs6000/freebsd.h Mon Jul 13 23:03:44 2009 (r195669) +++ projects/ppc64/contrib/gcc/config/rs6000/freebsd.h Tue Jul 14 01:56:18 2009 (r195670) @@ -21,13 +21,86 @@ /* Override the defaults, which exist to force the proper definition. */ -#undef CPP_OS_DEFAULT_SPEC -#define CPP_OS_DEFAULT_SPEC "%(cpp_os_freebsd)" +#ifdef IN_LIBGCC2 +#undef TARGET_64BIT +#ifdef __ppc64__ +#define TARGET_64BIT 1 +#else +#define TARGET_64BIT 0 +#endif +#endif + +/* 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 TARGET_AIX +#define TARGET_AIX TARGET_64BIT + +#undef FBSD_TARGET_CPU_CPP_BUILTINS +#define FBSD_TARGET_CPU_CPP_BUILTINS() \ + do \ + { \ + builtin_define ("__PPC__"); \ + builtin_define ("__ppc__"); \ + builtin_define ("__PowerPC__"); \ + builtin_define ("__powerpc__"); \ + if (TARGET_64BIT) \ + { \ + builtin_define ("__LP64__"); \ + 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 ("64 bit CPU required"); \ + } \ + } \ + } \ + while (0) -#undef CPP_OS_FREEBSD_SPEC -#define CPP_OS_FREEBSD_SPEC "\ - -D__PPC__ -D__ppc__ -D__PowerPC__ -D__powerpc__ \ - -Acpu=powerpc -Amachine=powerpc " #undef STARTFILE_DEFAULT_SPEC #define STARTFILE_DEFAULT_SPEC "%(startfile_freebsd)" @@ -57,7 +130,10 @@ 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") + +#undef PTRDIFF_TYPE +#define PTRDIFF_TYPE (TARGET_64BIT ? "long int" : "int") /* rs6000.h gets this wrong for FreeBSD. We use the GCC defaults instead. */ #undef WCHAR_TYPE Modified: projects/ppc64/gnu/usr.bin/binutils/Makefile.inc0 ============================================================================== --- projects/ppc64/gnu/usr.bin/binutils/Makefile.inc0 Mon Jul 13 23:03:44 2009 (r195669) +++ projects/ppc64/gnu/usr.bin/binutils/Makefile.inc0 Tue Jul 14 01:56:18 2009 (r195670) @@ -9,6 +9,8 @@ VERSION= "2.15 [FreeBSD] 2004-05-23" TARGET_ARCH?= ${MACHINE_ARCH} .if ${TARGET_ARCH} == "amd64" BINUTILS_ARCH=x86_64 +.elif ${TARGET_ARCH} == "ppc64" +BINUTILS_ARCH=powerpc64 .else BINUTILS_ARCH=${TARGET_ARCH} .endif Modified: projects/ppc64/gnu/usr.bin/binutils/as/Makefile ============================================================================== --- projects/ppc64/gnu/usr.bin/binutils/as/Makefile Mon Jul 13 23:03:44 2009 (r195669) +++ projects/ppc64/gnu/usr.bin/binutils/as/Makefile Tue Jul 14 01:56:18 2009 (r195670) @@ -26,7 +26,7 @@ SRCS+= itbl-ops.c itbl-parse.y itbl-lex. .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 Modified: projects/ppc64/gnu/usr.bin/binutils/gdb/Makefile ============================================================================== --- projects/ppc64/gnu/usr.bin/binutils/gdb/Makefile Mon Jul 13 23:03:44 2009 (r195669) +++ projects/ppc64/gnu/usr.bin/binutils/gdb/Makefile Tue Jul 14 01:56:18 2009 (r195670) @@ -12,6 +12,8 @@ GDBDIR= ${.CURDIR}/../../../../contrib/g GDB_CPU= sparc .elif ${TARGET_ARCH} == "amd64" GDB_CPU= i386 +.elif ${TARGET_ARCH} == "ppc64" +GDB_CPU= powerpc .else GDB_CPU= ${TARGET_ARCH} .endif Copied and modified: projects/ppc64/gnu/usr.bin/binutils/gdb/Makefile.ppc64 (from r195651, projects/ppc64/gnu/usr.bin/binutils/gdb/Makefile.powerpc) ============================================================================== --- projects/ppc64/gnu/usr.bin/binutils/gdb/Makefile.powerpc Mon Jul 13 01:37:48 2009 (r195651, copy source) +++ projects/ppc64/gnu/usr.bin/binutils/gdb/Makefile.ppc64 Tue Jul 14 01:56:18 2009 (r195670) @@ -2,4 +2,4 @@ XSRCS+= ppcnbsd-nat.c ppc-tdep.c \ core-regset.c -CFLAGS+= -DDEFAULT_BFD_VEC=bfd_elf32_powerpc_vec +CFLAGS+= -DDEFAULT_BFD_VEC=bfd_elf64_powerpc_vec Copied and modified: projects/ppc64/gnu/usr.bin/binutils/ld/Makefile.ppc64 (from r195651, projects/ppc64/gnu/usr.bin/binutils/ld/Makefile.powerpc) ============================================================================== --- projects/ppc64/gnu/usr.bin/binutils/ld/Makefile.powerpc Mon Jul 13 01:37:48 2009 (r195651, copy source) +++ projects/ppc64/gnu/usr.bin/binutils/ld/Makefile.ppc64 Tue Jul 14 01:56:18 2009 (r195670) @@ -1,6 +1,6 @@ # $FreeBSD$ -NATIVE_EMULATION= elf32ppc +NATIVE_EMULATION= elf64ppc SRCS+= e${NATIVE_EMULATION}.c CLEANFILES+= e${NATIVE_EMULATION}.c Modified: projects/ppc64/gnu/usr.bin/binutils/libbfd/Makefile ============================================================================== --- projects/ppc64/gnu/usr.bin/binutils/libbfd/Makefile Mon Jul 13 23:03:44 2009 (r195669) +++ projects/ppc64/gnu/usr.bin/binutils/libbfd/Makefile Tue Jul 14 01:56:18 2009 (r195670) @@ -25,6 +25,8 @@ SELARCH= 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} == "" Added: projects/ppc64/gnu/usr.bin/binutils/libbfd/Makefile.ppc64 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/ppc64/gnu/usr.bin/binutils/libbfd/Makefile.ppc64 Tue Jul 14 01:56:18 2009 (r195670) @@ -0,0 +1,25 @@ +# $FreeBSD: src/gnu/usr.bin/binutils/libbfd/Makefile.powerpc,v 1.9 2006/08/24 02:36:21 marcel Exp $ + +ARCHS+= rs6000 + +DEFAULT_VECTOR= bfd_elf64_powerpc_vec + +SRCS+= cpu-powerpc.c \ + cpu-rs6000.c \ + elf32.c \ + elf32-gen.c \ + elf32-ppc.c \ + elf32-target.h \ + elflink.c \ + elf64.c \ + elf64-gen.c \ + elf64-ppc.c \ + elf64-target.h \ + elflink.c \ + ppcboot.c \ + xcofflink.c + +VECS+= ${DEFAULT_VECTOR} \ + bfd_elf64_powerpcle_vec \ + bfd_elf32_powerpc_vec \ + bfd_elf32_powerpcle_vec Copied: projects/ppc64/gnu/usr.bin/binutils/libopcodes/Makefile.ppc64 (from r195651, projects/ppc64/gnu/usr.bin/binutils/libopcodes/Makefile.powerpc) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/ppc64/gnu/usr.bin/binutils/libopcodes/Makefile.ppc64 Tue Jul 14 01:56:18 2009 (r195670, copy of r195651, projects/ppc64/gnu/usr.bin/binutils/libopcodes/Makefile.powerpc) @@ -0,0 +1,4 @@ +# $FreeBSD$ + +SRCS+= ppc-dis.c ppc-opc.c +CFLAGS+= -DARCH_powerpc -DARCH_rs6000 Modified: projects/ppc64/gnu/usr.bin/cc/Makefile.tgt ============================================================================== --- projects/ppc64/gnu/usr.bin/cc/Makefile.tgt Mon Jul 13 23:03:44 2009 (r195669) +++ projects/ppc64/gnu/usr.bin/cc/Makefile.tgt Tue Jul 14 01:56:18 2009 (r195670) @@ -4,7 +4,7 @@ TARGET_ARCH?= ${MACHINE_ARCH} .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 @@ TARGET_CPU_DEFAULT= 16 .if ${TARGET_ARCH} == "sparc64" TARGET_CPU_DEFAULT= TARGET_CPU_ultrasparc .endif +.if ${TARGET_ARCH} == "ppc64" +TARGET_CPU_DEFAULT= \"powerpc64\" +.endif + Modified: projects/ppc64/gnu/usr.bin/cc/cc_tools/Makefile ============================================================================== --- projects/ppc64/gnu/usr.bin/cc/cc_tools/Makefile Mon Jul 13 23:03:44 2009 (r195669) +++ projects/ppc64/gnu/usr.bin/cc/cc_tools/Makefile Tue Jul 14 01:56:18 2009 (r195670) @@ -56,6 +56,9 @@ TARGET_INC+= ${GCC_CPU}/freebsd.h .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 @@ -171,7 +174,7 @@ OPT_FILES+= ${GCCDIR}/config/${GCC_CPU}/ 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 Modified: projects/ppc64/gnu/usr.bin/cc/include/Makefile ============================================================================== --- projects/ppc64/gnu/usr.bin/cc/include/Makefile Mon Jul 13 23:03:44 2009 (r195669) +++ projects/ppc64/gnu/usr.bin/cc/include/Makefile Tue Jul 14 01:56:18 2009 (r195670) @@ -10,7 +10,7 @@ INCS= emmintrin.h mmintrin.h pmmintrin.h 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 Modified: projects/ppc64/share/mk/bsd.endian.mk ============================================================================== --- projects/ppc64/share/mk/bsd.endian.mk Mon Jul 13 23:03:44 2009 (r195669) +++ projects/ppc64/share/mk/bsd.endian.mk Tue Jul 14 01:56:18 2009 (r195670) @@ -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"
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200907140156.n6E1uIWQ041594>