summaryrefslogtreecommitdiff
path: root/Makefile.cross
diff options
context:
space:
mode:
authorPatrick Wildt <patrick@cvs.openbsd.org>2019-10-14 15:23:45 +0000
committerPatrick Wildt <patrick@cvs.openbsd.org>2019-10-14 15:23:45 +0000
commit75e733194e284b1e61644f833693d214ef0ce689 (patch)
tree547f10c8ad5c77b65fb8d75bcfbb579c711ce8a9 /Makefile.cross
parentab77b686e558f6c2256d99cf92e803cb9115f18a (diff)
Re-sort the if-sequence which sets COMPILER_VERSION to be the same
as bsd.own.mk, otherwise on transitioning architectures the wrong compiler is chosen. Also make sure BUILD_CLANG is forced for the libcompiler_rt directory since cross-compiling with two possible compilers would create too much headache.
Diffstat (limited to 'Makefile.cross')
-rw-r--r--Makefile.cross23
1 files changed, 13 insertions, 10 deletions
diff --git a/Makefile.cross b/Makefile.cross
index 5686d557a63..951b3757da1 100644
--- a/Makefile.cross
+++ b/Makefile.cross
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile.cross,v 1.104 2019/10/14 14:38:06 patrick Exp $
+# $OpenBSD: Makefile.cross,v 1.105 2019/10/14 15:23:44 patrick 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
@@ -80,19 +80,21 @@ CROSSGCC= ${CROSSDIR}/.gcc_done
.include <bsd.own.mk>
.for _arch in ${TARGET_ARCH}
-.if !empty(CLANG_ARCH:M${_arch})
-COMPILER_VERSION=clang
-BUILD_CLANG=yes
-CC=clang
-CXX=clang++
-.elif !empty(GCC3_ARCH:M${_arch})
+.if !empty(GCC3_ARCH:M${_arch})
COMPILER_VERSION=gcc3
+BUILD_CLANG=no
CC=gcc
CXX=g++
-.else
+.elif !empty(GCC4_ARCH:M${_arch})
COMPILER_VERSION=gcc4
+BUILD_CLANG=no
CC=gcc
CXX=g++
+.elif !empty(CLANG_ARCH:M${_arch})
+COMPILER_VERSION=clang
+BUILD_CLANG=yes
+CC=clang
+CXX=clang++
.endif
.if !empty(LLD_ARCH:M${_arch})
@@ -350,8 +352,9 @@ ${CROSSGCC}: ${CROSSBINUTILS}
cross-lib: ${CROSSGCC}
MACHINE=${TARGET} \
MACHINE_ARCH=${TARGET_ARCH} MACHINE_CPU=${TARGET_CPU} \
- BSDOBJDIR=${CROSSDIR}/usr/obj; \
- export MACHINE MACHINE_ARCH MACHINE_CPU BSDOBJDIR; \
+ BSDOBJDIR=${CROSSDIR}/usr/obj \
+ BUILD_CLANG=${BUILD_CLANG}; \
+ export MACHINE MACHINE_ARCH MACHINE_CPU BSDOBJDIR BUILD_CLANG; \
(cd ${.CURDIR}/lib; \
for lib in csu libcompiler_rt libc; do \
(cd $$lib; \