[glibc/release/2.42/master] elf: don't clobber ld.so.conf in tst-glibc-hwcaps-prepend-cache [BZ #34210]

Sam James via Glibc-cvs <[email protected]> Mon, 8 Jun 2026 14:40:56 +0000 (GMT)
Newsgroups gmane.comp.lib.glibc.cvs
Message-ID <[email protected]>
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=748699d9385fc298f7d3369af0a015a6d88b7e64

commit 748699d9385fc298f7d3369af0a015a6d88b7e64
Author: Sam James <[email protected]>
Date:   Sat Jun 6 20:32:27 2026 +0100

    elf: don't clobber ld.so.conf in tst-glibc-hwcaps-prepend-cache [BZ #34210]
    
    dbe5065f2166be20e57a24f246a40d50e001a05d and ae589cb84df10825fc545a45c7007a5f79409bf1
    cater for setups where ld.so.conf{,.d} is required to find runtime support
    libraries, but tst-glibc-hwcaps-prepend-cache clobbers the created ld.so.conf
    with its own entry.
    
    Fix it to instead use the ld.so.conf.d created in ae589cb84df10825fc545a45c7007a5f79409bf1
    to co-exist with existing entries.
    
    Bug: https://bugs.gentoo.org/976773
    Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31901
    Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=34210
    Tested-by: Andreas K. Hüttel <[email protected]>
    Reported-by: Eli Schwartz <[email protected]>
    Reviewed-by: Andreas K. Hüttel <[email protected]>
    (cherry picked from commit d0cc9bf859d0434e397530d75a6507f13db79fba)

Diff:
---
 elf/tst-glibc-hwcaps-prepend-cache.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/elf/tst-glibc-hwcaps-prepend-cache.c b/elf/tst-glibc-hwcaps-prepend-cache.c
index b7df3962b5..2d51c22328 100644
--- a/elf/tst-glibc-hwcaps-prepend-cache.c
+++ b/elf/tst-glibc-hwcaps-prepend-cache.c
@@ -46,7 +46,7 @@ do_test (void)
 
   {
     /* Install the default implementation of libmarkermod1.so.  */
-    char *conf_path = xasprintf ("%s/ld.so.conf", support_sysconfdir_prefix);
+    char *conf_path = xasprintf ("%s/ld.so.conf.d/hwcaps.conf", support_sysconfdir_prefix);
     xmkdirp (support_sysconfdir_prefix, 0777);
     support_write_file_string (conf_path, "/glibc-test/lib\n");
     free (conf_path);