This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH v4 03/10] RISC-V: Add path of library directories for the 32-bit
- From: Andrew Waterman <andrew at sifive dot com>
- To: Joseph Myers <joseph at codesourcery dot com>
- Cc: DJ Delorie <dj at redhat dot com>, Zong Li <zongbox at gmail dot com>, Palmer Dabbelt <palmer at dabbelt dot com>, Darius Rad <darius at bluespec dot com>, libc-alpha at sourceware dot org, Zong Li <zong at andestech dot com>
- Date: Mon, 10 Dec 2018 14:09:09 -0800
- Subject: Re: [PATCH v4 03/10] RISC-V: Add path of library directories for the 32-bit
- References: <xnbm5xouag.fsf@greed.delorie.com> <alpine.DEB.2.21.1812102155220.7185@digraph.polyomino.org.uk>
On Mon, Dec 10, 2018 at 2:02 PM Joseph Myers <joseph@codesourcery.com> wrote:
>
> On Fri, 7 Dec 2018, DJ Delorie wrote:
>
> > As much as I hate code duplication, I think we need separate macros for
> > 64 and 32 bit targets, else the 32-bit linker will search 64-bit
> > libraries and the 64-bit linker will search 32-bit libraries. While the
> > linker should be smart enough to skip incompatible libraries, it's
> > expensive to do so, and certainly "unexpected" from a developer's point
> > of view.
>
> This code is used in ldconfig, not in libc itself.
>
> As soon as you support executing RV32I code under an RV64I kernel (what's
> the status on that?), you need all the pieces described at
> <https://sourceware.org/ml/libc-alpha/2018-01/msg00008.html> to be set up
> appropriately for that, which includes a single definition of this macro
> handling all the ABIs.
The status of RV32 binaries under RV64 kernels is that the ISA
optionally supports having different XLEN for user and supervisor
modes, but AFAIK there's no silicon that implements this feature, and
the Linux kernel doesn't support it yet.
>
> Until then, you only need those pieces set up for simultaneous support of
> the two floating-point ABI variants. That's already done for the two
> 64-bit ABIs. But sysdeps/unix/sysv/linux/riscv/ldd-rewrite.sed looks
> specific to 64-bit, and I don't see anything in this patch series that
> makes it handle 32-bit (so that ldd on a 32-bit RISC-V system can handle
> binaries for both 32-bit ABIs).
>
> --
> Joseph S. Myers
> joseph@codesourcery.com