Skip to content

Commit f773f38

Browse files
committed
Fix toolchain selection logic and variable naming in build.mk
1 parent 43a3d35 commit f773f38

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

arch/riscv/build.mk

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ DEFINES := -DF_CPU=$(F_CLK) \
1818
-include config.h
1919

2020
CROSS_COMPILE ?= riscv32-unknown-elf-
21-
CC = $(CROSS_COMPILE)gcc
21+
C = $(CROSS_COMPILE)gcc
2222
CC_IS_CLANG := $(shell $(CC) --version 2>/dev/null | grep -qi clang && echo 1)
2323

2424
# Architecture flags
@@ -31,7 +31,7 @@ CFLAGS += $(ARCH_FLAGS)
3131
CFLAGS += -mstrict-align -ffreestanding -nostdlib -fomit-frame-pointer
3232
CFLAGS += $(INC_DIRS) $(DEFINES) -fdata-sections -ffunction-sections
3333

34-
ifeq ($(TOOLCHAIN_TYPE),llvm)
34+
ifeq ($(CC_IS_CLANG),1)
3535
CC = $(CROSS_COMPILE)clang
3636
AS = $(CROSS_COMPILE)clang
3737
LD = $(CROSS_COMPILE)ld.lld
@@ -46,7 +46,7 @@ ifeq ($(TOOLCHAIN_TYPE),llvm)
4646
ASFLAGS = --target=riscv32-unknown-elf $(ARCH_FLAGS)
4747
LDFLAGS = -m elf32lriscv --gc-sections
4848
else
49-
CC = $(CROSS_COMPILE)gcc
49+
CC = $(CC_DEFAULT)
5050
AS = $(CROSS_COMPILE)as
5151
LD = $(CROSS_COMPILE)ld
5252
DUMP = $(CROSS_COMPILE)objdump -Mno-aliases

0 commit comments

Comments
 (0)