git: fbd7087b0be2 - main - strings: Unconditionally install ELF Tool Chain's strings

From: Ed Maste <emaste_at_FreeBSD.org>
Date: Mon, 05 May 2025 19:38:22 UTC
The branch main has been updated by emaste:

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

commit fbd7087b0be2f327f806a85b92789a719138df8c
Author:     Ed Maste <emaste@FreeBSD.org>
AuthorDate: 2025-04-30 13:35:54 +0000
Commit:     Ed Maste <emaste@FreeBSD.org>
CommitDate: 2025-05-05 19:38:06 +0000

    strings: Unconditionally install ELF Tool Chain's strings
    
    llvm-strings may consume a large amount of memory while reading the
    input file before producing any output.
    
    ELF Tool Chain's strings is small and lightweight, and we always install
    strings regardless of WITH_/WITHOUT_TOOLCHAIN settings (as it is useful
    in many contexts).  Return to always installing ELF Tool Chain's version
    of strings.
    
    This reverts commit 81fa5c4a828bec9f1ead280c59c31bd423e6eeea.
    This reverts commit 7ca3db1999cd967f9d6d7b259aa7af54aae14a5f.
    
    PR:             286605
    Reported by:    olivier
    Reviewed by:    olivier, brooks
    Sponsored by:   The FreeBSD Foundation
    Differential Revision: https://reviews.freebsd.org/D50084
---
 share/man/man5/src.conf.5                 | 4 +++-
 tools/build/options/WITHOUT_LLVM_BINUTILS | 2 ++
 tools/build/options/WITH_LLVM_BINUTILS    | 2 ++
 usr.bin/Makefile                          | 8 +-------
 usr.bin/clang/llvm-strings/Makefile       | 7 -------
 5 files changed, 8 insertions(+), 15 deletions(-)

diff --git a/share/man/man5/src.conf.5 b/share/man/man5/src.conf.5
index 2a052ad41d26..b3a327069393 100644
--- a/share/man/man5/src.conf.5
+++ b/share/man/man5/src.conf.5
@@ -1,5 +1,5 @@
 .\" DO NOT EDIT-- this file is @generated by tools/build/options/makeman.
-.Dd April 30, 2025
+.Dd May 5, 2025
 .Dt SRC.CONF 5
 .Os
 .Sh NAME
@@ -949,6 +949,8 @@ Regardless of this setting, LLVM tools are used for
 .Xr c++filt 1
 and
 .Xr objdump 1 .
+.Xr strings 1
+is always provided by ELF Tool Chain.
 .It Va WITHOUT_LLVM_COV
 Do not build the
 .Xr llvm-cov 1
diff --git a/tools/build/options/WITHOUT_LLVM_BINUTILS b/tools/build/options/WITHOUT_LLVM_BINUTILS
index 244bec49e695..35cc0c0e034f 100644
--- a/tools/build/options/WITHOUT_LLVM_BINUTILS
+++ b/tools/build/options/WITHOUT_LLVM_BINUTILS
@@ -13,3 +13,5 @@ Regardless of this setting, LLVM tools are used for
 .Xr c++filt 1
 and
 .Xr objdump 1 .
+.Xr strings 1
+is always provided by ELF Tool Chain.
diff --git a/tools/build/options/WITH_LLVM_BINUTILS b/tools/build/options/WITH_LLVM_BINUTILS
index 130997b7e9bf..164e6e8ffabd 100644
--- a/tools/build/options/WITH_LLVM_BINUTILS
+++ b/tools/build/options/WITH_LLVM_BINUTILS
@@ -14,3 +14,5 @@ Regardless of this setting, LLVM tools are used for
 .Xr c++filt 1
 and
 .Xr objdump 1 .
+.Xr strings 1
+is always provided by ELF Tool Chain.
diff --git a/usr.bin/Makefile b/usr.bin/Makefile
index 87896a2c0781..7f35a87b0d93 100644
--- a/usr.bin/Makefile
+++ b/usr.bin/Makefile
@@ -140,6 +140,7 @@ SUBDIR=	alias \
 	split \
 	stat \
 	stdbuf \
+	strings \
 	su \
 	systat \
 	tail \
@@ -250,13 +251,6 @@ SUBDIR.${MK_TOOLCHAIN}+=	nm
 SUBDIR.${MK_TOOLCHAIN}+=	readelf
 SUBDIR.${MK_TOOLCHAIN}+=	size
 .endif
-# Include elftoolchain's strings in build targets even if using LLVM_BINUTILS,
-# as we may later install with different options.  In particular, the release
-# artifact builds use default options for buildworld but install with
-# MK_TOOLCHAIN=no which implies MK_LLVM_BINUTILS=no.
-.if ${MK_LLVM_BINUTILS} == "no" || !make(install)
-SUBDIR+=			strings
-.endif
 SUBDIR.${MK_TOOLCHAIN}+=	c89
 SUBDIR.${MK_TOOLCHAIN}+=	c99
 SUBDIR.${MK_TOOLCHAIN}+=	ctags
diff --git a/usr.bin/clang/llvm-strings/Makefile b/usr.bin/clang/llvm-strings/Makefile
index f01a012b0cb9..dc0d77004fd8 100644
--- a/usr.bin/clang/llvm-strings/Makefile
+++ b/usr.bin/clang/llvm-strings/Makefile
@@ -1,5 +1,3 @@
-.include <src.opts.mk>
-
 PROG_CXX=	llvm-strings
 
 SRCDIR=		llvm/tools/llvm-strings
@@ -21,9 +19,4 @@ DEPENDFILES+=	${TGHDRS:C/$/.d/}
 DPSRCS+=	${TGHDRS}
 CLEANFILES+=	${TGHDRS} ${TGHDRS:C/$/.d/}
 
-.if ${MK_LLVM_BINUTILS} != "no"
-LINKS+=		${BINDIR}/llvm-strings ${BINDIR}/strings
-MLINKS+=	llvm-strings.1 strings.1
-.endif
-
 .include "../llvm.prog.mk"