From 533d1589249de24c308f624726113a4fbecc4238 Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Sat, 4 Mar 2017 01:44:15 +0000 Subject: [PATCH] Kbuild.include: addtree: Remove quotes before matching path systemtap currently fails to build modules when the kernel source and object trees are separate. systemtap adds something like -I"/usr/share/systemtap/runtime" to EXTRA_CFLAGS, and addtree should not adjust this as it's specifying an absolute directory. But since make has no understanding of shell quoting, it does anyway. For a long time this didn't matter, because addtree would still emit the original -I option after the adjusted one. However, commit db547ef19064 ("Kbuild: don't add obj tree in additional includes") changed it to remove the original -I option. Remove quotes (both double and single) before matching against the excluded patterns. References: https://bugs.debian.org/856474 Reported-by: Jack Henschel Reported-by: Ritesh Raj Sarraf Fixes: db547ef19064 ("Kbuild: don't add obj tree in additional includes") Cc: stable@vger.kernel.org # 4.8+ Signed-off-by: Ben Hutchings Gbp-Pq: Topic bugfix/all Gbp-Pq: Name kbuild-include-addtree-remove-quotes-before-matching-path.patch --- scripts/Kbuild.include | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include index ec6cf17ca63..f8fd7249d58 100644 --- a/scripts/Kbuild.include +++ b/scripts/Kbuild.include @@ -290,7 +290,7 @@ hdr-inst := -f $(srctree)/scripts/Makefile.headersinst obj # Prefix -I with $(srctree) if it is not an absolute path. # skip if -I has no parameter addtree = $(if $(patsubst -I%,%,$(1)), \ -$(if $(filter-out -I/% -I./% -I../%,$(1)),$(patsubst -I%,-I$(srctree)/%,$(1)),$(1))) +$(if $(filter-out -I/% -I./% -I../%,$(subst $(quote),,$(subst $(squote),,$(1)))),$(patsubst -I%,-I$(srctree)/%,$(1)),$(1))) # Find all -I options and call addtree flags = $(foreach o,$($(1)),$(if $(filter -I%,$(o)),$(call addtree,$(o)),$(o))) -- 2.30.2