From patchwork Sat Mar 18 21:58:23 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Hutchings X-Patchwork-Id: 9632347 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 4798460249 for ; Sat, 18 Mar 2017 22:39:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 23B2A282EC for ; Sat, 18 Mar 2017 22:39:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0428228338; Sat, 18 Mar 2017 22:39:36 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_TVD_MIME_EPI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3C7DA282EC for ; Sat, 18 Mar 2017 22:39:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751222AbdCRWjc (ORCPT ); Sat, 18 Mar 2017 18:39:32 -0400 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:51036 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751207AbdCRWjb (ORCPT ); Sat, 18 Mar 2017 18:39:31 -0400 Received: from ben by shadbolt.decadent.org.uk with local (Exim 4.84_2) (envelope-from ) id 1cpMMh-0008FZ-L9; Sat, 18 Mar 2017 21:58:24 +0000 Date: Sat, 18 Mar 2017 21:58:23 +0000 From: Ben Hutchings To: linux-kbuild@vger.kernel.org Cc: stable@vger.kernel.org, 856474@bugs.debian.org Message-ID: <20170318215823.GS4152@decadent.org.uk> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: ben@decadent.org.uk Subject: [PATCH] Kbuild.include: addtree: Remove quotes before matching path X-SA-Exim-Version: 4.2.1 (built Mon, 26 Dec 2011 16:24:06 +0000) X-SA-Exim-Scanned: Yes (on shadbolt.decadent.org.uk) Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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-and-tested-by: Jack Henschel Reported-and-tested-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 --- a/scripts/Kbuild.include +++ b/scripts/Kbuild.include @@ -207,7 +207,7 @@ hdr-inst := -f $(srctree)/scripts/Makefi # 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)))