Skip to content

Commit

Permalink
Add temporary config files and settings for RISC-V development
Browse files Browse the repository at this point in the history
  • Loading branch information
silvanshade committed Jan 18, 2024
1 parent 4d32708 commit d60b753
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[env]
CC_riscv64gc-unknown-linux-gnu = "clang-17 --target=riscv64-unknown-linux-gnu -march=rv64gcv1p0 -fuse-ld=lld-17"
CXX_riscv64gc-unknown-linux-gnu = "clang++-17 --target=riscv64-unknown-linux-gnu -march=rv64gcv1p0 -fuse-ld=lld-17"

[build]
target = "riscv64gc-unknown-linux-gnu"

[target.riscv64gc-unknown-linux-gnu]
runner = "qemu-riscv64 -cpu rv64,v=true,vext_spec=v1.0"
linker = "clang-17"
rustflags = [
"-C", "link-arg=-fuse-ld=lld-17",
"-C", "link-arg=-march=rv64gcv1p0",
"-C", "link-arg=--target=riscv64-unknown-linux-gnu",
"-C", "target-feature=+v",
]
12 changes: 12 additions & 0 deletions c/.clangd
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Diagnostics:
Suppress:
- -Wimplicit-function-declaration
- fatal_too_many_errors
- typecheck_convert_incompatible
- undeclared_var_use
UnusedIncludes: None
InlayHints:
Designators: Yes
Enabled: Yes
ParameterNames: Yes
DeducedTypes: Yes
15 changes: 15 additions & 0 deletions c/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
cmake_minimum_required(VERSION 3.9 FATAL_ERROR)

set(CMAKE_GENERATOR Ninja)
set(CMAKE_BUILD_TYPE Release)
set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_CROSSCOMPILING_EMULATOR qemu-riscv64-static)
set(CMAKE_ASM_COMPILER clang-17)
set(CMAKE_ASM_COMPILER_TARGET riscv64-unknown-linux-gnu)
set(CMAKE_ASM_FLAGS_INIT "-march=rv64gcv1p0")
set(CMAKE_C_COMPILER clang-17)
set(CMAKE_C_COMPILER_TARGET riscv64-unknown-linux-gnu)
set(CMAKE_C_FLAGS_INIT "-march=rv64gcv1p0")
set(CMAKE_CXX_COMPILER clang++-17)
set(CMAKE_CXX_COMPILER_TARGET riscv64-unknown-linux-gnu)
set(CMAKE_CXX_FLAGS_INIT "-march=rv64gcv1p0")
set(CMAKE_EXE_LINKER_FLAGS "-fuse-ld=lld-17")

# respect C_EXTENSIONS OFF without explicitly setting C_STANDARD
if (POLICY CMP0128)
cmake_policy(SET CMP0128 NEW)
Expand Down

0 comments on commit d60b753

Please sign in to comment.