Skip to content

Commit a76186e

Browse files
authored
Merge pull request #21672 from AnnsAnns/riscv_asm
arch/riscv: fix incorrect ASFLAGS
2 parents 0745ea5 + abc02fa commit a76186e

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

makefiles/arch/riscv.inc.mk

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,14 +67,14 @@ endif
6767
# autodetected gcc target triples are incompatible with clang
6868
TARGET_ARCH_LLVM := riscv32-none-elf
6969
ifneq ($(TOOLCHAIN),llvm)
70-
CFLAGS_CPU += -mcmodel=medlow -msmall-data-limit=8
70+
CFLAGS_NO_ASM += -mcmodel=medlow -msmall-data-limit=8
7171
# We cannot invoke the compiler on the host system if build in docker.
7272
# Instead, hard-code the required flags for the docker toolchain here
7373
ifeq (1,$(BUILD_IN_DOCKER))
74-
CFLAGS_CPU += -malign-data=natural
74+
CFLAGS_NO_ASM += -malign-data=natural
7575
else
7676
ifneq (,$(shell $(TARGET_ARCH)-gcc --help=target | grep '\-malign-data='))
77-
CFLAGS_CPU += -malign-data=natural
77+
CFLAGS_NO_ASM += -malign-data=natural
7878
endif
7979
endif
8080
endif
@@ -86,8 +86,8 @@ LINKFLAGS += -L$(RIOTCPU)/$(CPU)/ldscripts -L$(RIOTCPU)/riscv_common/ldscripts
8686
LINKER_SCRIPT ?= $(CPU_MODEL).ld
8787
LINKFLAGS += -T$(LINKER_SCRIPT)
8888

89-
CFLAGS += $(CFLAGS_CPU) $(CFLAGS_DBG) $(CFLAGS_OPT) $(CFLAGS_LINK)
90-
ASFLAGS += $(CFLAGS_CPU) $(CFLAGS_DBG)
89+
CFLAGS += $(CFLAGS_CPU) $(CFLAGS_DBG) $(CFLAGS_OPT) $(CFLAGS_LINK) $(CFLAGS_NO_ASM)
90+
ASFLAGS += $(CFLAGS_CPU)
9191
# export linker flags
9292
LINKFLAGS += $(CFLAGS_CPU) $(CFLAGS_LINK) $(CFLAGS_DBG) $(CFLAGS_OPT) -nostartfiles -Wl,--gc-sections -static -lgcc
9393

0 commit comments

Comments
 (0)