mirror of
https://github.com/micropython/micropython.git
synced 2025-08-23 11:00:32 +02:00
tools/mpy_ld.py: Add native modules support for RV32 code.
This commit adds support for RV32IMC native modules, as in embedding native code into a self-contained MPY module and and make its exported functions available to the MicroPython environment. Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
This commit is contained in:
committed by
Damien George
parent
136058496f
commit
6760e00817
@@ -99,6 +99,22 @@ CROSS = xtensa-esp32-elf-
|
||||
CFLAGS +=
|
||||
MICROPY_FLOAT_IMPL ?= float
|
||||
|
||||
else ifeq ($(ARCH),rv32imc)
|
||||
|
||||
# rv32imc
|
||||
CROSS = riscv64-unknown-elf-
|
||||
CFLAGS += -march=rv32imac -mabi=ilp32 -mno-relax
|
||||
# If Picolibc is available then select it explicitly. Ubuntu 22.04 ships its
|
||||
# bare metal RISC-V toolchain with Picolibc rather than Newlib, and the default
|
||||
# is "nosys" so a value must be provided. To avoid having per-distro
|
||||
# workarounds, always select Picolibc if available.
|
||||
PICOLIBC_SPECS = $(shell $(CROSS)gcc --print-file-name=picolibc.specs)
|
||||
ifneq ($(PICOLIBC_SPECS),picolibc.specs)
|
||||
CFLAGS += --specs=$(PICOLIBC_SPECS)
|
||||
endif
|
||||
|
||||
MICROPY_FLOAT_IMPL ?= none
|
||||
|
||||
else
|
||||
$(error architecture '$(ARCH)' not supported)
|
||||
endif
|
||||
|
Reference in New Issue
Block a user