X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=Makefile.ABI.workarounds;fp=Makefile.ABI.workarounds;h=2e6c4aa231577057a7c6476977095b29261a677d;hb=c70d91c39ac2138a152ece22e2562044a1c4a275;hp=c3717f814d8c544ef5be9eb444e024196ba89ef4;hpb=7338df14b11ecfa7c7aa31aa7b7c07a36cdc3e26;p=lttng-modules.git diff --git a/Makefile.ABI.workarounds b/Makefile.ABI.workarounds index c3717f81..2e6c4aa2 100644 --- a/Makefile.ABI.workarounds +++ b/Makefile.ABI.workarounds @@ -27,3 +27,24 @@ RT_PATCH_VERSION:=$(shell $(TOP_LTTNG_MODULES_DIR)/rt-patch-version.sh $(CURDIR) ifneq ($(RT_PATCH_VERSION), 0) ccflags-y += -DRT_PATCH_VERSION=$(RT_PATCH_VERSION) endif + +# Starting with kernel 4.12, the ftrace header was moved to private headers +# and as such is not available when building against distro headers instead +# of the full kernel sources. In the situation, define LTTNG_FTRACE_MISSING_HEADER +# so we can enable the compat code even if CONFIG_DYNAMIC_FTRACE is enabled. +ifneq ($(CONFIG_DYNAMIC_FTRACE),) + ftrace_dep = $(srctree)/kernel/trace/trace.h + ftrace_dep_check = $(wildcard $(ftrace_dep)) + have_ftrace_header = $(shell \ + if [ $(VERSION) -ge 5 -o \( $(VERSION) -eq 4 -a $(PATCHLEVEL) -ge 12 \) ] ; then \ + if [ -z "$(ftrace_dep_check)" ] ; then \ + echo "no" ; \ + exit ; \ + fi; \ + fi; \ + echo "yes" ; \ + ) + ifeq ($(have_ftrace_header), no) + ccflags-y += -DLTTNG_FTRACE_MISSING_HEADER + endif +endif