Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 7 Sep 2021 12:10:04 GMT
From:      Jessica Clarke <jrtc27@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: e515dd81ff4f - stable/13 - Fix bootstrapping to actually build lldb-tblgen for later use
Message-ID:  <202109071210.187CA4js089958@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by jrtc27:

URL: https://cgit.FreeBSD.org/src/commit/?id=e515dd81ff4f5d8b8b642078ceff54086b5cb7c0

commit e515dd81ff4f5d8b8b642078ceff54086b5cb7c0
Author:     Jessica Clarke <jrtc27@FreeBSD.org>
AuthorDate: 2021-08-24 13:59:04 +0000
Commit:     Jessica Clarke <jrtc27@FreeBSD.org>
CommitDate: 2021-09-07 12:08:18 +0000

    Fix bootstrapping to actually build lldb-tblgen for later use
    
    Because MK_LLDB=no is in BSARGS, the bootstrap-tools recursive make does
    not add lldb-tblgen to _clang_tblgen, causing it to not be built. This
    means that the build currently always uses the host's lldb-tblgen
    (which, whilst currently it appears to work, could in future break if
    TableGen backends are added or altered) and, if it doesn't exist (either
    because the current FreeBSD system was built with it disabled, or you're
    building on macOS/Linux), fails. Linux and macOS cross-builds used to
    work simply because LLDB was previously in BROKEN_OPTIONS when building
    on non-FreeBSD.
    
    Instead, move MK_LLDB=no from BSARGS to XMAKE. This ensures that the
    lib/clang build in cross-tools continues to not build LLDB parts for the
    bootstrap toolchain (both to save time/space on FreeBSD, and because our
    vendored LLDB does not include the macOS and Linux host files so those
    would fail to build).
    
    The DIRDEPS target is updated to move MK_LLDB=no from the BSARGS block
    that mirrors Makefile.inc1 to the line that disables additional
    toolchain components. The DIRDEPS build likely suffers from the same
    issue currently, but having never used it and not being familiar with
    how it works I am leaving that as-is. If it does suffer from the same
    issue it should be easily reproducible by renaming /usr/bin/lldb-tblgen
    or moving it to a directory not in PATH.
    
    Fixes:          31ba4ce8898f ("Allow bootstrapping llvm-tblgen on macOS and Linux")
    MFC after:      1 week
    Reviewed by:    dim, emaste, imp
    Differential Revision:  https://reviews.freebsd.org/D31531
    
    (cherry picked from commit 1e4c802913af619ac15741bbd276e1141ca17dc9)
---
 Makefile.inc1                           | 2 +-
 targets/pseudo/bootstrap-tools/Makefile | 3 +--
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/Makefile.inc1 b/Makefile.inc1
index 81567af5897b..376d48d4fffb 100644
--- a/Makefile.inc1
+++ b/Makefile.inc1
@@ -738,7 +738,6 @@ BSARGS= 	DESTDIR= \
 		MK_CLANG_FORMAT=no \
 		MK_CLANG_FULL=no \
 		MK_HTML=no \
-		MK_LLDB=no \
 		MK_MAN=no \
 		MK_PROFILE=no \
 		MK_RETPOLINE=no \
@@ -779,6 +778,7 @@ TMAKE=		\
 XMAKE=		${BMAKE} \
 		TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \
 		MK_CLANG_IS_CC=${MK_CLANG_BOOTSTRAP} \
+		MK_LLDB=no \
 		MK_TESTS=no
 
 # kernel-tools stage
diff --git a/targets/pseudo/bootstrap-tools/Makefile b/targets/pseudo/bootstrap-tools/Makefile
index 3ac47053a388..d5545f082283 100644
--- a/targets/pseudo/bootstrap-tools/Makefile
+++ b/targets/pseudo/bootstrap-tools/Makefile
@@ -48,7 +48,6 @@ BSARGS= 	DESTDIR= \
 		MK_CLANG_FORMAT=no \
 		MK_CLANG_FULL=no \
 		MK_HTML=no \
-		MK_LLDB=no \
 		MK_MAN=no \
 		MK_PROFILE=no \
 		MK_RETPOLINE=no \
@@ -59,7 +58,7 @@ BSARGS= 	DESTDIR= \
 		MK_MAN_UTILS=yes
 
 # We will handle building the toolchain and cross-compiler.
-BSARGS+= MK_CROSS_COMPILER=no MK_CLANG=no
+BSARGS+= MK_CROSS_COMPILER=no MK_CLANG=no MK_LLDB=no
 
 DISTRIB_ENV=	INSTALL="sh ${SRCTOP}/tools/install.sh" NO_FSCHG=1 MK_TESTS=no
 legacy: .MAKE ${META_DEPS}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202109071210.187CA4js089958>