Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmake/rv-virt: usage error with Ubuntu stock gcc-riscv64-unknown-elf toolchain #11573

Closed
yf13 opened this issue Jan 21, 2024 · 1 comment · Fixed by #11579
Closed

cmake/rv-virt: usage error with Ubuntu stock gcc-riscv64-unknown-elf toolchain #11573

yf13 opened this issue Jan 21, 2024 · 1 comment · Fixed by #11579

Comments

@yf13
Copy link
Contributor

yf13 commented Jan 21, 2024

When using CMake subsystem on Ubuntu Jammy with stock gcc-riscv64-unknown-elf toolchain, got the following error:

$ cmake -S ~/Projects/Nuttx/nuttx/ -DBOARD_CONFIG=rv-virt/nsh64 
-- Initializing NuttX
--   Board:  rv-virt
--   Config: nsh64
--   Appdir: /home/yf/Projects/Nuttx/nuttx/../apps
-- The C compiler identification is GNU 10.2.0
-- The CXX compiler identification is GNU 10.2.0
-- The ASM compiler identification is GNU
-- Found assembler: /usr/bin/riscv64-unknown-elf-gcc
riscv64-unknown-elf-gcc: error:  -Wstrict-prototypes -fno-common -Wall -Wshadow -Wundef -Wno-attributes -Wno-unknown-pragmas: No such file or directory
riscv64-unknown-elf-gcc: error: unrecognized command-line option '-mcpu=sifive-u54'
riscv64-unknown-elf-gcc: error: unrecognized command-line option '-mcpu=sifive-u54'
riscv64-unknown-elf-gcc: error:  -Wstrict-prototypes -fno-common -Wall -Wshadow -Wundef -Wno-attributes -Wno-unknown-pragmas: No such file or directory
riscv64-unknown-elf-gcc: error: unrecognized command-line option '-mcpu=sifive-u54'
riscv64-unknown-elf-gcc: error: unrecognized command-line option '-mcpu=sifive-u54'
-- Configuring done
-- Generating done
-- Build files have been written to: /home/yf/tmp/aaa

@yf13 yf13 changed the title cmake/risc-v: usage error cmake/risc-v: usage error with Ubuntu stock gcc-riscv64-unknown-elf toolchain Jan 21, 2024
@yf13 yf13 changed the title cmake/risc-v: usage error with Ubuntu stock gcc-riscv64-unknown-elf toolchain cmake/rv-virt: usage error with Ubuntu stock gcc-riscv64-unknown-elf toolchain Jan 21, 2024
@anchao
Copy link
Contributor

anchao commented Jan 22, 2024

You need to update your toolchain to a newer version. These processor modules are only supported in gcc versions after 12:

nuttx/tools/ci/cibuild.sh

Lines 357 to 361 in 282feec

cd "${tools}"
wget --quiet https://github.com/xpack-dev-tools/riscv-none-elf-gcc-xpack/releases/download/v13.2.0-2/xpack-riscv-none-elf-gcc-13.2.0-2-${flavor}.tar.gz
tar zxf xpack-riscv-none-elf-gcc-13.2.0-2-${flavor}.tar.gz
mv xpack-riscv-none-elf-gcc-13.2.0-2 riscv-none-elf-gcc
rm xpack-riscv-none-elf-gcc-13.2.0-2-${flavor}.tar.gz

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants