1
0
mirror of https://github.com/openbsd/src.git synced 2024-12-22 07:27:59 -08:00

Fix cross-compiling GCC toolchains on Clang archs.

ok patrick@
This commit is contained in:
mpi 2017-09-12 08:16:13 +00:00
parent 0b33bdc1c5
commit c51441d01c

View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile.cross,v 1.96 2017/08/11 19:36:37 drahn Exp $
# $OpenBSD: Makefile.cross,v 1.97 2017/09/12 08:16:13 mpi Exp $
cross-tools: cross-includes cross-binutils cross-gcc cross-lib
cross-distrib: cross-tools cross-bin cross-share cross-sys cross-etc-root-var
@ -83,10 +83,16 @@ CROSSGCC= ${CROSSDIR}/.gcc_done
.if !empty(CLANG_ARCH:M${_arch})
COMPILER_VERSION=clang
BUILD_CLANG=yes
CC=clang
CXX=clang++
.elif !empty(GCC3_ARCH:M${_arch})
COMPILER_VERSION=gcc3
CC=gcc
CXX=g++
.else
COMPILER_VERSION=gcc4
CC=gcc
CXX=g++
.endif
.if !empty(PIE_ARCH:M${_arch})
@ -190,6 +196,7 @@ ${CROSSBINUTILS}: ${CROSSINCLUDES}
PATH=${CROSSPATH} \
${MAKE} -f Makefile.bsd-wrapper depend && \
env CROSSDIR=${CROSSDIR} \
CC=${CC} CXX=${CXX} \
MAKEOBJDIR=obj.${MACHINE}.${TARGET} \
PIE_DEFAULT=${PIE_DEFAULT} \
TARGET_ARCH=${TARGET_ARCH} TARGET_CPU=${TARGET_CPU} \
@ -228,7 +235,7 @@ ${CROSSGCC}: ${CROSSBINUTILS}
MACHINE_ARCH=${TARGET_ARCH} \
${MAKE} obj)
(cd ${.CURDIR}/gnu/usr.bin/clang; \
CC=clang CXX=clang++ \
CC=${CC} CXX=${CXX} \
MAKEOBJDIR=obj.${MACHINE}.${TARGET} \
MACHINE_ARCH=${TARGET_ARCH} \
${MAKE} all)
@ -258,6 +265,7 @@ ${CROSSGCC}: ${CROSSBINUTILS}
MAKEOBJDIR=obj.${MACHINE}.${TARGET} \
TARGET_ARCH=${TARGET_ARCH} TARGET_CPU=${TARGET_CPU} \
CROSSDIR=${CROSSDIR} \
CC=${CC} CXX=${CXX} \
${MAKE} -f Makefile.bsd-wrapper all && \
env CROSSDIR=${CROSSDIR} DESTDIR=${CROSSDIR} MAKEOBJDIR=obj.${MACHINE}.${TARGET} \
PATH=${CROSSPATH} ${MAKE} -f Makefile.bsd-wrapper install)
@ -286,6 +294,8 @@ ${CROSSGCC}: ${CROSSBINUTILS}
PATH=${CROSSPATH} ${MAKE} depend )
(cd ${.CURDIR}/gnu/usr.bin/cc; \
env CROSSDIR=${CROSSDIR} \
COMPILER_VERSION=${COMPILER_VERSION} \
CC=${CC} CXX=${CXX} \
PIE_DEFAULT=${PIE_DEFAULT} \
MAKEOBJDIR=obj.${MACHINE}.${TARGET} \
TARGET_ARCH=${TARGET_ARCH} TARGET_CPU=${TARGET_CPU} \
@ -293,6 +303,7 @@ ${CROSSGCC}: ${CROSSBINUTILS}
${MAKE} all )
(cd ${.CURDIR}/gnu/usr.bin/cc; \
env CROSSDIR=${CROSSDIR} DESTDIR=${CROSSDIR} \
COMPILER_VERSION=${COMPILER_VERSION} \
PIE_DEFAULT=${PIE_DEFAULT} \
MAKEOBJDIR=obj.${MACHINE}.${TARGET} \
TARGET_ARCH=${TARGET_ARCH} TARGET_CPU=${TARGET_CPU} \