riscv-pk icon indicating copy to clipboard operation
riscv-pk copied to clipboard

Problem during 32bit compilation

Open aignacio opened this issue 7 years ago • 3 comments

Hi, I'm trying to build the pk/bbl to a 32-bit target but I think that the right argument it's --with-arch=rv32ima instead of --enable-32bit, also the libs like gcc are not pointing to the right path in the riscv-gnu-toolchain after installed.

aignacio avatar Nov 06 '18 15:11 aignacio

What I did was first put my cross compiler at the front of my $PATH and then defined the cross compilers as variables because I am using the multilib one:

mkdir build/
cd build/

../configure --host=riscv32-unknown-elf CC=riscv64-unknown-elf-gcc CXX=riscv64-unknown-elf-g++ AR=riscv64-unknown-elf-ar READELF=riscv64-unknown-elf-readelf OBJCOPY=riscv64-unknown-elf-objcopy LDFLAGS="-march=rv32i -mabi=ilp32" CFLAGS="-march=rv32i -mabi=ilp32" --with-payload=${PAYLOAD} --with-arch=rv32i

make

If I run on qemu I can get to the first printm call but it hangs there.

Jesse-Millwood avatar Jul 23 '19 01:07 Jesse-Millwood

tks @Jesse-Millwood

aignacio avatar Jul 24 '19 01:07 aignacio

It seems that the device tree needs to be at an aligned address after the payload? I'm not sure how to do this though.

Jesse-Millwood avatar Jul 24 '19 11:07 Jesse-Millwood