diff options
author | Patrick Wildt <patrick@cvs.openbsd.org> | 2017-01-04 17:26:03 +0000 |
---|---|---|
committer | Patrick Wildt <patrick@cvs.openbsd.org> | 2017-01-04 17:26:03 +0000 |
commit | a6eea7d42273a14de37aa002229509b4ce2d86a8 (patch) | |
tree | 364f2aa53af905fbb3264df27a3a75d38ced01e7 /Makefile.cross | |
parent | 88d86dc475eec097889b9f886fdfeb2adc6b3fb3 (diff) |
With clang as cross-compiler we need to tell it where our cross
directory is so that the correct include and library paths are used.
For this we create a simple wrapper that calls clang in the correct
mode and also passes the sysroot.
ok kettenis@
Diffstat (limited to 'Makefile.cross')
-rw-r--r-- | Makefile.cross | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/Makefile.cross b/Makefile.cross index 01c1c843953..9bca4f0c4dd 100644 --- a/Makefile.cross +++ b/Makefile.cross @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile.cross,v 1.89 2016/12/18 17:03:08 patrick Exp $ +# $OpenBSD: Makefile.cross,v 1.90 2017/01/04 17:26:02 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 @@ -238,10 +238,13 @@ ${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++ - cp -f ${CROSSDIR}/usr/bin/${TARGET_CANON}-clang ${CROSSDIR}/usr/${TARGET_CANON}/bin/${TARGET_CANON}-cc - cp -f ${CROSSDIR}/usr/bin/${TARGET_CANON}-clang++ ${CROSSDIR}/usr/${TARGET_CANON}/bin/${TARGET_CANON}-c++ + cp -f ${CROSSDIR}/usr/bin/${TARGET_CANON}-clang ${CROSSDIR}/usr/${TARGET_CANON}/bin/${TARGET_CANON}-clang ln -sf ${TARGET_CANON}-cc ${CROSSDIR}/usr/${TARGET_CANON}/bin/cc ln -sf ${TARGET_CANON}-c++ ${CROSSDIR}/usr/${TARGET_CANON}/bin/c++ + 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++; \ + chmod +x ${CROSSDIR}/usr/${TARGET_CANON}/bin/${TARGET_CANON}-c++; .elif ${COMPILER_VERSION:L} == "gcc3" (cd ${.CURDIR}/gnu/usr.bin/gcc; \ MAKEOBJDIR=obj.${MACHINE}.${TARGET} \ |