[Devel] [PATCH hci-8.1] selftests/cgroup: make the lib directory an order-only prerequisite
Eva Kurchatova
eva.kurchatova at virtuozzo.com
Tue Oct 27 23:31:04 MSK 2026
cgroup_util.o depends on the directory it is written to, and a
directory's mtime moves whenever a file is created in it. The kvm
selftests write their own library objects to the same lib/ directory,
so it can end up newer than cgroup_util.o, and the next make rebuilds
cgroup_util.o and relinks every test that uses it.
That next make may run with other flags than the build: the kernel
package builds the selftests without the hardening flags and installs
them with them, and there the relink fails and the kvm tests are left
out of kernel-selftests-internal.
Make the directory an order-only prerequisite: it is still created
before the object, but its mtime no longer makes the object stale.
Fixes: 2c754a84ff16 ("cgroup: selftests: Move cgroup_util into its own library")
https://virtuozzo.atlassian.net/browse/VSTOR-152057
Feature: fix selftests
Signed-off-by: Eva Kurchatova <eva.kurchatova at virtuozzo.com>
---
tools/testing/selftests/cgroup/lib/libcgroup.mk | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/cgroup/lib/libcgroup.mk b/tools/testing/selftests/cgroup/lib/libcgroup.mk
index 7a73007204c3..bcf6fe251622 100644
--- a/tools/testing/selftests/cgroup/lib/libcgroup.mk
+++ b/tools/testing/selftests/cgroup/lib/libcgroup.mk
@@ -13,7 +13,7 @@ EXTRA_HDRS := $(selfdir)/clone3/clone3_selftests.h
$(LIBCGROUP_O_DIRS):
mkdir -p $@
-$(LIBCGROUP_O): $(OUTPUT)/%.o : $(CGROUP_DIR)/%.c $(EXTRA_HDRS) $(LIBCGROUP_O_DIRS)
+$(LIBCGROUP_O): $(OUTPUT)/%.o : $(CGROUP_DIR)/%.c $(EXTRA_HDRS) | $(LIBCGROUP_O_DIRS)
$(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c $< -o $@
EXTRA_CLEAN += $(LIBCGROUP_O)
--
2.56.0
More information about the Devel
mailing list