Skip to content

Commit 287280f

Browse files
committed
makefiles/arch/riscv.inc.mk: Always provide TARGET_ARCH_LLVM
This fixes issues with `make compile-commands`, as this by default generates clangd/LLVM compatible flags. Without `TARGET_ARCH_LLVM` exported, this will fall back to `TARGET_ARCH`, which is different for LLVM and GCC.
1 parent 848f3d1 commit 287280f

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

makefiles/arch/riscv.inc.mk

+4-5
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,10 @@ ifeq (1,$(GCC_DEFAULTS_TO_NEW_RISCV_ISA))
6666
CFLAGS_CPU += -misa-spec=2.2
6767
endif
6868

69-
ifeq ($(TOOLCHAIN),llvm)
70-
# Always use riscv32-none-elf as target triple for clang, as some
71-
# autodetected gcc target triples are incompatible with clang
72-
TARGET_ARCH_LLVM := riscv32-none-elf
73-
else
69+
# Always use riscv32-none-elf as target triple for clang, as some
70+
# autodetected gcc target triples are incompatible with clang
71+
TARGET_ARCH_LLVM := riscv32-none-elf
72+
ifneq ($(TOOLCHAIN),llvm)
7473
CFLAGS_CPU += -mcmodel=medlow -msmall-data-limit=8
7574
# We cannot invoke the compiler on the host system if build in docker.
7675
# Instead, hard-code the required flags for the docker toolchain here

0 commit comments

Comments
 (0)