@@ -66,6 +66,10 @@ OPENTITAN_TOCK_TARGETS := rv32imc|rv32imc.0x20030080.0x10005000|0x20030080|0x100
66
66
ARTY_E21_TOCK_TARGETS := rv32imac|rv32imac.0x40430080.0x80004000|0x40430080|0x80004000\
67
67
rv32imac|rv32imac.0x40440080.0x80007000|0x40440080|0x80007000
68
68
69
+ # Specific addresses useful for the QEMU rv32i "virt" machine memory map.
70
+ QEMU_RV32_VIRT_TOCK_TARGETS := rv32imac|rv32imac.0x80100080.0x80210000|0x80100080|0x80210000\
71
+ rv32imac|rv32imac.0x80104080.0x80214000|0x80104080|0x80214000
72
+
69
73
VEER_EL2_TOCK_TARGETS := rv32imc|rv32imc.0x20300080.0x20602000|0x20300080|0x20602000
70
74
71
75
# Include the RISC-V targets.
@@ -83,7 +87,8 @@ TOCK_TARGETS ?= cortex-m0\
83
87
rv32imc|rv32imc.0x00080080.0x40008000|0x00080080|0x40008000\
84
88
$(OPENTITAN_TOCK_TARGETS ) \
85
89
$(ARTY_E21_TOCK_TARGETS ) \
86
- $(VEER_EL2_TOCK_TARGETS )
90
+ $(VEER_EL2_TOCK_TARGETS ) \
91
+ $(QEMU_RV32_VIRT_TOCK_TARGETS )
87
92
88
93
# Generate `TOCK_ARCH_FAMILIES`, the set of architecture families which will be
89
94
# used to determine toolchains to use in the build process.
@@ -102,7 +107,7 @@ TOCK_ARCHS := $(sort $(foreach target, $(TOCK_TARGETS), $(firstword $(subst |, ,
102
107
103
108
# Check if elf2tab exists, if not, install it using cargo.
104
109
ELF2TAB ?= elf2tab
105
- ELF2TAB_REQUIRED_VERSION := 0.12 .0
110
+ ELF2TAB_REQUIRED_VERSION := 0.13 .0
106
111
ELF2TAB_EXISTS := $(shell $(SHELL ) -c "command -v $(ELF2TAB ) ")
107
112
ELF2TAB_VERSION := $(shell $(SHELL ) -c "$(ELF2TAB ) --version | cut -d ' ' -f 2")
108
113
@@ -158,7 +163,13 @@ endif
158
163
# the dos/microsoft lineage chose `.cpp` to address this same issue, leading to
159
164
# confusion nowadays about the meaning of 'cpp'.]
160
165
override ASFLAGS += -mthumb
161
- override CFLAGS += -std=gnu11
166
+ # '-gnu2x' is a deprecated alias for '-gnu23'. We're close enough in time still
167
+ # (spring 2025) to the formal ratification of C23 (October 2024) that some
168
+ # folks likely still have toolchains which only support the 2x _name_ for the
169
+ # now-official C23 standard (even if the toolchain supports all the features
170
+ # we care about under the 2x name). Eventually we should replace this with
171
+ # explicit C23 selection.
172
+ override CFLAGS += -std=gnu2x
162
173
override CPPFLAGS += \
163
174
-frecord-gcc-switches\
164
175
-gdwarf-2\
@@ -244,8 +255,10 @@ CC_rv32imac := $(CC_rv32)
244
255
245
256
# Determine the version of the RISC-V compiler. This is used to select the
246
257
# version of the libgcc library that is compatible.
247
- CC_rv32_version := $(shell $(TOOLCHAIN_rv32 )$(CC_rv32 ) -dumpfullversion)
248
- CC_rv32_version_major := $(shell echo $(CC_rv32_version ) | cut -f1 -d.)
258
+ ifneq ($(findstring rv32i,$(TOCK_ARCH_FAMILIES ) ) ,)
259
+ CC_rv32_version := $(shell $(TOOLCHAIN_rv32 )$(CC_rv32 ) -dumpfullversion)
260
+ CC_rv32_version_major := $(shell echo $(CC_rv32_version ) | cut -f1 -d.)
261
+ endif
249
262
250
263
# Match compiler version to support libtock-newlib versions.
251
264
ifeq ($(CC_rv32_version_major ) ,10)
@@ -388,8 +401,10 @@ CC_cortex-m7 := $(CC_cortex-m)
388
401
389
402
# Determine the version of the ARM compiler. This is used to select the version
390
403
# of the libgcc library that is compatible.
391
- CC_cortex-m_version := $(shell $(TOOLCHAIN_cortex-m )$(CC_cortex-m ) -dumpfullversion)
392
- CC_cortex-m_version_major := $(shell echo $(CC_cortex-m_version ) | cut -f1 -d.)
404
+ ifneq ($(findstring cortex-m,$(TOCK_ARCH_FAMILIES ) ) ,)
405
+ CC_cortex-m_version := $(shell $(TOOLCHAIN_cortex-m )$(CC_cortex-m ) -dumpfullversion)
406
+ CC_cortex-m_version_major := $(shell echo $(CC_cortex-m_version ) | cut -f1 -d.)
407
+ endif
393
408
394
409
# Match compiler version to support libtock-newlib versions.
395
410
ifeq ($(CC_cortex-m_version_major ) ,10)
@@ -675,12 +690,17 @@ ifneq ($(V),)
675
690
$(info **************************************************)
676
691
$(info Config :)
677
692
$(info GIT : $(shell git describe --always 2>&1) )
693
+ ifneq ($(findstring cortex-m,$(TOCK_ARCH_FAMILIES ) ) ,)
678
694
$(info $(TOOLCHAIN_cortex-m4 )$(CC_cortex-m4 ) --version : $(shell $(TOOLCHAIN_cortex-m4 )$(CC_cortex-m4 ) --version) )
695
+ endif
696
+ ifneq ($(findstring rv32i,$(TOCK_ARCH_FAMILIES ) ) ,)
679
697
$(info $(TOOLCHAIN_rv32i )$(CC_rv32i ) --version : $(shell $(TOOLCHAIN_rv32i )$(CC_rv32i ) --version) )
698
+ endif
680
699
$(info LAYOUT=$(LAYOUT))
681
700
$(info MAKEFLAGS=$(MAKEFLAGS))
682
701
$(info PACKAGE_NAME=$(PACKAGE_NAME))
683
702
$(info TOCK_ARCHS=$(TOCK_ARCHS))
703
+ $(info TOCK_ARCH_FAMILIES=$(TOCK_ARCH_FAMILIES))
684
704
$(info TOCK_TARGETS=$(TOCK_TARGETS))
685
705
$(info TOCK_USERLAND_BASE_DIR=$(TOCK_USERLAND_BASE_DIR))
686
706
$(info TOOLCHAIN=$(TOOLCHAIN))
0 commit comments