summaryrefslogtreecommitdiff
path: root/ports/risc-v64/gnu/example_build/erbium/erbium_gnu.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'ports/risc-v64/gnu/example_build/erbium/erbium_gnu.cmake')
-rw-r--r--ports/risc-v64/gnu/example_build/erbium/erbium_gnu.cmake39
1 files changed, 39 insertions, 0 deletions
diff --git a/ports/risc-v64/gnu/example_build/erbium/erbium_gnu.cmake b/ports/risc-v64/gnu/example_build/erbium/erbium_gnu.cmake
new file mode 100644
index 00000000..0d55dd89
--- /dev/null
+++ b/ports/risc-v64/gnu/example_build/erbium/erbium_gnu.cmake
@@ -0,0 +1,39 @@
+# /***************************************************************************
+# * Copyright (c) 2026 Eclipse ThreadX contributors
+# *
+# * This program and the accompanying materials are made available under the
+# * terms of the MIT License which is available at
+# * https://opensource.org/licenses/MIT.
+# *
+# * AI Disclosure: This file was largely AI-generated by Claude Code (Opus 5.5).
+# * The AI-generated portions may be considered public domain (CC0-1.0)
+# * and not subject to the project's licence. The human contributor has
+# * reviewed and verified that the code is correct.
+# *
+# * SPDX-License-Identifier: MIT and CC0-1.0
+# ***************************************************************************/
+
+# CMake toolchain file for the Erbium example.
+#
+# Erbium implements only part of the F extension, so the example and the
+# ThreadX library are built for the integer ISA with the soft-float lp64 ABI.
+#
+# Target ISA : rv64imc_zicsr_zifencei
+# ABI : lp64 (64-bit long/ptr, soft-float)
+# Code model : medany (MRAM at 0x40000000, peripherals above 2 GiB)
+#
+# The riscv64-unknown-elf toolchain installed by scripts/install_riscv.sh is
+# built for lp64d only, so the example links without libc and libgcc
+# (-nostdlib); a missing helper is a link error rather than an ABI mix.
+
+set(CMAKE_SYSTEM_NAME Generic)
+set(CMAKE_SYSTEM_PROCESSOR risc-v64)
+
+set(THREADX_ARCH "risc-v64")
+set(THREADX_TOOLCHAIN "gnu")
+set(ARCH_FLAGS "-g -march=rv64imc_zicsr_zifencei -mabi=lp64 -mcmodel=medany")
+set(CFLAGS "${ARCH_FLAGS}")
+set(ASFLAGS "${ARCH_FLAGS}")
+set(LDFLAGS "${ARCH_FLAGS}")
+
+include(${CMAKE_CURRENT_LIST_DIR}/../../../../../cmake/riscv64-unknown-elf.cmake)