https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103889

Jim Wilson <wilson at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |wilson at gcc dot gnu.org

--- Comment #14 from Jim Wilson <wilson at gcc dot gnu.org> ---
The RISC-V ABI defines 6 different ABIs currently (not including rv32e
support), so the old /lib and /lib64 distinction isn't enough.  We define 6
different directories where the libraries can be, depending on the ABI in use. 
For rv64/lp64d, the most common one, they go in /lib64/lp64d.  Desktop linux
does not use all of these ABIs, but embedded linux does.

Alibaba/T-Head incidentally has written linux kernel and qemu support for
running 32-bit code on a rv64 kernel, but I don't know if they have hardware
that supports this yet, and don't know if they are multilibbing/multiarching
yet.  I think it is only a matter of time before we have to support both 32-bit
and 64-bit code on rv64 systems.

Anyways, the first thing I would try is to make some links.  You can make
/lib64 a link to /lib, and make a /lib/lp64d link that points back at lib. 
Hence /lib64/lp64d will point at /lib.  Likewise for /usr/lib64/lp64d to point
at /usr/lib.  Then see if gccgo works.  Some linux distros already have these
links.  Adding these links to the OS might be the simplest solution if it
works.

If you don't link the symlink idea, then we probably need a new t-linux-musl
file.  And if you are using GNU Binutils, then you need GNU ld changes, since
it is hardwired to use the same dirs.  And if you are using glibc then you need
glibc changes too, but you mentioned musl so this doesn't apply to you, but
would apply to others if they want the same kind of changes for another linux
distro.

On a Fedora RISC-V system
[wilson@fedora-riscv /]$ ls -lt lib64
lrwxrwxrwx. 1 root root 9 Aug 12  2020 lib64 -> usr/lib64
[wilson@fedora-riscv /]$ cd /usr/lib64
[wilson@fedora-riscv lib64]$ ls -lt lp64d
lrwxrwxrwx. 1 root root 1 Aug  4 07:18 lp64d -> .
[wilson@fedora-riscv lib64]$ 
So both /lib64/lp64d and /usr/lib64/lp64d work, and point to the same place.

Reply via email to