freebsd-dev/gnu/usr.bin/binutils/Makefile.inc0
Marcel Moolenaar 6c7ef9a0f8 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
2007-02-11 07:15:06 +00:00

57 lines
1.4 KiB
Makefile

# $FreeBSD$
#
# This is included explicitly at the top of each sub-Makefile. We can't
# use the normal "Makefile.inc" mechanism, because we need some of these
# definitions before the sub-Makefile is processed.
VERSION= "2.15 [FreeBSD] 2004-05-23"
TARGET_ARCH?= ${MACHINE_ARCH}
.if ${TARGET_ARCH} == "amd64"
BINUTILS_ARCH=x86_64
.else
BINUTILS_ARCH=${TARGET_ARCH}
.endif
TARGET_TUPLE?= ${BINUTILS_ARCH}-obrien-freebsd
# RELTOP is the relative path to this point in the source or object
# tree, from any subdirectory of same. It gets extra "../" prefixes
# added to it as we descend into subdirectories.
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}
.endif
CFLAGS+= -I${.CURDIR}
CFLAGS+= -I${.CURDIR}/${RELTOP}/libbfd
CFLAGS+= -I${.OBJDIR}/${RELTOP}/libbfd
CFLAGS+= -I${SRCDIR}/include
.if exists(${.CURDIR}/${TARGET_ARCH})
.PATH: ${.CURDIR}/${TARGET_ARCH}
.endif
ARCHS= ${TARGET_ARCH}
.for _arch in ${CROSS_ARCH}
.if (${ARCHS:R:M${_arch:R}} == "")
ARCHS+= $(_arch)
.endif
.endfor
.for _arch in ${ARCHS}
.if exists(${.CURDIR}/Makefile.${_arch})
.include "${.CURDIR}/Makefile.${_arch}"
.endif
.endfor