File tree Expand file tree Collapse file tree 2 files changed +23
-4
lines changed
Expand file tree Collapse file tree 2 files changed +23
-4
lines changed Original file line number Diff line number Diff line change @@ -11,15 +11,16 @@ jobs:
1111 - uses : actions/checkout@v4
1212 with :
1313 submodules : recursive
14- - name : Install llvm 18
14+ - name : Install llvm 21
1515 run : |
16- sudo apt-get purge --auto-remove llvm python3-lldb-14 llvm-14
1716 wget https://apt.llvm.org/llvm.sh
1817 chmod +x llvm.sh
19- sudo ./llvm.sh 18
18+ sudo ./llvm.sh 21
2019 rm llvm.sh
2120 - name : Fix llvm-ar path
2221 run : |
23- sudo ln -s $(which llvm-ar-18 ) /usr/bin/llvm-ar || true
22+ sudo ln -s $(which llvm-ar-21 ) /usr/bin/llvm-ar || true
2423 - name : Build
2524 run : make
25+ - name : Build with CFI enabled
26+ run : make clean && make CFI=unlabeled
Original file line number Diff line number Diff line change 11CC := clang
22AR := llvm-ar
33
4+ 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
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
20+ else
421CFLAGS := --target=riscv64 -march=rv64imc_zba_zbb_zbc_zbs -mabi=lp64
22+ endif
523CFLAGS += -Os
624CFLAGS += -fdata-sections -ffunction-sections -fno-builtin -fvisibility=hidden -fomit-frame-pointer
725CFLAGS += -I compiler-rt/lib/builtins
You can’t perform that action at this time.
0 commit comments