From 3c925b07d6111dac4b4ad4a92620b3bf456aa1c9 Mon Sep 17 00:00:00 2001 From: marcel Date: Sun, 11 Feb 2007 07:15:06 +0000 Subject: Fix PowerPC-targeted cross-builds performed on 64-bit platforms. Only PowerPC supports both 32-bit and 64-bit targets and the BFD_DEFAULT_TARGET_SIZE is used by the binutils code to reflect the preferred ABI. We define BFD_DEFAULT_TARGET_SIZE for all platforms, but based on the build machine. As such 64-bit build machines defined BFD_DEFAULT_TARGET_SIZE incorrectly for 32-bit targets, but since this only affects PowerPC it went unnoticed for a long time. The fix is to define BFD_DEFAULT_TARGET_SIZE based on the target architecture. PR: amd64/102996 MFC after: 1 month --- gnu/usr.bin/binutils/Makefile.inc0 | 6 ++++++ gnu/usr.bin/binutils/libbfd/bfd.h | 4 ---- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'gnu') diff --git a/gnu/usr.bin/binutils/Makefile.inc0 b/gnu/usr.bin/binutils/Makefile.inc0 index bda5ebf..859a3a8 100644 --- a/gnu/usr.bin/binutils/Makefile.inc0 +++ b/gnu/usr.bin/binutils/Makefile.inc0 @@ -22,6 +22,12 @@ RELTOP:= .. RELSRC= ${RELTOP}/../../../contrib/binutils SRCDIR= ${.CURDIR}/${RELSRC} +.if ${TARGET_ARCH} == "arm" || ${TARGET_ARCH} == "i386" || ${TARGET_ARCH} == "powerpc" +CFLAGS+= -DBFD_DEFAULT_TARGET_SIZE=32 +.else +CFLAGS+= -DBFD_DEFAULT_TARGET_SIZE=64 +.endif + CFLAGS+= -I. .if exists(${.CURDIR}/${TARGET_ARCH}) CFLAGS+= -I${.CURDIR}/${TARGET_ARCH} diff --git a/gnu/usr.bin/binutils/libbfd/bfd.h b/gnu/usr.bin/binutils/libbfd/bfd.h index 1e65701..570927f 100644 --- a/gnu/usr.bin/binutils/libbfd/bfd.h +++ b/gnu/usr.bin/binutils/libbfd/bfd.h @@ -58,14 +58,10 @@ extern "C" { #if defined(__i386__) || defined(__powerpc__) || defined(__arm__) -/* The word size of the default bfd target. */ -#define BFD_DEFAULT_TARGET_SIZE 32 #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 -- cgit v1.1