From owner-p4-projects@FreeBSD.ORG Sun Feb 22 00:11:38 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 89FAE106570C; Sun, 22 Feb 2009 00:11:38 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 450841065703 for ; Sun, 22 Feb 2009 00:11:38 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 3205F8FC34 for ; Sun, 22 Feb 2009 00:11:38 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n1M0Bco2004208 for ; Sun, 22 Feb 2009 00:11:38 GMT (envelope-from nwhitehorn@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n1M0Bbf6004205 for perforce@freebsd.org; Sun, 22 Feb 2009 00:11:37 GMT (envelope-from nwhitehorn@freebsd.org) Date: Sun, 22 Feb 2009 00:11:37 GMT Message-Id: <200902220011.n1M0Bbf6004205@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to nwhitehorn@freebsd.org using -f From: Nathan Whitehorn To: Perforce Change Reviews Cc: Subject: PERFORCE change 158044 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Feb 2009 00:11:39 -0000 http://perforce.freebsd.org/chv.cgi?CH=158044 Change 158044 by nwhitehorn@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