Soft-float problem happens when building seL4test using riscv64-unknown-linux-gnu-gcc toolchain
Hi, I met a problem when building seL4test project with riscv toolchain, with the float operations compiled as soft-float. Here are my configuration commands: python3 ~/bin/repo init -u https://github.com/seL4/sel4test-manifest python3 ~/bin/repo sync mkdir build-riscv cd build-riscv ../init-build.sh -DPLATFORM=qemu-riscv-virt -DCROSS_COMPILER_PREFIX=riscv64-unknown-linux-gnu- -DSIMULATION=TRUE ninja The terminal reported "can't link double-float modules with soft-float modules" errors when compiling fpu.c, and thus stopped compilation. I have tried rebuilding the glibc version riscv toolchain, with multilib enabled. But it doesn't work. I also checked the terminal, it says that I'm compiling with march=riscv64imac_zicsr_zifencei -mabi=lp64, which as the best of my knowledge, means compiling the float as soft-float. I want to know whether I lossed something. I would appreciate for any help. Thanks in advance.
Hello, I had the same issue and solved it by installing gcc-riscv64-unknown-elf instead of gcc-riscv64-linux-gnu. Hope that helps, Indan On 2023-07-13 09:48, sueboxian@gmail.com wrote:
Hi, I met a problem when building seL4test project with riscv toolchain, with the float operations compiled as soft-float. Here are my configuration commands:
python3 ~/bin/repo init -u https://github.com/seL4/sel4test-manifest python3 ~/bin/repo sync mkdir build-riscv cd build-riscv ../init-build.sh -DPLATFORM=qemu-riscv-virt -DCROSS_COMPILER_PREFIX=riscv64-unknown-linux-gnu- -DSIMULATION=TRUE ninja
The terminal reported "can't link double-float modules with soft-float modules" errors when compiling fpu.c, and thus stopped compilation.
I have tried rebuilding the glibc version riscv toolchain, with multilib enabled. But it doesn't work.
I also checked the terminal, it says that I'm compiling with march=riscv64imac_zicsr_zifencei -mabi=lp64, which as the best of my knowledge, means compiling the float as soft-float.
I want to know whether I lossed something. I would appreciate for any help.
Thanks in advance.
A patch has just been merged that may fix this. The problem was https://github.com/seL4/seL4/issues/749 --- not all the places that need the flag change were found. Peter C -- Dr Peter Chubb https://trustworthy.systems/ Trustworthy Systems Group CSE, UNSW Core hours: Mon 8am-3pm; Wed: 8am-5pm; Fri 8am-12pm.
I have tried rebuilding riscv newlib toolchain, but it doesn't work... I think maybe it is the 12.2 version gcc bug mentioned by Dr Peter Chubb. I will try to rebuild the toolchain with 14.0 gcc. Thank you for providing advice!
"sueboxian" == sueboxian
writes:
sueboxian> Hi, I met a problem when building seL4test project with sueboxian> riscv toolchain, with the float operations compiled as sueboxian> soft-float. Here are my configuration commands: python3 sueboxian> ~/bin/repo init -u There seems to be a bug in gcc 12 that causes this too .... if you rebuild your toolchain to gcc 14 it'll fix it. The bug is that the -march= line confuses GCC's attempts to work out where the gcc specific runtime files are so it uses the generic ones (with hardware double-floats). To check, do riscv64-unknown-linux-gnu-g++ -mabi=lp64 -march=rv64imac_zifencei_zicsr --print-file-name=crtbegin.o On gcc 12 I see: /opt/riscv/lib/gcc/riscv64-unknown-linux-gnu/12.2.0/crtbegin.o which is incorrect; On gcc 14 I see: /opt/riscv/lib/gcc/riscv64-unknown-linux-gnu/14.0.0/lib64/lp64/crtbegin.o which is correct. Peter C -- Dr Peter Chubb https://trustworthy.systems/ Trustworthy Systems Group CSE, UNSW Core hours: Mon 8am-3pm; Wed: 8am-5pm; Fri 8am-12pm.
I found that my gcc version is 12.2, with the ternimal shows: /home/gale/riscv/lib/gcc/riscv64-unknown-elf/12.2.0/crtbegin.o I will try to rebuild the 14.0 version. Thank you for providing advise!
Hi Dr Peter Chubb: Although I can't find the 14.0 gcc in the riscv toolchain github, my seL4test can work with 11.1 gcc now. Thank you very much!
participants (3)
-
Indan Zupancic
-
Peter Chubb
-
sueboxian@gmail.com