diff --git a/Makefile b/Makefile index 2880d3fd4..616c861ee 100644 --- a/Makefile +++ b/Makefile @@ -92,8 +92,8 @@ CLANG_VERSION = $(shell $(CMD_CLANG) --version 2>/dev/null | \ | .check_$(CMD_CLANG) # @echo $(shell date) - @if [ ${CLANG_VERSION} -lt 12 ]; then - echo -n "you MUST use clang 12 or newer, " + @if [ ${CLANG_VERSION} -lt 9 ]; then + echo -n "you MUST use clang 9 or newer, " echo "your current clang version is ${CLANG_VERSION}" exit 1 fi diff --git a/README.md b/README.md index b2d2472a3..1e4e32a16 100644 --- a/README.md +++ b/README.md @@ -166,9 +166,9 @@ Linux Kernel: >= 4.15. ## Tools * golang 1.17 -* clang 12.0.0 +* clang 9.0 * cmake 3.18.4 -* clang backend: llvm 12.0.0 +* clang backend: llvm 9.0 * kernel config:CONFIG_DEBUG_INFO_BTF=y (Optional, 2022-04-17) ## command diff --git a/README_CN.md b/README_CN.md index 6c5f26bab..9474624e6 100644 --- a/README_CN.md +++ b/README_CN.md @@ -181,9 +181,9 @@ hook了`/bin/bash`的`readline`函数。 ## 工具链版本 * golang 1.17 -* clang 12.0.0 +* clang 9.0 * cmake 3.18.4 -* clang backend: llvm 12.0.0 +* clang backend: llvm 9.0 * kernel config:CONFIG_DEBUG_INFO_BTF=y (可选,2022-04-17增加) diff --git a/kern/ecapture.h b/kern/ecapture.h index 6cd2f0fcb..16eb06920 100644 --- a/kern/ecapture.h +++ b/kern/ecapture.h @@ -12,6 +12,24 @@ #else //CO:RE is disabled #include + +// see https://github.com/ehids/ecapture/issues/256 for more detail. +/* +* This will bring in asm_volatile_goto and asm_inline macro definitions +* if enabled by compiler and config options. +*/ +#include + +/* +* asm_inline is defined as asm __inline in "include/linux/compiler_types.h" +* if supported by the kernel's CC (i.e CONFIG_CC_HAS_ASM_INLINE) which is not +* supported by CLANG. +*/ +#ifdef asm_inline +#undef asm_inline +#define asm_inline asm +#endif + #include #include #include