Skip to content

Instantly share code, notes, and snippets.

@jjyr
Last active July 8, 2019 12:34
Show Gist options
  • Save jjyr/5fa41d806ebd85221061cc6e3d24634f to your computer and use it in GitHub Desktop.
Save jjyr/5fa41d806ebd85221061cc6e3d24634f to your computer and use it in GitHub Desktop.
./configure --host=riscv64-unknown-elf CC=riscv64-unknown-elf-gcc CXX=riscv64-unknown-elf-g++ CFLAGS='-Os -Wl,-static -fdata-sections -ffunction-sections -Wl,--gc-sections -Wl,-s' CXXFLAGS='-Os -Wl,-static -fdata-sections -ffunction-sections -Wl,--gc-sections -Wl,-s'

cmake

  1. change CMAKE_C_COMPILER to riscv-unknown-elf-gcc
  2. change CMAKE_SYSTEM_NAME to Generic
  3. cmake

see https://gitlab.kitware.com/cmake/community/wikis/doc/cmake/CrossCompiling

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment