Skip to content

Commit dfa34fd

Browse files
authored
Merge pull request #501 from ratmice/dont_run_riscv_when_not_target
If not targeting an architecture family don't run it's compiler
2 parents 427dd5a + ab7925a commit dfa34fd

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

Configuration.mk

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -249,8 +249,10 @@ CC_rv32imac := $(CC_rv32)
249249

250250
# Determine the version of the RISC-V compiler. This is used to select the
251251
# version of the libgcc library that is compatible.
252-
CC_rv32_version := $(shell $(TOOLCHAIN_rv32)$(CC_rv32) -dumpfullversion)
253-
CC_rv32_version_major := $(shell echo $(CC_rv32_version) | cut -f1 -d.)
252+
ifneq ($(findstring rv32i,$(TOCK_ARCH_FAMILIES)),)
253+
CC_rv32_version := $(shell $(TOOLCHAIN_rv32)$(CC_rv32) -dumpfullversion)
254+
CC_rv32_version_major := $(shell echo $(CC_rv32_version) | cut -f1 -d.)
255+
endif
254256

255257
# Match compiler version to support libtock-newlib versions.
256258
ifeq ($(CC_rv32_version_major),10)
@@ -393,8 +395,10 @@ CC_cortex-m7 := $(CC_cortex-m)
393395

394396
# Determine the version of the ARM compiler. This is used to select the version
395397
# of the libgcc library that is compatible.
396-
CC_cortex-m_version := $(shell $(TOOLCHAIN_cortex-m)$(CC_cortex-m) -dumpfullversion)
397-
CC_cortex-m_version_major := $(shell echo $(CC_cortex-m_version) | cut -f1 -d.)
398+
ifneq ($(findstring cortex-m,$(TOCK_ARCH_FAMILIES)),)
399+
CC_cortex-m_version := $(shell $(TOOLCHAIN_cortex-m)$(CC_cortex-m) -dumpfullversion)
400+
CC_cortex-m_version_major := $(shell echo $(CC_cortex-m_version) | cut -f1 -d.)
401+
endif
398402

399403
# Match compiler version to support libtock-newlib versions.
400404
ifeq ($(CC_cortex-m_version_major),10)
@@ -680,12 +684,17 @@ ifneq ($(V),)
680684
$(info **************************************************)
681685
$(info Config:)
682686
$(info GIT: $(shell git describe --always 2>&1))
687+
ifneq ($(findstring cortex-m,$(TOCK_ARCH_FAMILIES)),)
683688
$(info $(TOOLCHAIN_cortex-m4)$(CC_cortex-m4) --version: $(shell $(TOOLCHAIN_cortex-m4)$(CC_cortex-m4) --version))
689+
endif
690+
ifneq ($(findstring rv32i,$(TOCK_ARCH_FAMILIES)),)
684691
$(info $(TOOLCHAIN_rv32i)$(CC_rv32i) --version: $(shell $(TOOLCHAIN_rv32i)$(CC_rv32i) --version))
692+
endif
685693
$(info LAYOUT=$(LAYOUT))
686694
$(info MAKEFLAGS=$(MAKEFLAGS))
687695
$(info PACKAGE_NAME=$(PACKAGE_NAME))
688696
$(info TOCK_ARCHS=$(TOCK_ARCHS))
697+
$(info TOCK_ARCH_FAMILIES=$(TOCK_ARCH_FAMILIES))
689698
$(info TOCK_TARGETS=$(TOCK_TARGETS))
690699
$(info TOCK_USERLAND_BASE_DIR=$(TOCK_USERLAND_BASE_DIR))
691700
$(info TOOLCHAIN=$(TOOLCHAIN))

0 commit comments

Comments
 (0)