public inbox for buildroot@busybox.net
 help / color / mirror / Atom feed
From: "Alex Bennée" <alex.bennee@linaro.org>
To: buildroot@buildroot.org
Cc: Giulio Benetti <giulio.benetti@benettiengineering.com>,
	Romain Naour <romain.naour@gmail.com>,
	Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Subject: [Buildroot] [PATCH v6 1/6] toolchain/external: allow installing of libc utils
Date: Wed, 25 Feb 2026 10:55:30 +0000	[thread overview]
Message-ID: <20260225105537.1420002-2-alex.bennee@linaro.org> (raw)
In-Reply-To: <20260225105537.1420002-1-alex.bennee@linaro.org>

For buildroot's own tools we have BR2_PACKAGE_GLIBC_UTILS (and similar
for ulibc). As we need the tools for somethings we should also support
this for external toolchains.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
 toolchain/toolchain-external/Config.in        |  7 ++++++
 .../pkg-toolchain-external.mk                 | 24 +++++++++++++++++++
 2 files changed, 31 insertions(+)

diff --git a/toolchain/toolchain-external/Config.in b/toolchain/toolchain-external/Config.in
index 831387bc4e..e79dafa365 100644
--- a/toolchain/toolchain-external/Config.in
+++ b/toolchain/toolchain-external/Config.in
@@ -125,4 +125,11 @@ config BR2_TOOLCHAIN_EXTERNAL_GDB_SERVER_COPY
 	  Copy the gdbserver provided by the external toolchain to the
 	  target.
 
+config BR2_TOOLCHAIN_EXTERNAL_LIBC_UTILS_COPY
+	bool "Install libc utilities"
+	depends on BR2_TOOLCHAIN_EXTERNAL
+	help
+	  Enabling this option will compile and install the getconf,
+	  ldd and locale gibc utilities for the target.
+
 endif # BR2_TOOLCHAIN_EXTERNAL
diff --git a/toolchain/toolchain-external/pkg-toolchain-external.mk b/toolchain/toolchain-external/pkg-toolchain-external.mk
index 270cf814ed..b84abb6106 100644
--- a/toolchain/toolchain-external/pkg-toolchain-external.mk
+++ b/toolchain/toolchain-external/pkg-toolchain-external.mk
@@ -446,6 +446,29 @@ define TOOLCHAIN_EXTERNAL_INSTALL_TARGET_GDBSERVER
 endef
 endif
 
+ifeq ($(BR2_TOOLCHAIN_EXTERNAL_LIBC_UTILS_COPY),y)
+define TOOLCHAIN_EXTERNAL_INSTALL_TARGET_LIBC_UTILS
+	$(Q)$(call MESSAGE,"Copying libc utils")
+	$(Q)ARCH_SYSROOT_DIR="$(call toolchain_find_sysroot,$(TOOLCHAIN_EXTERNAL_CC) $(TOOLCHAIN_EXTERNAL_CFLAGS))" ; \
+	utils_found=0 ; \
+	for d in $${ARCH_SYSROOT_DIR} \
+	         $${ARCH_SYSROOT_DIR}/usr \
+		 $(TOOLCHAIN_EXTERNAL_INSTALL_DIR); do \
+		if test -f $${d}/bin/getconf ; then \
+			for f in getconf ldd locale; do \
+				install -m 0755 -D $${d}/bin/$${f} $(TARGET_DIR)/usr/bin ; \
+			done ; \
+			utils_found=1 ; \
+			break ; \
+		fi ; \
+	done ; \
+	if [ $${utils_found} -eq 0 ] ; then \
+		echo "Could not find libc utils in external toolchain" ; \
+		exit 1 ; \
+	fi
+endef
+endif
+
 define TOOLCHAIN_EXTERNAL_INSTALL_SYSROOT_LIBS
 	$(Q)SYSROOT_DIR="$(call toolchain_find_sysroot,$(TOOLCHAIN_EXTERNAL_CC))" ; \
 	ARCH_SYSROOT_DIR="$(call toolchain_find_sysroot,$(TOOLCHAIN_EXTERNAL_CC) $(TOOLCHAIN_EXTERNAL_CFLAGS))" ; \
@@ -627,6 +650,7 @@ endef
 define $(2)_INSTALL_TARGET_CMDS
 	$$(TOOLCHAIN_EXTERNAL_CREATE_TARGET_LIB_SYMLINK)
 	$$(TOOLCHAIN_EXTERNAL_INSTALL_TARGET_LIBS)
+	$$(TOOLCHAIN_EXTERNAL_INSTALL_TARGET_LIBC_UTILS)
 	$$(TOOLCHAIN_EXTERNAL_INSTALL_TARGET_GDBSERVER)
 	$$(TOOLCHAIN_EXTERNAL_FIXUP_UCLIBCNG_LDSO)
 	$$(TOOLCHAIN_EXTERNAL_INSTALL_TARGET_LDD)
-- 
2.47.3

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

  reply	other threads:[~2026-02-25 10:55 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-25 10:55 [Buildroot] [PATCH v6 0/6] kvm-unit-tests: update deps and fine tune qemu Alex Bennée
2026-02-25 10:55 ` Alex Bennée [this message]
2026-03-10 21:53   ` [Buildroot] [PATCH v6 1/6] toolchain/external: allow installing of libc utils Romain Naour via buildroot
2026-02-25 10:55 ` [Buildroot] [PATCH v6 2/6] package/kvm-unit-tests: update dependencies Alex Bennée
2026-03-10 22:02   ` Romain Naour via buildroot
2026-03-10 22:07     ` Romain Naour via buildroot
2026-02-25 10:55 ` [Buildroot] [PATCH v6 3/6] package/kvm-unit-tests: bump to v2025-07-31 Alex Bennée
2026-03-10 22:09   ` Romain Naour via buildroot
2026-02-25 10:55 ` [Buildroot] [PATCH v6 4/6] package/kvm-unit-tests: honour BR2_ARM64_PAGE_SIZE Alex Bennée
2026-03-10 22:16   ` Romain Naour via buildroot
2026-02-25 10:55 ` [Buildroot] [PATCH v6 5/6] support/testing: add test for kvm-unit-tests Alex Bennée
2026-03-10 22:31   ` Romain Naour via buildroot
2026-02-25 10:55 ` [Buildroot] [PATCH v6 6/6] package/kvm-unit-tests: allow kvmtool to be used Alex Bennée
2026-03-10 22:44   ` Romain Naour via buildroot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260225105537.1420002-2-alex.bennee@linaro.org \
    --to=alex.bennee@linaro.org \
    --cc=buildroot@buildroot.org \
    --cc=giulio.benetti@benettiengineering.com \
    --cc=romain.naour@gmail.com \
    --cc=thomas.petazzoni@bootlin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox