diff options
author | Martin Pieuchot <mpi@cvs.openbsd.org> | 2017-09-12 08:16:14 +0000 |
---|---|---|
committer | Martin Pieuchot <mpi@cvs.openbsd.org> | 2017-09-12 08:16:14 +0000 |
commit | 8a0b7cb27ead74f33e147b52644a5b92a505f0f8 (patch) | |
tree | c4b711f025fc0f818f766fca065bb98ee24bb6b5 /Makefile.cross | |
parent | 142548fc8aa26c67b2d58d91ec5975216a8b7c79 (diff) |
Fix cross-compiling GCC toolchains on Clang archs.
ok patrick@
Diffstat (limited to 'Makefile.cross')
-rw-r--r-- | Makefile.cross | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/Makefile.cross b/Makefile.cross index 7d68bd16c0c..8c7641503db 100644 --- a/Makefile.cross +++ b/Makefile.cross @@ -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} \ |