summaryrefslogtreecommitdiff
path: root/Makefile.cross
diff options
context:
space:
mode:
authorPatrick Wildt <patrick@cvs.openbsd.org>2017-05-23 14:57:31 +0000
committerPatrick Wildt <patrick@cvs.openbsd.org>2017-05-23 14:57:31 +0000
commite392be022c1bb04aedd798ce41e7200cdf81a458 (patch)
tree3403b94deb5b3e0b7d51158588dc5eb7bf087805 /Makefile.cross
parent7e106f6c620e73373b9bea44a1a92dac95f4ecb8 (diff)
Adjust cross-toolchain environment to the changes in the clang build
fabric. Since we now also build and use LLVM's lld we can copy lld to the proper directory akin to what we do with clang. Build compiler-rt early as it is needed for building libc. "go for it" mpi@
Diffstat (limited to 'Makefile.cross')
-rw-r--r--Makefile.cross9
1 files changed, 7 insertions, 2 deletions
diff --git a/Makefile.cross b/Makefile.cross
index 3300a3231d2..1773251178a 100644
--- a/Makefile.cross
+++ b/Makefile.cross
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile.cross,v 1.93 2017/03/21 10:41:33 patrick Exp $
+# $OpenBSD: Makefile.cross,v 1.94 2017/05/23 14:57:30 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
@@ -82,6 +82,7 @@ CROSSGCC= ${CROSSDIR}/.gcc_done
.for _arch in ${TARGET_ARCH}
.if !empty(CLANG_ARCH:M${_arch})
COMPILER_VERSION=clang
+BUILD_CLANG=yes
.elif !empty(GCC3_ARCH:M${_arch})
COMPILER_VERSION=gcc3
.else
@@ -231,6 +232,7 @@ ${CROSSGCC}: ${CROSSBINUTILS}
MACHINE_ARCH=${TARGET_ARCH} \
${MAKE} depend)
(cd ${.CURDIR}/gnu/usr.bin/clang; \
+ CC=clang CXX=clang++ \
MAKEOBJDIR=obj.${MACHINE}.${TARGET} \
MACHINE_ARCH=${TARGET_ARCH} \
${MAKE} all)
@@ -241,9 +243,12 @@ ${CROSSGCC}: ${CROSSBINUTILS}
${MAKE} install)
mv ${CROSSDIR}/usr/bin/clang ${CROSSDIR}/usr/bin/${TARGET_CANON}-clang
mv ${CROSSDIR}/usr/bin/clang++ ${CROSSDIR}/usr/bin/${TARGET_CANON}-clang++
+ mv ${CROSSDIR}/usr/bin/ld ${CROSSDIR}/usr/bin/${TARGET_CANON}-ld
cp -f ${CROSSDIR}/usr/bin/${TARGET_CANON}-clang ${CROSSDIR}/usr/${TARGET_CANON}/bin/${TARGET_CANON}-clang
+ cp -f ${CROSSDIR}/usr/bin/${TARGET_CANON}-ld ${CROSSDIR}/usr/${TARGET_CANON}/bin/${TARGET_CANON}-ld
ln -sf ${TARGET_CANON}-cc ${CROSSDIR}/usr/${TARGET_CANON}/bin/cc
ln -sf ${TARGET_CANON}-c++ ${CROSSDIR}/usr/${TARGET_CANON}/bin/c++
+ ln -sf ${TARGET_CANON}-ld ${CROSSDIR}/usr/${TARGET_CANON}/bin/ld
echo "#!/bin/sh\n${CROSSDIR}/usr/${TARGET_CANON}/bin/${TARGET_CANON}-clang --sysroot ${CROSSDIR} \"$$""@\"" > ${CROSSDIR}/usr/${TARGET_CANON}/bin/${TARGET_CANON}-cc; \
chmod +x ${CROSSDIR}/usr/${TARGET_CANON}/bin/${TARGET_CANON}-cc;
echo "#!/bin/sh\n${CROSSDIR}/usr/${TARGET_CANON}/bin/${TARGET_CANON}-clang --driver-mode=g++ --sysroot ${CROSSDIR} \"$$""@\"" > ${CROSSDIR}/usr/${TARGET_CANON}/bin/${TARGET_CANON}-c++; \
@@ -325,7 +330,7 @@ cross-lib: ${CROSSGCC}
BSDOBJDIR=${CROSSDIR}/usr/obj; \
export MACHINE MACHINE_ARCH MACHINE_CPU BSDOBJDIR; \
(cd ${.CURDIR}/lib; \
- for lib in csu libc; do \
+ for lib in csu libcompiler_rt libc; do \
(cd $$lib; \
eval ${CROSSENV} MAKEOBJDIR=obj.${MACHINE}.${TARGET} \
${MAKE} depend all ;\