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

[Info, not a issue] cmake settings for gcc version above v12 #52

Open
cjacker opened this issue Nov 23, 2024 · 0 comments
Open

[Info, not a issue] cmake settings for gcc version above v12 #52

cjacker opened this issue Nov 23, 2024 · 0 comments

Comments

@cjacker
Copy link

cjacker commented Nov 23, 2024

  1. Due to -march changes of gcc version above v12, to use gcc version above v12, RV_ARCH in cmake/application.cmake of hpm_sdk should be changed from -march=rv32imac to -march=rv32imac_zicsr_zifencei.

open cmake/application.cmake and find:

if(NOT RV_ARCH)
    set(RV_ARCH "rv32imac_zicsr_zifencei")
endif()

Change set(RV_ARCH "rv32imac") to set(RV_ARCH "rv32imac_zicsr_zifencei").

  1. For users which use some prebuilt toolchains, such as xpack riscv toolchain, also need to set the gcc triplet in cmake/toolchain.cmake file to help SDK find the correct toolchain.

open cmake/toolchain.cmake and find:

elseif("${TOOLCHAIN_VARIANT}" STREQUAL "gcc")
  set(COMPILER gcc)
  set(LINKER ld)
  set(BINTOOLS gnu)
  set(C++ g++)
  set(CROSS_COMPILE_TARGET riscv32-unknown-elf)
  set(SYSROOT_TARGET       riscv32-unknown-elf)
  set(TOOLCHAIN_CMAKE gcc.cmake)

And change riscv32-unknown-elf to your toolchain's triplet, for example, for xpack riscv toolchain, it's riscv-none-elf.

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

No branches or pull requests

1 participant