From owner-p4-projects@FreeBSD.ORG Sat Feb 21 20:09:32 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id E2610106566C; Sat, 21 Feb 2009 20:09:31 +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 A2C52106564A for ; Sat, 21 Feb 2009 20:09:31 +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 7686B8FC0A for ; Sat, 21 Feb 2009 20:09:31 +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 n1LK9VYT063359 for ; Sat, 21 Feb 2009 20:09:31 GMT (envelope-from nwhitehorn@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n1LK9V1m063357 for perforce@freebsd.org; Sat, 21 Feb 2009 20:09:31 GMT (envelope-from nwhitehorn@freebsd.org) Date: Sat, 21 Feb 2009 20:09:31 GMT Message-Id: <200902212009.n1LK9V1m063357@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 158034 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: Sat, 21 Feb 2009 20:09:32 -0000 http://perforce.freebsd.org/chv.cgi?CH=158034 Change 158034 by nwhitehorn@nwhitehorn_trantor on 2009/02/21 20:08:58 GCC breaks in interesting ways if you try to use the System V R4 ABI on 64-bit systems. Folow NetBSD and Linux and use the AIX ABI for PPC64. Affected files ... .. //depot/projects/ppc-g5/contrib/gcc/config/rs6000/freebsd.h#3 edit .. //depot/projects/ppc-g5/contrib/gcc/config/rs6000/sysv4.h#2 edit Differences ... ==== //depot/projects/ppc-g5/contrib/gcc/config/rs6000/freebsd.h#3 (text+ko) ==== @@ -21,22 +21,25 @@ /* Override the defaults, which exist to force the proper definition. */ +#undef TARGET_64BIT +#define TARGET_64BIT (TARGET_CPU_DEFAULT != NULL && strcmp(TARGET_CPU_DEFAULT, \ + "powerpc64") == 0) + #ifdef IN_LIBGCC2 #undef TARGET_64BIT -#ifdef __powerpc64__ +#ifdef __ppc64__ #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 +/* 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 CPP_OS_DEFAULT_SPEC #define CPP_OS_DEFAULT_SPEC "%(cpp_os_freebsd)" @@ -54,6 +57,7 @@ { \ builtin_define ("__LP64__"); \ builtin_define ("__ppc64__"); \ + builtin_define ("__powerpc64__"); \ builtin_define ("__arch64__"); \ } \ } \ ==== //depot/projects/ppc-g5/contrib/gcc/config/rs6000/sysv4.h#2 (text+ko) ==== @@ -103,7 +103,12 @@ else if (!strcmp (rs6000_abi_name, "aixdesc")) \ rs6000_current_abi = ABI_AIX; \ else if (!strcmp (rs6000_abi_name, "freebsd")) \ - rs6000_current_abi = ABI_V4; \ + { \ + if (TARGET_64BIT) \ + rs6000_current_abi = ABI_AIX; \ + else \ + rs6000_current_abi = ABI_V4; \ + } \ else if (!strcmp (rs6000_abi_name, "linux")) \ { \ if (TARGET_64BIT) \