Skip to content

Commit

Permalink
Merge pull request #17520 from chrysn-pull-requests/rust-enable-riscv
Browse files Browse the repository at this point in the history
cpu/riscv_common: Enable Rust applications
  • Loading branch information
chrysn authored Jan 26, 2022
2 parents 07a4756 + 210ad50 commit 99d245f
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cpu/riscv_common/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ config CPU_ARCH_RISCV
select HAS_NEWLIB
select HAS_PERIPH_CORETIMER
select HAS_PICOLIBC if '$(RIOT_CI_BUILD)' != '1'
#select HAS_RUST_TARGET
select HAS_RUST_TARGET
select HAS_SSP

select MODULE_MALLOC_THREAD_SAFE if TEST_KCONFIG
Expand Down
2 changes: 1 addition & 1 deletion cpu/riscv_common/Makefile.features
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ FEATURES_PROVIDED += cpp
FEATURES_PROVIDED += libstdcpp
FEATURES_PROVIDED += newlib
FEATURES_PROVIDED += periph_coretimer
#FEATURES_PROVIDED += rust_target
FEATURES_PROVIDED += rust_target
FEATURES_PROVIDED += ssp

# RISC-V toolchain on CI does not work properly with picolibc yet
Expand Down
2 changes: 2 additions & 0 deletions makefiles/cargo-targets.inc.mk
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ CARGO_COMPILE_COMMANDS_FLAGS = --clang
$(CARGO_COMPILE_COMMANDS): $(BUILDDEPS)
$(Q)DIRS="$(DIRS)" APPLICATION_BLOBS="$(BLOBS)" \
"$(MAKE)" -C $(APPDIR) -f $(RIOTMAKE)/application.inc.mk compile-commands
@# replacement addresses https://github.com/rust-lang/rust-bindgen/issues/1555
$(Q)$(RIOTTOOLS)/compile_commands/compile_commands.py $(CARGO_COMPILE_COMMANDS_FLAGS) $(BINDIR) \
| sed 's/"riscv-none-embed"/"riscv32"/g' \
| $(LAZYSPONGE) $@


Expand Down
5 changes: 5 additions & 0 deletions makefiles/docker.inc.mk
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,11 @@ DOCKER_APPDIR = $(DOCKER_RIOTPROJECT)/$(BUILDRELPATH)
# Directory mapping in docker and directories environment variable configuration
DOCKER_VOLUMES_AND_ENV += $(call docker_volume,$(ETC_LOCALTIME),/etc/localtime,ro)
DOCKER_VOLUMES_AND_ENV += $(call docker_volume,$(RIOTBASE),$(DOCKER_RIOTBASE))
# Selective components of Cargo to ensure crates are not re-downloaded (and
# subsequently rebuilt) on every run. Not using all of ~/.cargo as ~/.cargo/bin
# would be run by Cargo and that'd be very weird.
DOCKER_VOLUMES_AND_ENV += $(call docker_volume,$(HOME)/.cargo/registry,$(DOCKER_BUILD_ROOT)/.cargo/registry)
DOCKER_VOLUMES_AND_ENV += $(call docker_volume,$(HOME)/.cargo/git,$(DOCKER_BUILD_ROOT)/.cargo/git)
DOCKER_VOLUMES_AND_ENV += -e 'RIOTBASE=$(DOCKER_RIOTBASE)'
DOCKER_VOLUMES_AND_ENV += -e 'CCACHE_BASEDIR=$(DOCKER_RIOTBASE)'

Expand Down

0 comments on commit 99d245f

Please sign in to comment.