diff options
author | Patrick Wildt <patrick@cvs.openbsd.org> | 2018-02-04 21:11:33 +0000 |
---|---|---|
committer | Patrick Wildt <patrick@cvs.openbsd.org> | 2018-02-04 21:11:33 +0000 |
commit | 226fb1a8de3395218fb87a27ce87b66c8c6bcc7d (patch) | |
tree | f40f35a84a6ba44a428b89440a5532a6ef9059cd /Makefile.cross | |
parent | d4bbf78d0134a935d6fad6f2cb607108d55cc3ef (diff) |
Don't assume that we use LLVM's ld(1) if we use clang(1) as main system
compiler. Only handle this case when LLD was actually installed during
the cross-compiler setup. Unbreaks armv7 after switching to clang since
it uses binutils' ld(1).
Diffstat (limited to 'Makefile.cross')
-rw-r--r-- | Makefile.cross | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/Makefile.cross b/Makefile.cross index f16d4f4c2df..4c2adab1c15 100644 --- a/Makefile.cross +++ b/Makefile.cross @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile.cross,v 1.98 2017/09/23 12:35:52 patrick Exp $ +# $OpenBSD: Makefile.cross,v 1.99 2018/02/04 21:11:32 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 @@ -249,12 +249,15 @@ ${CROSSGCC}: ${CROSSBINUTILS} ${MAKE} clean) 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 + @if [ -e ${CROSSDIR}/usr/bin/ld ]; then \ + mv ${CROSSDIR}/usr/bin/ld ${CROSSDIR}/usr/bin/${TARGET_CANON}-ld ;\ + cp -f ${CROSSDIR}/usr/bin/${TARGET_CANON}-ld \ + ${CROSSDIR}/usr/${TARGET_CANON}/bin/${TARGET_CANON}-ld ;\ + ln -sf ${TARGET_CANON}-ld ${CROSSDIR}/usr/${TARGET_CANON}/bin/ld ;\ + fi 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++; \ |