Skip to content

Commit 49491ee

Browse files
committed
feat: add minimum clang version of ebpf
1 parent 400c21d commit 49491ee

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

ffmuc-ebpf-clat/src/Makefile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ CLAT_CFLAGS ?= $(CFLAGS) -Wall
77
CLAT_LDFLAGS ?= $(LDFLAGS)
88
CLAT_INCLUDES ?=
99
CLANG_INCLUDES ?= $(CLAT_INCLUDES) -Ivmlinux.h
10+
MIN_CLANG_VERSION ?= 20
1011
APPS ?= clat
1112

1213
# libbpf archs (except mips and arc, due to mixed endianness)
@@ -53,6 +54,13 @@ else
5354
BPF_TARGET_ARCH = $(error Unsupported ARCH "$(ARCH)". Please implement it in Makefile.)
5455
endif
5556

57+
CLANG_VERSION := $(shell $(CLANG) -dumpversion)
58+
IS_CLANG_NEW_ENOUGH := $(shell expr $(CLANG_VERSION) ">=" $(MIN_CLANG_VERSION))
59+
60+
ifeq ($(IS_CLANG_NEW_ENOUGH),0) # 0 equals "false"
61+
$(error Found clang $(CLANG_VERSION). Version $(MIN_CLANG_VERSION) or later is required. See https://gist.github.com/DasSkelett/f373dac5692b95b0daae7ebb58fad8d1.)
62+
endif
63+
5664
.PHONY: all
5765
all: $(APPS)
5866

0 commit comments

Comments
 (0)