bao-project / bao-demos

A guide on how to build and use a set of Bao guest configurations for various platforms
Other
33 stars 37 forks source link

error: unrecognized argument in option '-mcmodel=large' #57

Closed pcotret closed 1 month ago

pcotret commented 1 month ago

Working on a Debian 12 distro

git clone https://github.com/bao-project/bao-demos
cd bao-demos
export CROSS_COMPILE=/path/to/my/sifive/toolchain
export PLATFORM=zcu102
export DEMO=linux+freertos
make -j$(nproc)

Leads me to the following error:

$ make -j$(nproc)
make -C /home/pascal/bao-demos/guests/linux/lloader ARCH=aarch64 IMAGE=/home/pascal/bao-demos/wrkdir/srcs/buildroot-aarch64-v6.1/output/images/Image-zcu104 DTB=/home/pascal/bao-demos/wrkdir/imgs/zcu104/linux+freertos/linux.dtb TARGET=/home/pascal/bao-demos/wrkdir/imgs/zcu104/linux+freertos/linux
make[1]: warning: jobserver unavailable: using -j1.  Add '+' to parent make rule.
make[1]: Entering directory '/home/pascal/bao-demos/guests/linux/lloader'
/opt/riscv64-unknown-elf-toolchain-10.2.0-2020.12.8-x86_64-linux-ubuntu14/bin/riscv64-unknown-elf-gcc -Wl,-build-id=none -nostdlib -T loader_aarch64.ld\
    -o /home/pascal/bao-demos/wrkdir/imgs/zcu104/linux+freertos/linux.elf -mcmodel=large  aarch64.S -I. -D IMAGE=/home/pascal/bao-demos/wrkdir/srcs/buildroot-aarch64-v6.1/output/images/Image-zcu104 -D DTB=/home/pascal/bao-demos/wrkdir/imgs/zcu104/linux+freertos/linux.dtb
riscv64-unknown-elf-gcc: error: unrecognized argument in option '-mcmodel=large'
riscv64-unknown-elf-gcc: note: valid arguments to '-mcmodel=' are: compact medany medlow
josecm commented 1 month ago

@pcotret I am confused. You are using a risc-v toolchain while targeting an aarch64 platform.

If you are targeting zcu102, you should use the first toolchain in the list:

a) For Armv8 Aarch64, use the aarch64-none-elf- toolchain.
pcotret commented 1 month ago

Ooops, sorry @josecm. I close my issue.

EDIT: it worked better with the right compiler ;)

josecm commented 1 month ago

No problem! Thanks