From owner-freebsd-amd64@FreeBSD.ORG Thu Sep 7 22:00:35 2006 Return-Path: X-Original-To: freebsd-amd64@hub.freebsd.org Delivered-To: freebsd-amd64@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9BAA816A4EE for ; Thu, 7 Sep 2006 22:00:35 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 406AD43D67 for ; Thu, 7 Sep 2006 22:00:34 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id k87M0YFU077049 for ; Thu, 7 Sep 2006 22:00:34 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id k87M0Xqc077048; Thu, 7 Sep 2006 22:00:33 GMT (envelope-from gnats) Resent-Date: Thu, 7 Sep 2006 22:00:33 GMT Resent-Message-Id: <200609072200.k87M0Xqc077048@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-amd64@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Peter Grehan Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 56F7516A4E0 for ; Thu, 7 Sep 2006 21:51:19 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [216.136.204.117]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0B73543D53 for ; Thu, 7 Sep 2006 21:51:19 +0000 (GMT) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.13.1/8.13.1) with ESMTP id k87LpICA037562 for ; Thu, 7 Sep 2006 21:51:18 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.13.1/8.13.1/Submit) id k87LpIGL037561; Thu, 7 Sep 2006 21:51:18 GMT (envelope-from nobody) Message-Id: <200609072151.k87LpIGL037561@www.freebsd.org> Date: Thu, 7 Sep 2006 21:51:18 GMT From: Peter Grehan To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-2.3 Cc: Subject: amd64/102996: powerpc cross-build fails on amd64 host, works fine on i386 X-BeenThere: freebsd-amd64@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to the AMD64 platform List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Sep 2006 22:00:35 -0000 >Number: 102996 >Category: amd64 >Synopsis: powerpc cross-build fails on amd64 host, works fine on i386 >Confidential: no >Severity: serious >Priority: low >Responsible: freebsd-amd64 >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Thu Sep 07 22:00:33 GMT 2006 >Closed-Date: >Last-Modified: >Originator: Peter Grehan >Release: 6.0 >Organization: >Environment: FreeBSD *redacted* 6.0-RELEASE FreeBSD 6.0-RELEASE #0: Wed Nov 2 19:07:38 UTC 2005 root@rat.samsco.home:/usr/obj/usr/src/sys/GENERIC amd64 >Description: A powerpc build (any release) fails on amd64. The same tree on a 32-bit host works fine. I believe it will fail on other 64-bit arches though I haven't verified this. >How-To-Repeat: make TARGET_ARCH=powerpc buildworld >Fix: I applied the following diff supplied by Ruslan Ermilov: worked fine. %%% Index: Makefile =================================================================== RCS file: /home/ncvs/src/gnu/usr.bin/binutils/libbfd/Makefile,v retrieving revision 1.33 diff -u -r1.33 Makefile --- Makefile 24 Oct 2004 15:32:25 -0000 1.33 +++ Makefile 26 Aug 2006 00:48:26 -0000 @@ -48,6 +48,12 @@ CFLAGS+= -DSELECT_VECS="${SELVEC}" CFLAGS+= -DDEFAULT_VECTOR=${DEFAULT_VECTOR} +.if ${TARGET_ARCH:M*64} +CFLAGS+= -DTARGET_64BIT=1 +.else +CFLAGS+= -DTARGET_64BIT=0 +.endif + # XXX:DEO should grab BFD_VERSION_DATE from ${VERSION}... bfdver.h: Makefile echo '#define BFD_VERSION 215000000' > ${.TARGET} Index: bfd.h =================================================================== RCS file: /home/ncvs/src/gnu/usr.bin/binutils/libbfd/bfd.h,v retrieving revision 1.3 diff -u -r1.3 bfd.h --- bfd.h 8 Jul 2004 17:05:32 -0000 1.3 +++ bfd.h 26 Aug 2006 00:44:29 -0000 @@ -57,15 +57,18 @@ #define BFD_ARCH_SIZE 64 -#if defined(__i386__) || defined(__powerpc__) || defined(__arm__) /* The word size of the default bfd target. */ +#if TARGET_64BIT +#define BFD_DEFAULT_TARGET_SIZE 64 +#else #define BFD_DEFAULT_TARGET_SIZE 32 +#endif + +#if defined(__i386__) || defined(__powerpc__) || defined(__arm__) #define BFD_HOST_64BIT_LONG 0 #define BFD_HOST_64_BIT long long #define BFD_HOST_U_64_BIT unsigned long long #elif defined(__alpha__) || defined(__sparc64__) || defined(__amd64__) || defined(__ia64__) -/* The word size of the default bfd target. */ -#define BFD_DEFAULT_TARGET_SIZE 64 #define BFD_HOST_64BIT_LONG 1 #define BFD_HOST_64_BIT long #define BFD_HOST_U_64_BIT unsigned long %%% >Release-Note: >Audit-Trail: >Unformatted: