[PATCH] RISC-V: Fix library search path for rv32

10 views
Skip to first unread message

Kito Cheng

unread,
Sep 19, 2018, 5:27:20 AM9/19/18
to binu...@sourceware.org, Jim Wilson, Palmer Dabbelt, Zong Li, pat...@groups.riscv.org
Hi all:

Current rv32 library search path are set to lib/<abi>, however
according the library path settings in gcc [1], it should be
lib32/<abi>.

We've verified that with glibc testsuite for glibc/rv32 port

2018-09-19 Kito Cheng <ki...@andestech.com>
ld/
* emulparams/elf32lriscv.sh: Correct the library search path.
* emulparams/elf32lriscv_ilp32.sh: Likewise.
* emulparams/elf32lriscv_ilp32f.sh: Likewise.


[1] https://github.com/riscv/riscv-gcc/blob/riscv-gcc-8.1.0/gcc/config/riscv/t-linux

Jim Wilson

unread,
Sep 19, 2018, 5:37:53 PM9/19/18
to Kito Cheng, Binutils, Palmer Dabbelt, Zong Li, RISC-V Patches
On Wed, Sep 19, 2018 at 2:27 AM Kito Cheng <kito....@gmail.com> wrote:
> Current rv32 library search path are set to lib/<abi>, however
> according the library path settings in gcc [1], it should be
> lib32/<abi>.

I think the gcc change predates the point where 64-bit glibc was
upstreamed, so gcc isn't necessarily correct here. But if you are
making your glibc patches agree with gcc, then certainly we can fix
binutils to match gcc and glibc.

You forgot to include the patch again though. All I got is the ChangeLog entry.

Jim

Kito Cheng

unread,
Sep 19, 2018, 9:50:49 PM9/19/18
to pat...@groups.riscv.org, binu...@sourceware.org, Palmer Dabbelt, Zong Li
Oh, damm, I am so careless...rv32 glibc supporting[1] is under review,
and its using lib32/<abi> as search path, so this change is
prerequirement of rv32 glibc.

Code snippet from [1]:

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.


[1] https://sourceware.org/ml/libc-alpha/2018-07/msg00470.html
> --
> You received this message because you are subscribed to the Google Groups "RISC-V Patches" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to patches+u...@groups.riscv.org.
> To post to this group, send email to pat...@groups.riscv.org.
> Visit this group at https://groups.google.com/a/groups.riscv.org/group/patches/.
> To view this discussion on the web visit https://groups.google.com/a/groups.riscv.org/d/msgid/patches/CAFyWVaYUpha9RWMfjfzfG9y0u0%2BiPJzLwQLH12qCtGfVWLQR1g%40mail.gmail.com.
> For more options, visit https://groups.google.com/a/groups.riscv.org/d/optout.
0001-RISC-V-Fix-library-search-path-for-rv32.patch

Jim Wilson

unread,
Sep 20, 2018, 3:10:07 PM9/20/18
to Kito Cheng, pat...@groups.riscv.org, binu...@sourceware.org, Palmer Dabbelt, Zong Li
On 09/19/2018 06:50 PM, Kito Cheng wrote:
> Oh, damm, I am so careless...rv32 glibc supporting[1] is under review,
> and its using lib32/<abi> as search path, so this change is
> prerequirement of rv32 glibc.

OK. Patch committed.

Jim

Reply all
Reply to author
Forward
0 new messages