From dd80b24c72c50f4345d29b04439252a6e1e554c7 Mon Sep 17 00:00:00 2001 From: bdrewery Date: Wed, 20 Jun 2018 16:10:07 +0000 Subject: [PATCH] Rework WITHOUT_LLD/TOOLCHAIN fix from r327892 for cross-tools. MK_LLD is for the installed lld while MK_LLD_BOOTSTRAP is for the build tool. For WITH_SYSTEM_LINKER it is necesarry to separate the logic of these two. When building libllvm TOOLS_PREFIX will be defined and MK_LLD_BOOTSTRAP should be checked instead. Sponsored by: Dell EMC Differential Revision: https://reviews.freebsd.org/D15837 --- Makefile.inc1 | 1 - lib/clang/libllvm/Makefile | 9 ++++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Makefile.inc1 b/Makefile.inc1 index 4776f7a176ab..32eaabc78d7a 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -562,7 +562,6 @@ BSARGS= DESTDIR= \ -DNO_CPU_CFLAGS MK_WARNS=no MK_CTF=no \ MK_CLANG_EXTRAS=no MK_CLANG_FULL=no \ MK_LLDB=no MK_TESTS=no \ - MK_LLD=${MK_LLD_BOOTSTRAP} \ MK_INCLUDES=yes BMAKE= \ diff --git a/lib/clang/libllvm/Makefile b/lib/clang/libllvm/Makefile index 083e1dad861b..e4802d43c4e2 100644 --- a/lib/clang/libllvm/Makefile +++ b/lib/clang/libllvm/Makefile @@ -1284,16 +1284,19 @@ SRCS_ALL+= ${SRCS_EXT} .if ${MK_CLANG_FULL} != "no" SRCS_ALL+= ${SRCS_FUL} .endif -.if ${MK_CLANG_EXTRAS} != "no" || ${MK_LLD} != "no" +.if ${MK_CLANG_EXTRAS} != "no" || ${MK_LLD} != "no" || \ + (defined(TOOLS_PREFIX) && ${MK_LLD_BOOTSTRAP} != "no") SRCS_ALL+= ${SRCS_EXL} .endif -.if ${MK_LLD} != "no" +.if ${MK_LLD} != "no" || \ + (defined(TOOLS_PREFIX) && ${MK_LLD_BOOTSTRAP} != "no") SRCS_ALL+= ${SRCS_LLD} .endif .if ${MK_CLANG_EXTRAS} != "no" || ${MK_LLDB} != "no" SRCS_ALL+= ${SRCS_XDB} .endif -.if ${MK_CLANG_EXTRAS} != "no" || ${MK_LLDB} != "no" || ${MK_LLD} != "no" +.if ${MK_CLANG_EXTRAS} != "no" || ${MK_LLDB} != "no" || ${MK_LLD} != "no" || \ + (defined(TOOLS_PREFIX) && ${MK_LLD_BOOTSTRAP} != "no") SRCS_ALL+= ${SRCS_XDL} .endif .if ${MK_CLANG_EXTRAS} != "no" || ${MK_LLDB} != "no" || !defined(TOOLS_PREFIX)