Skip to content

Commit 25b59b6

Browse files
committed
chore: beautify code
1 parent 45e2fef commit 25b59b6

File tree

1 file changed

+17
-16
lines changed

1 file changed

+17
-16
lines changed

Makefile

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,25 @@ CC := clang
22
AR := llvm-ar
33

44
ifdef CFI
5-
$(info Info: build with CFI enabled)
6-
CLANG_VERSION := $(shell $(CC) --version | head -n1 | sed -n 's/.*version \([0-9]*\)\..*/\1/p')
7-
ifeq ($(shell test $(CLANG_VERSION) -ge 21; echo $$?),0)
8-
CFLAGS := --target=riscv64 -march=rv64imc_zba_zbb_zbc_zbs_zicfiss1p0_zicfilp1p0 -mabi=lp64
9-
CFLAGS += -menable-experimental-extensions -fcf-protection=full
10-
ifeq ($(CFI),unlabeled)
11-
CFLAGS += -mcf-branch-label-scheme=unlabeled
12-
else ifeq ($(CFI),func-sig)
13-
CFLAGS += -mcf-branch-label-scheme=func-sig
5+
$(info Info: build with CFI enabled)
6+
CLANG_VERSION := $(shell $(CC) --version | head -n1 | sed -n 's/.*version \([0-9]*\)\..*/\1/p')
7+
ifeq ($(shell test $(CLANG_VERSION) -ge 21; echo $$?),0)
8+
CFLAGS := --target=riscv64 -march=rv64imc_zba_zbb_zbc_zbs_zicfiss1p0_zicfilp1p0 -mabi=lp64
9+
CFLAGS += -menable-experimental-extensions -fcf-protection=full
10+
ifeq ($(CFI),unlabeled)
11+
CFLAGS += -mcf-branch-label-scheme=unlabeled
12+
else ifeq ($(CFI),func-sig)
13+
CFLAGS += -mcf-branch-label-scheme=func-sig
14+
else
15+
$(error Error: CFI is set to '$(CFI)' but expected 'unlabeled' or 'func-sig')
16+
endif
17+
else
18+
$(error Error: CFI requires clang version 21 or above, but found version $(CLANG_VERSION))
19+
endif
1420
else
15-
$(error Error: CFI is set to '$(CFI)' but expected 'unlabeled' or 'func-sig')
16-
endif
17-
else
18-
$(error Error: CFI requires clang version 21 or above, but found version $(CLANG_VERSION))
19-
endif
20-
else
21-
CFLAGS := --target=riscv64 -march=rv64imc_zba_zbb_zbc_zbs -mabi=lp64
21+
CFLAGS := --target=riscv64 -march=rv64imc_zba_zbb_zbc_zbs -mabi=lp64
2222
endif
23+
2324
CFLAGS += -Os
2425
CFLAGS += -fdata-sections -ffunction-sections -fno-builtin -fvisibility=hidden -fomit-frame-pointer
2526
CFLAGS += -I compiler-rt/lib/builtins

0 commit comments

Comments
 (0)