[PATCH] Support: Build container programs like tests
H.J. Lu
hjl.tools@gmail.com
Thu Sep 11 20:34:43 GMT 2025
Add $(others-test) which contains container programs for support. They
are treated like programs in $(others), but linked like tests so that
--enable-hardcoded-path-in-tests also applies to them. Also replace
run-via-rtld-prefix with test-via-rtld-prefix when running container
tests.
Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
---
Rules | 7 ++++---
support/Makefile | 16 ++++++----------
2 files changed, 10 insertions(+), 13 deletions(-)
diff --git a/Rules b/Rules
index 44c041c491..90e4e41ef9 100644
--- a/Rules
+++ b/Rules
@@ -195,9 +195,10 @@ xtests:
> $(objpfx)subdir-xtests.sum
ifeq ($(build-programs),yes)
-binaries-all-notests = $(others) $(sysdep-others)
+binaries-all-notests = $(filter-out $(others-test), \
+ $(others) $(sysdep-others))
binaries-all-tests = $(tests) $(tests-internal) $(xtests) $(test-srcs) \
- $(tests-container)
+ $(tests-container) $(others-test)
binaries-all = $(binaries-all-notests) $(binaries-all-tests)
binaries-static-notests = $(others-static)
binaries-static-tests = $(tests-static) $(xtests-static)
@@ -385,7 +386,7 @@ $(objpfx)%.out: /dev/null $(objpfx)% # Make it 2nd arg for canned sequence.
# and pid namespaces) in which to run, should be added to
# tests-container.
$(tests-container:%=$(objpfx)%.out): $(objpfx)%.out : $(if $(wildcard $(objpfx)%.files),$(objpfx)%.files,/dev/null) $(objpfx)%
- $(test-wrapper-env) $(run-program-env) $(run-via-rtld-prefix) \
+ $(test-wrapper-env) $(run-program-env) $(test-via-rtld-prefix) \
$(common-objpfx)support/test-container env $(run-program-env) $($*-ENV) \
$(host-test-program-cmd) $($*-ARGS) > $@; \
$(evaluate-test)
diff --git a/support/Makefile b/support/Makefile
index f67f38130a..c4971afd98 100644
--- a/support/Makefile
+++ b/support/Makefile
@@ -299,19 +299,15 @@ endif
LDLIBS-test-container = $(libsupport)
-others += test-container
-others-noinstall += test-container
-
-others += \
- echo-container \
- shell-container \
- true-container \
- # others
-others-noinstall += \
+others-test = \
echo-container \
shell-container \
+ test-container \
true-container \
- # others-noinstall
+# others-test
+#
+others += $(others-test)
+others-noinstall += $(others-test)
others += $(LINKS_DSO_PROGRAM)
others-noinstall += $(LINKS_DSO_PROGRAM)
--
2.51.0
More information about the Libc-alpha
mailing list