This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH v3 3/8] RISC-V: Add path of library directories for the 32 bit
- From: Zong Li <zong at andestech dot com>
- To: <joseph at codesourcery dot com>, <palmer at dabbelt dot com>, <darius at bluespec dot com>, <andrew at sifive dot com>, <dj at redhat dot com>
- Cc: <libc-alpha at sourceware dot org>, <zongbox at gmail dot com>, Zong Li <zong at andestech dot com>
- Date: Thu, 26 Jul 2018 22:16:23 +0800
- Subject: [PATCH v3 3/8] RISC-V: Add path of library directories for the 32 bit
- References: <cover.1532587497.git.zong@andestech.com>
For the recommand of 64 bit version, we add the libraries path of 32 bit in this
patch.
---
sysdeps/unix/sysv/linux/riscv/dl-cache.h | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/sysdeps/unix/sysv/linux/riscv/dl-cache.h b/sysdeps/unix/sysv/linux/riscv/dl-cache.h
index cbd6ef5..f3a999a 100644
--- a/sysdeps/unix/sysv/linux/riscv/dl-cache.h
+++ b/sysdeps/unix/sysv/linux/riscv/dl-cache.h
@@ -34,6 +34,8 @@
RISC-V, libraries can be found in paths ending in:
- /lib64/lp64d
- /lib64/lp64
+ - /lib32/ilp32d
+ - /lib32/ilp32
- /lib (only ld.so)
so this will add all of those paths.
@@ -51,7 +53,14 @@
size_t len = strlen (dir); \
char path[len + 9]; \
memcpy (path, dir, len + 1); \
- if (len >= 12 && ! memcmp(path + len - 12, "/lib64/lp64d", 12)) \
+ if (len >= 13 && ! memcmp(path + len - 13, "/lib32/ilp32d", 13)) \
+ { \
+ len -= 9; \
+ path[len] = '\0'; \
+ } \
+ if (len >= 12 \
+ && (! memcmp(path + len - 12, "/lib32/ilp32", 12) \
+ || ! memcmp(path + len - 12, "/lib64/lp64d", 12))) \
{ \
len -= 8; \
path[len] = '\0'; \
@@ -64,6 +73,10 @@
add_dir (path); \
if (len >= 4 && ! memcmp(path + len - 4, "/lib", 4)) \
{ \
+ memcpy (path + len, "32/ilp32d", 10); \
+ add_dir (path); \
+ memcpy (path + len, "32/ilp32", 9); \
+ add_dir (path); \
memcpy (path + len, "64/lp64d", 9); \
add_dir (path); \
memcpy (path + len, "64/lp64", 8); \
--
2.7.4