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
This commit is contained in:
Marcel Moolenaar 2007-02-11 07:15:06 +00:00
parent 5351a2488a
commit 6c7ef9a0f8
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=166638
2 changed files with 6 additions and 4 deletions

View File

@ -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}

View File

@ -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