mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-12-23 11:09:28 -05:00
Update RISC-V QEMU project for GCC (#1142)
* Update RISC-V QEMU project for GCC
This commit is contained in:
parent
6b513cb1a2
commit
dc4bdf5f30
2 changed files with 23 additions and 2 deletions
|
|
@ -3,6 +3,10 @@ CC = $(CROSS)gcc
|
|||
OBJCOPY = $(CROSS)objcopy
|
||||
ARCH = $(CROSS)ar
|
||||
|
||||
# Generate GCC_VERSION in number format
|
||||
GCC_VERSION = $(shell $(CC) --version | grep ^$(CC) | sed 's/^.* //g' | awk -F. '{ printf("%d%02d%02d"), $$1, $$2, $$3 }')
|
||||
GCC_VERSION_NEED_ZICSR = "110100"
|
||||
|
||||
BUILD_DIR = build
|
||||
RTOS_SOURCE_DIR = $(abspath ../../Source)
|
||||
DEMO_SOURCE_DIR = $(abspath ../Common/Minimal)
|
||||
|
|
@ -14,12 +18,19 @@ CPPFLAGS = \
|
|||
-I $(RTOS_SOURCE_DIR)/include \
|
||||
-I $(RTOS_SOURCE_DIR)/portable/GCC/RISC-V \
|
||||
-I $(RTOS_SOURCE_DIR)/portable/GCC/RISC-V/chip_specific_extensions/RV32I_CLINT_no_extensions
|
||||
CFLAGS = -march=rv32imac -mabi=ilp32 -mcmodel=medany \
|
||||
CFLAGS = -mabi=ilp32 -mcmodel=medany \
|
||||
-Wall \
|
||||
-fmessage-length=0 \
|
||||
-ffunction-sections \
|
||||
-fdata-sections \
|
||||
-fno-builtin-printf
|
||||
|
||||
ifeq ($(shell test $(GCC_VERSION) -ge $(GCC_VERSION_NEED_ZICSR) && echo true),true)
|
||||
CFLAGS += -march=rv32imac_zicsr
|
||||
else
|
||||
CFLAGS += -march=rv32imac
|
||||
endif
|
||||
|
||||
LDFLAGS = -nostartfiles -Tfake_rom.lds \
|
||||
-march=rv32imac -mabi=ilp32 -mcmodel=medany \
|
||||
-Xlinker --gc-sections \
|
||||
|
|
|
|||
|
|
@ -9,10 +9,20 @@ LD = riscv64-unknown-elf-gcc
|
|||
SIZE = riscv64-unknown-elf-size
|
||||
MAKE = make
|
||||
|
||||
# Generate GCC_VERSION in number format
|
||||
GCC_VERSION = $(shell $(CC) --version | grep ^$(CC) | sed 's/^.* //g' | awk -F. '{ printf("%d%02d%02d"), $$1, $$2, $$3 }')
|
||||
GCC_VERSION_NEED_ZICSR = "110100"
|
||||
|
||||
CFLAGS += $(INCLUDE_DIRS) -DportasmHANDLE_INTERRUPT=handle_trap -fmessage-length=0 \
|
||||
-march=rv32imac_zicsr -mabi=ilp32 -mcmodel=medlow -ffunction-sections -fdata-sections \
|
||||
-mabi=ilp32 -mcmodel=medlow -ffunction-sections -fdata-sections \
|
||||
-Wno-unused-parameter -nostartfiles -g3 -Os
|
||||
|
||||
ifeq ($(shell test $(GCC_VERSION) -ge $(GCC_VERSION_NEED_ZICSR) && echo true),true)
|
||||
CFLAGS += -march=rv32imac_zicsr
|
||||
else
|
||||
CFLAGS += -march=rv32imac
|
||||
endif
|
||||
|
||||
ifeq ($(PICOLIBC),1)
|
||||
CFLAGS += --specs=picolibc.specs -DPICOLIBC_INTEGER_PRINTF_SCANF
|
||||
else
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue