We currently build most of the lldb support code on all archs, even
though we only build and install the lldb executable (and lldb-server)
on amd64 and arm64. This wastes a significant amount of CPU cycles
during all base builds for no good reason that I can see.
The diff below puts the lldb-or-not switch in bsd.own.mk and skips the
support code build accordingly.
ok?
Index: share/mk/bsd.own.mk
===================================================================
RCS file: /home/cvs/src/share/mk/bsd.own.mk,v
retrieving revision 1.212
diff -u -p -r1.212 bsd.own.mk
--- share/mk/bsd.own.mk 23 Nov 2021 10:30:08 -0000 1.212
+++ share/mk/bsd.own.mk 7 Jul 2022 23:09:04 -0000
@@ -19,6 +19,7 @@ CLANG_ARCH=aarch64 amd64 arm i386 mips64
GCC4_ARCH=alpha hppa sh sparc64
GCC3_ARCH=m88k
LLD_ARCH=aarch64 amd64 arm i386 powerpc powerpc64 riscv64
+LLDB_ARCH=aarch64 amd64
# m88k: ?
PIE_ARCH=aarch64 alpha amd64 arm hppa i386 mips64 mips64el powerpc powerpc64
riscv64 sh sparc64
@@ -55,6 +56,12 @@ AR_VERSION?=llvm
.else
LINKER_VERSION?=bfd
AR_VERSION?=binutils
+.endif
+
+.if !empty(LLDB_ARCH:M${_arch})
+BUILD_LLDB?=yes
+.else
+BUILD_LLDB?=no
.endif
.if !empty(STATICPIE_ARCH:M${_arch})
Index: gnu/usr.bin/clang/Makefile
===================================================================
RCS file: /home/cvs/src/gnu/usr.bin/clang/Makefile,v
retrieving revision 1.19
diff -u -p -r1.19 Makefile
--- gnu/usr.bin/clang/Makefile 9 Jul 2022 16:25:37 -0000 1.19
+++ gnu/usr.bin/clang/Makefile 10 Jul 2022 00:14:39 -0000
@@ -51,6 +51,7 @@ SUBDIR+=liblldELF
SUBDIR+=lld
+.if ${BUILD_LLDB:L} == "yes"
SUBDIR+=lldb-tblgen
SUBDIR+=include/lldb/Commands
SUBDIR+=include/lldb/Core
@@ -97,6 +98,7 @@ SUBDIR+=liblldbUtility
SUBDIR+=lldb
SUBDIR+=lldb-server
+.endif
SUBDIR+=include/llvm-objcopy
SUBDIR+=llvm-objcopy
Index: gnu/usr.bin/clang/lldb/Makefile
===================================================================
RCS file: /home/cvs/src/gnu/usr.bin/clang/lldb/Makefile,v
retrieving revision 1.11
diff -u -p -r1.11 Makefile
--- gnu/usr.bin/clang/lldb/Makefile 17 Dec 2021 14:55:47 -0000 1.11
+++ gnu/usr.bin/clang/lldb/Makefile 18 Feb 2022 21:32:18 -0000
@@ -2,12 +2,7 @@
.include <bsd.own.mk>
-.if (${MACHINE} == "arm64") || (${MACHINE} == "amd64")
PROG= lldb
-.else
-NOPROG= lldb
-.endif
-
BINDIR= /usr/bin
LIBEXECDIR=/usr/libexec
Index: gnu/usr.bin/clang/lldb-server/Makefile
===================================================================
RCS file: /home/cvs/src/gnu/usr.bin/clang/lldb-server/Makefile,v
retrieving revision 1.6
diff -u -p -r1.6 Makefile
--- gnu/usr.bin/clang/lldb-server/Makefile 17 Dec 2021 14:55:47 -0000
1.6
+++ gnu/usr.bin/clang/lldb-server/Makefile 18 Feb 2022 21:32:26 -0000
@@ -2,12 +2,7 @@
.include <bsd.own.mk>
-.if (${MACHINE} == "arm64") || (${MACHINE} == "amd64")
PROG= lldb-server
-.else
-NOPROG= lldb-server
-.endif
-
BINDIR= /usr/bin
NOMAN=
--
jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF DDCC 0DFA 74AE 1524 E7EE