From: patrick Date: Sun, 4 Feb 2018 21:11:32 +0000 (+0000) Subject: Don't assume that we use LLVM's ld(1) if we use clang(1) as main system X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=55669736a702e9f5182d475b9ed4b5da03bbc5a7;p=openbsd 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). --- 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++; \