From 133f3cfe2f79bc84a38ac6d041298d19a407b352 Mon Sep 17 00:00:00 2001 From: Francesco Conti Date: Fri, 31 Jan 2025 11:21:39 +0100 Subject: [PATCH] Remove absurd -U__riscv__ flag in compilation with CV32 The targets using CV32 were compiled using a completely absurd -U__riscv__ flag. The result is that several regression tests were using code targeting the OpenRISC ISA (!!!) and OR10N (!!!), roughly with 10 years of delay. Clearly, that did not end well, resulting in errors like the following ``` testAddSubNorm.c: Assembler messages: testAddSubNorm.c:116: Error: unrecognized opcode `l.addnru a2,a2,a5,5' testAddSubNorm.c:122: Error: unrecognized opcode `l.addnrru a2,a2,a5,5' ``` Frankly speaking, I do not have the faintest idea how such regressions could pass using the same source, compiler, and compiler flags in the past. But they did!!! Bonkers.. --- rules/pulpos/targets/pulpissimo.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rules/pulpos/targets/pulpissimo.mk b/rules/pulpos/targets/pulpissimo.mk index 710d8b4..510b6fb 100644 --- a/rules/pulpos/targets/pulpissimo.mk +++ b/rules/pulpos/targets/pulpissimo.mk @@ -1,12 +1,12 @@ ifdef USE_IBEX PULP_LDFLAGS += -nostartfiles -nostdlib -Wl,--gc-sections -L$(PULPRT_HOME)/kernel -Tchips/pulpissimo/link.ld -lgcc -PULP_CFLAGS += -D__ibex__ -U__riscv__ -UARCHI_CORE_HAS_PULPV2 -DRV_ISA_RV32 +PULP_CFLAGS += -D__ibex__ -D__riscv__ -UARCHI_CORE_HAS_PULPV2 -DRV_ISA_RV32 PULP_ARCH_CFLAGS ?= -march=rv32imc PULP_ARCH_LDFLAGS ?= -march=rv32imc PULP_ARCH_OBJDFLAGS ?= -Mmarch=rv32imc else ifdef USE_CV32E40P PULP_LDFLAGS += -nostartfiles -nostdlib -Wl,--gc-sections -L$(PULPRT_HOME)/kernel -Tchips/pulpissimo/link.ld -lgcc -PULP_CFLAGS += -D__cv32e40p__ -U__riscv__ -UARCHI_CORE_HAS_PULPV2 +PULP_CFLAGS += -D__cv32e40p__ -D__riscv__ -UARCHI_CORE_HAS_PULPV2 ifdef CONFIG_USE_ZFINX PULP_ARCH_CFLAGS ?= -march=rv32imc_zfinx_xcorev -mno-pulp-hwloop PULP_ARCH_LDFLAGS ?= -march=rv32imc_zfinx_xcorev -mno-pulp-hwloop