Bug 30963 - [RISC-V] glibc doesn't support lp64f abi-variant
Summary: [RISC-V] glibc doesn't support lp64f abi-variant
Status: NEW
Alias: None
Product: glibc
Classification: Unclassified
Component: libc (show other bugs)
Version: 2.38
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-10-11 10:12 UTC by Akhilesh Kumar
Modified: 2023-10-12 09:25 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Akhilesh Kumar 2023-10-11 10:12:36 UTC
I am working on RISC-V, and I configured gcc with --enable-multilib 
from system lib and glibc source seems it only supports ilp32 ilp32d and lp64 
abi-variants, so my toolchain is not working for lp64f. 

Is there any way to use lp64f ?  

akhilesh.k@sri-1566:/tmp$ /opt/riscv/bin/riscv64-unknown-linux-gnu-gcc hello.c  -march=rv64imac -mabi=lp64
akhilesh.k@sri-1566:/tmp$ /opt/riscv/bin/riscv64-unknown-linux-gnu-gcc hello.c  -march=rv64imafdc -mabi=lp64
akhilesh.k@sri-1566:/tmp$ /opt/riscv/bin/riscv64-unknown-linux-gnu-gcc hello.c  -march=rv64imafdc -mabi=lp64d
akhilesh.k@sri-1566:/tmp$ /opt/riscv/bin/riscv64-unknown-linux-gnu-gcc hello.c  -march=rv64imafdc -mabi=lp64f
/opt/riscv/lib/gcc/riscv64-unknown-linux-gnu/13.2.0/../../../../riscv64-unknown-linux-gnu/bin/ld: cannot find crt1.o: No such file or directory
collect2: error: ld returned 1 exit status

My gcc configuration.
 
riscv-gnu-toolchain/gcc/configure --target=riscv64-unknown-linux-gnu --prefix=/opt/riscv --with-sysroot=/opt/riscv/sysroot --with-pkgversion=gc891d8dc23e --with-system-zlib --enable-shared --enable-tls --enable-languages=c,c++,fortran --disable-libmudflap --disable-libssp --disable-libquadmath --disable-libsanitizer --disable-nls --disable-bootstrap --src=.././gcc --enable-multilib --with-abi=lp64d --with-arch=rv64imafdc --with-tune=rocket --with-isa-spec=20191213 'CFLAGS_FOR_TARGET=-O2    -mcmodel=medlow' 'CXXFLAGS_FOR_TARGET=-O2    -mcmodel=medlow'
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 13.2.0 (gc891d8dc23e)
Comment 1 Adhemerval Zanella 2023-10-11 14:07:20 UTC
My understanding is it would require another, since single-float argument are passed in register and double as soft-float (in integer register).  And a new ABI is another permutation to build, check, verify, test which adds a maintainability burden (especially now with different extensions adding more build permutations, like zba, zbb, zbs, and even XTheadBb).  Do you really want to continue on the old ABIs road (like MIPS) and have multiple ABIs and extensions to maintain?
Comment 2 Akhilesh Kumar 2023-10-12 09:25:38 UTC
> My understanding is it would require another, since single-float argument are passed in register and double as soft-float (in integer register).


when I tried to configure gcc with all possible options for (lp64f) example "--with-arch=rv64ifd --with-abi=lp64f" or "--with-arch=rv64if_zfh --with-abi=lp64f"

Getting "unsupported FLEN" error 
sys-root/usr/include/bits/setjmp.h:35:3: error: #error unsupported FLEN

All other option for soft/hard(FLEN 64) working example rv64imac/lp64, rv64gc/lp64, and rv64gc/lp64d

FLEN (floating-point register width) could be 32 or 64 based ABIs like LP64F is FLEN 32 and LP64D is 64 


> Do you really want to continue on the old ABIs road (like MIPS) and have multiple ABIs and extensions to maintain?

No