On 9/10/24 21:33, Vagrant Cascadian wrote:
On 2024-08-27, Heinrich Schuchardt wrote:As a first step let us add a 32bit OpenSBI to our opensbi package as /usr/lib/riscv32-linux-gnu/opensbi/generic/fw_*. Debian's riscv64-linux-gnu-gcc can build the 32bit OpenSBI when setting PLATFORM_RISCV_XLEN=32.I would be happy to apply a patch to add this, but my naive attempt so far still produces 64-bit opensbi binaries even when passing PLATFORM_RISCV_XLEN=32 and using CROSS_COMPILE=riscv64-linux-gnu- Also needs some more trickery to get it to build each variant in a separate build directory ... it seems to default to build/platform even when passing O= ... or more ugly, cleaning the directory in-between invocations? It would be nice to get this settled, though! :)
Hello Vagrant, I could not reproduce your issues.Please, have a look at https://launchpad.net/~xypron/+archive/ubuntu/opensbi/ and at the appended diff.
$ file /usr/lib/riscv32-linux-gnu/opensbi/generic/*.elf/usr/lib/riscv32-linux-gnu/opensbi/generic/fw_dynamic.elf: ELF 32-bit LSB pie executable, UCB RISC-V, RVC, soft-float ABI, version 1 (SYSV), static-pie linked, stripped /usr/lib/riscv32-linux-gnu/opensbi/generic/fw_jump.elf: ELF 32-bit LSB pie executable, UCB RISC-V, RVC, soft-float ABI, version 1 (SYSV), static-pie linked, stripped
$ qemu-system-riscv32 -M virt -nographic \ -bios /lib/riscv32-linux-gnu/opensbi/generic/fw_dynamic.bin runs fine. Best regards Heinrich
opensbi_1.5-1_1.5-2~ppa1.diff.gz
Description: application/gzip