forked from lttng/lttng-modules
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile.ABI.workarounds
56 lines (45 loc) · 1.96 KB
/
Makefile.ABI.workarounds
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# Work-around for distro-specific public modules ABI breakages.
# Some distributions break the public module instrumentation ABI
# compared to upstream stable kernels without providing other mean than
# the kernel EXTRAVERSION to figure it out. Translate this information
# into a define visible from the C preprocessor.
DEB_API_VERSION:=$(shell $(TOP_LTTNG_MODULES_DIR)/abi-debian-version.sh $(CURDIR))
ifneq ($(DEB_API_VERSION), 0)
ccflags-y += -DDEBIAN_API_VERSION=$(DEB_API_VERSION)
endif
RHEL_API_VERSION:=$(shell $(TOP_LTTNG_MODULES_DIR)/abi-rhel-version.sh $(CURDIR))
ifneq ($(RHEL_API_VERSION), 0)
ccflags-y += -DRHEL_API_VERSION=$(RHEL_API_VERSION)
endif
SLE_API_VERSION:=$(shell $(TOP_LTTNG_MODULES_DIR)/abi-sle-version.sh $(CURDIR))
ifneq ($(SLE_API_VERSION), 0)
ccflags-y += -DSLE_API_VERSION=$(SLE_API_VERSION)
endif
FEDORA_REVISION_VERSION:=$(shell $(TOP_LTTNG_MODULES_DIR)/abi-fedora-version.sh $(CURDIR))
ifneq ($(FEDORA_REVISION_VERSION), 0)
ccflags-y += -DFEDORA_REVISION_VERSION=$(FEDORA_REVISION_VERSION)
endif
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