[lttng-dev] [PATCH lttng-modules 2/2] Rename Makefile.ABI.workarounds to Kbuild.common

Mathieu Desnoyers mathieu.desnoyers at efficios.com
Fri Jun 23 19:11:58 UTC 2017


Merged into master, thanks!

Mathieu

----- On Jun 23, 2017, at 2:29 PM, Michael Jeanson mjeanson at efficios.com wrote:

> This file is now used for code which is common to all Kbuild files.
> 
> Signed-off-by: Michael Jeanson <mjeanson at efficios.com>
> ---
> Kbuild.common            | 50 ++++++++++++++++++++++++++++++++++++++++++++++++
> Makefile                 |  2 +-
> Makefile.ABI.workarounds | 50 ------------------------------------------------
> lib/Kbuild               |  2 +-
> probes/Kbuild            |  2 +-
> tests/Kbuild             |  2 +-
> 6 files changed, 54 insertions(+), 54 deletions(-)
> create mode 100644 Kbuild.common
> delete mode 100644 Makefile.ABI.workarounds
> 
> diff --git a/Kbuild.common b/Kbuild.common
> new file mode 100644
> index 0000000..2e6c4aa
> --- /dev/null
> +++ b/Kbuild.common
> @@ -0,0 +1,50 @@
> +# 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
> +
> +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
> diff --git a/Makefile b/Makefile
> index f65e463..2cd2df0 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -29,7 +29,7 @@ ifneq ($(KERNELRELEASE),)
>     endif
>   endif
> 
> -  include $(TOP_LTTNG_MODULES_DIR)/Makefile.ABI.workarounds
> +  include $(TOP_LTTNG_MODULES_DIR)/Kbuild.common
> 
>   ccflags-y += -I$(TOP_LTTNG_MODULES_DIR)
> 
> diff --git a/Makefile.ABI.workarounds b/Makefile.ABI.workarounds
> deleted file mode 100644
> index 2e6c4aa..0000000
> --- a/Makefile.ABI.workarounds
> +++ /dev/null
> @@ -1,50 +0,0 @@
> -# 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
> -
> -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
> diff --git a/lib/Kbuild b/lib/Kbuild
> index 9680720..5248d37 100644
> --- a/lib/Kbuild
> +++ b/lib/Kbuild
> @@ -1,6 +1,6 @@
> TOP_LTTNG_MODULES_DIR := $(shell dirname $(lastword $(MAKEFILE_LIST)))/..
> 
> -include $(TOP_LTTNG_MODULES_DIR)/Makefile.ABI.workarounds
> +include $(TOP_LTTNG_MODULES_DIR)/Kbuild.common
> 
> ccflags-y += -I$(TOP_LTTNG_MODULES_DIR)
> 
> diff --git a/probes/Kbuild b/probes/Kbuild
> index cc1c065..70a3d86 100644
> --- a/probes/Kbuild
> +++ b/probes/Kbuild
> @@ -1,6 +1,6 @@
> TOP_LTTNG_MODULES_DIR := $(shell dirname $(lastword $(MAKEFILE_LIST)))/..
> 
> -include $(TOP_LTTNG_MODULES_DIR)/Makefile.ABI.workarounds
> +include $(TOP_LTTNG_MODULES_DIR)/Kbuild.common
> 
> ccflags-y += -I$(TOP_LTTNG_MODULES_DIR)
> 
> diff --git a/tests/Kbuild b/tests/Kbuild
> index aabb8e2..0696c0a 100644
> --- a/tests/Kbuild
> +++ b/tests/Kbuild
> @@ -1,6 +1,6 @@
> TOP_LTTNG_MODULES_DIR := $(shell dirname $(lastword $(MAKEFILE_LIST)))/..
> 
> -include $(TOP_LTTNG_MODULES_DIR)/Makefile.ABI.workarounds
> +include $(TOP_LTTNG_MODULES_DIR)/Kbuild.common
> 
> ccflags-y += -I$(TOP_LTTNG_MODULES_DIR)
> 
> --
> 2.7.4

-- 
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com


More information about the lttng-dev mailing list