Reduce spurious rebuilds while running tests (RHEL-93937)

Resolves: RHEL-93937
This commit is contained in:
Arjun Shankar 2025-06-05 12:10:00 +02:00
parent 696da51adf
commit 994db2ff19
3 changed files with 131 additions and 1 deletions

25
glibc-RHEL-93937-1.patch Normal file
View File

@ -0,0 +1,25 @@
commit 81a1fa6cbfef5ca33e7eeb11f8f9a528f4dc0117
Author: Arjun Shankar <arjun@redhat.com>
Date: Tue Nov 5 16:41:25 2019 +0100
Fix run-one-test so that it runs elf tests
The `test' make target passes a trailing slash in the subdir argument. This
does not play well with elf/rtld-Rules which looks for `elf' without any
trailing slash, and therefore doesn't find a match when running an elf test
individually. This commit removes the trailing slash from the invocation.
Reviewed-by: DJ Delorie <dj@redhat.com>
diff --git a/Makefile b/Makefile
index 6518f62ee0676b0d..40066189f3f49441 100644
--- a/Makefile
+++ b/Makefile
@@ -518,6 +518,6 @@ iconvdata/% localedata/% po/%: FORCE
.PHONY: test
test :
@-rm -f $(objpfx)$t.out
- $(MAKE) subdir=$(dir $t) -C $(dir $t) ..=../ $(objpfx)$t.out
+ $(MAKE) subdir=$(patsubst %/,%,$(dir $t)) -C $(dir $t) ..=../ $(objpfx)$t.out
@cat $(objpfx)$t.test-result
@cat $(objpfx)$t.out

100
glibc-RHEL-93937-2.patch Normal file
View File

@ -0,0 +1,100 @@
commit 2fca4b624bd3ceb8c756b4145c7e96aa032b2b98
Author: Florian Weimer <fweimer@redhat.com>
Date: Wed Jun 4 17:44:19 2025 +0200
Makefile: Avoid $(objpfx)/ in makefiles
If paths with both $(objpfx)/ and $(objpfx) (which already includes
a trailing slash) appear during the build, this can trigger unexpected
rebuilds, or incorrect concurrent rebuilds.
Conflicts:
elf/Makefile: Test differences.
nss/Makefile: Test differences.
diff --git a/elf/Makefile b/elf/Makefile
index 38976f195a398abf..d09f5482c089f18c 100644
--- a/elf/Makefile
+++ b/elf/Makefile
@@ -1055,8 +1055,8 @@ $(objpfx)$(1).generated-makefile: $(1)
endef
endif
-postclean-generated += $(objpfx)/dso-sort-tests-2.generated-makefile \
- $(objpfx)/dso-sort-tests-2.generated-makefile
+postclean-generated += $(objpfx)dso-sort-tests-2.generated-makefile \
+ $(objpfx)dso-sort-tests-2.generated-makefile
# Generate from each testcase description file
ifeq (yes,$(have-tunables))
@@ -2674,7 +2674,7 @@ $(objpfx)tst-tls21: $(libdl) $(shared-thread-library)
$(objpfx)tst-tls21.out: $(objpfx)tst-tls21mod.so
$(objpfx)tst-tls21mod.so: $(tst-tls-many-dynamic-modules:%=$(objpfx)%.so)
-$(objpfx)tst-rtld-run-static.out: $(objpfx)/ldconfig
+$(objpfx)tst-rtld-run-static.out: $(objpfx)ldconfig
$(objpfx)tst-dlmopen-gethostbyname: $(libdl)
$(objpfx)tst-dlmopen-gethostbyname.out: $(objpfx)tst-dlmopen-gethostbyname-mod.so
diff --git a/nss/Makefile b/nss/Makefile
index 4ee8b1eefd792062..05fcadf60fd0d771 100644
--- a/nss/Makefile
+++ b/nss/Makefile
@@ -172,36 +172,36 @@ libof-nss_test1 = extramodules
libof-nss_test2 = extramodules
libof-nss_test_errno = extramodules
libof-nss_test_gai_hv2_canonname = extramodules
-$(objpfx)/libnss_test1.so: $(objpfx)nss_test1.os $(link-libc-deps)
+$(objpfx)libnss_test1.so: $(objpfx)nss_test1.os $(link-libc-deps)
$(build-module)
-$(objpfx)/libnss_test2.so: $(objpfx)nss_test2.os $(link-libc-deps)
+$(objpfx)libnss_test2.so: $(objpfx)nss_test2.os $(link-libc-deps)
$(build-module)
-$(objpfx)/libnss_test_errno.so: $(objpfx)nss_test_errno.os $(link-libc-deps)
+$(objpfx)libnss_test_errno.so: $(objpfx)nss_test_errno.os $(link-libc-deps)
$(build-module)
-$(objpfx)/libnss_test_gai_hv2_canonname.so: \
+$(objpfx)libnss_test_gai_hv2_canonname.so: \
$(objpfx)nss_test_gai_hv2_canonname.os $(link-libc-deps) \
- $(objpfx)/libnss_files.so
+ $(objpfx)libnss_files.so
$(build-module)
$(objpfx)nss_test2.os : nss_test1.c
ifdef libnss_test1.so-version
-$(objpfx)/libnss_test1.so$(libnss_test1.so-version): $(objpfx)/libnss_test1.so
+$(objpfx)libnss_test1.so$(libnss_test1.so-version): $(objpfx)libnss_test1.so
$(make-link)
endif
ifdef libnss_test2.so-version
-$(objpfx)/libnss_test2.so$(libnss_test2.so-version): $(objpfx)/libnss_test2.so
+$(objpfx)libnss_test2.so$(libnss_test2.so-version): $(objpfx)libnss_test2.so
$(make-link)
endif
-$(objpfx)/libnss_test_errno.so$(libnss_files.so-version): \
- $(objpfx)/libnss_test_errno.so
+$(objpfx)libnss_test_errno.so$(libnss_files.so-version): \
+ $(objpfx)libnss_test_errno.so
$(make-link)
-$(objpfx)/libnss_test_gai_hv2_canonname.so$(libnss_files.so-version): \
- $(objpfx)/libnss_test_gai_hv2_canonname.so
+$(objpfx)libnss_test_gai_hv2_canonname.so$(libnss_files.so-version): \
+ $(objpfx)libnss_test_gai_hv2_canonname.so
$(make-link)
$(patsubst %,$(objpfx)%.out,$(tests) $(tests-container)) : \
- $(objpfx)/libnss_test1.so$(libnss_test1.so-version) \
- $(objpfx)/libnss_test2.so$(libnss_test2.so-version) \
- $(objpfx)/libnss_test_errno.so$(libnss_files.so-version) \
- $(objpfx)/libnss_test_gai_hv2_canonname.so$(libnss_files.so-version)
+ $(objpfx)libnss_test1.so$(libnss_test1.so-version) \
+ $(objpfx)libnss_test2.so$(libnss_test2.so-version) \
+ $(objpfx)libnss_test_errno.so$(libnss_files.so-version) \
+ $(objpfx)libnss_test_gai_hv2_canonname.so$(libnss_files.so-version)
ifeq (yes,$(have-thread-library))
$(objpfx)tst-cancel-getpwuid_r: $(shared-thread-library)
@@ -211,4 +211,4 @@ $(objpfx)tst-nss-files-hosts-erange: $(libdl)
$(objpfx)tst-nss-files-hosts-multi: $(libdl)
$(objpfx)tst-nss-files-hosts-getent: $(libdl)
$(objpfx)tst-nss-files-alias-leak: $(libdl)
-$(objpfx)tst-nss-files-alias-leak.out: $(objpfx)/libnss_files.so
+$(objpfx)tst-nss-files-alias-leak.out: $(objpfx)libnss_files.so

View File

@ -115,7 +115,7 @@ end \
Summary: The GNU libc libraries
Name: glibc
Version: %{glibcversion}
Release: %{glibcrelease}.22
Release: %{glibcrelease}.23
# In general, GPLv2+ is used by programs, LGPLv2+ is used for
# libraries.
@ -1277,6 +1277,8 @@ Patch1042: glibc-RHEL-92685-6.patch
Patch1043: glibc-RHEL-92685-7.patch
Patch1044: glibc-RHEL-92685-8.patch
Patch1045: glibc-RHEL-92685-9.patch
Patch1046: glibc-RHEL-93937-1.patch
Patch1047: glibc-RHEL-93937-2.patch
##############################################################################
# Continued list of core "glibc" package information:
@ -2938,6 +2940,9 @@ fi
%{_libdir}/libpthread_nonshared.a
%changelog
* Thu Jun 05 2025 Arjun Shankar <arjun@redhat.com> - 2.28-251.23
- Reduce spurious rebuilds while running tests (RHEL-93937)
* Mon May 26 2025 Florian Weimer <fweimer@redhat.com> - 2.28-251.22
- CVE-2025-4802: static setuid dlopen may search LD_LIBRARY_PATH (RHEL-92685)