[glibc] LoongArch: Add standard search paths for 32-bit

Yinyu Cai via Glibc-cvs <[email protected]>
Newsgroups gmane.comp.lib.glibc.cvs
Message-ID <[email protected]>
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=b3d14eff4fe5c9a3d52ab076d3edd29f96f0082d

commit b3d14eff4fe5c9a3d52ab076d3edd29f96f0082d
Author: mengqinggang <[email protected]>
Date:   Mon Aug 24 17:48:52 2026 +0800

    LoongArch: Add standard search paths for 32-bit
    
    Previously, add_system_dir added different paths depending on the ABI:
      ilp32d: /lib32
      ilp32s: /lib32/sf
    
    Now, add_sysmtem_dir adds all of the following directories to standard
    search path for both ilp32d ABI and ilp32s ABI:
      /lib
      /lib32
      /lib32/sf
      /lib64
      /lib64/sf
    
    This change fixes elf/tst-ptrguard-static-dlopen on ilp32s ABI.
    The test is a statically linked executable with dlopen
    tst-ptrguard-static-dlopen-mod.so. Without this patch, the test fails
    because it looks for ld.so in /lib32/sf, but the file is actually
    in /lib32.

Diff:
---
 sysdeps/unix/sysv/linux/loongarch/dl-cache.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/sysdeps/unix/sysv/linux/loongarch/dl-cache.h b/sysdeps/unix/sysv/linux/loongarch/dl-cache.h
index 955f0dc68f..e52c6e2090 100644
--- a/sysdeps/unix/sysv/linux/loongarch/dl-cache.h
+++ b/sysdeps/unix/sysv/linux/loongarch/dl-cache.h
@@ -33,6 +33,8 @@
    LoongArch, libraries can be found in paths ending in:
      - /lib64
      - /lib64/sf
+     - /lib32
+     - /lib32/sf
    so this will add all of those paths.  */
 
 #define add_system_dir(dir) 						\
@@ -41,6 +43,8 @@
       static const char* lib_dirs[] = {					\
 	"/lib64",							\
 	"/lib64/sf",							\
+	"/lib32",							\
+	"/lib32/sf",							\
 	NULL,								\
       };								\
       const size_t lib_len = sizeof ("/lib") - 1;			\
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.