From patchwork Thu Jul 5 02:48:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 141102 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp1413406ljj; Wed, 4 Jul 2018 19:48:58 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcWq4yPx6trC/+gum+OySnMmdmbqR1PIe3tVgXLp0cpyu1ySGLBkihwksiQU4ELN6SxqCkv X-Received: by 2002:a17:902:2f43:: with SMTP id s61-v6mr4235979plb.274.1530758938126; Wed, 04 Jul 2018 19:48:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530758938; cv=none; d=google.com; s=arc-20160816; b=JpWVlmIJfXNBeh1tC0GqnQJjbNy0YXq+O/nlu9PK/JFt83tfHa7jKUkchGWyp0si0k EewZU9W5XchBw7xT6BGNIcAf2kcPLiofC+DpMjawCbEvLBflMrFv2zL56Rqtuz5AN9FU xCKRLHlS3P3XceSrAQGBQGDUnDRq4ZU7e8v92Jykcf2whbD1Ozp3bsMeCVYbu5275b0G pmp/KlAvr8T4hOPbmsPf/pZsQfcCCa4fEc1VtcUBJESwOel6cBNd15YciZh+J4W38yYM TdXFz77QFBFx1epFrEOuoNS4fAXACx8NOnbvIK1JpsIA72hBn0awsHGXYQ7QgSSngggL LVpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:dkim-filter:arc-authentication-results; bh=L4dPtSttjxtasaQ4iZCG0mt9I75T77RHuVpk2GSomLI=; b=hu9CjuDZl8/4P1SKk6/3Zu2xwhOltDEzCcX3wBEP1brLC1f24fk0LAX9rTCA7G6rQn 9ZaLDPD2rl+kFWE1EiE8I4rXiYKBSV+cYid4m4j2TCEpgszSJbLa6u6FabzyVl1vtUK7 XCTAIl90p5cq9r66yYAD68EtjVI5uH2XIae2AaB6TwmXfb3pLiD+AdVgOk1d0RCW3G4l 0moX7XrvkvfEWZ0MPNaM6SveczI+taNvlUmeD/T4ocgRm43RcOmtML4cK8UJiMKQiGxV aq4auiU6BtKOl57iQbnuPwTeNQCzYaZRmBM0nLkH24p+/eFiczSzqsJA8cX6TmRn8qir T14w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=D3NedPtz; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h3-v6si5188974plk.47.2018.07.04.19.48.57; Wed, 04 Jul 2018 19:48:58 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=D3NedPtz; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753192AbeGECs4 (ORCPT + 31 others); Wed, 4 Jul 2018 22:48:56 -0400 Received: from conuserg-11.nifty.com ([210.131.2.78]:51109 "EHLO conuserg-11.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752970AbeGECsz (ORCPT ); Wed, 4 Jul 2018 22:48:55 -0400 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-11.nifty.com with ESMTP id w652mOP5008929; Thu, 5 Jul 2018 11:48:25 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-11.nifty.com w652mOP5008929 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1530758905; bh=L4dPtSttjxtasaQ4iZCG0mt9I75T77RHuVpk2GSomLI=; h=From:To:Cc:Subject:Date:From; b=D3NedPtz1Wrr/AiwZqbHBdahcyhx6zEDh2wk83RllcZXUpVEJJnoSTnDFT//PUhiN wLDxIktMzESB2vk7f8pe8s+13ekABEA7S4F2YpcC/L5K3ZVqvv2HFnoPOG3mr7ZxHe 4omUrVm6v6MrbRFtq00OPxR2bP0UaXfSbqIse/aC1qGTmycgkiizQw03sVQa5eaQbA OXNXBRnvGBqVlgFcVGfPMybsLsSwlTSyk2YIVOKkV04ZVETX6f4/fohgdghZmGouYL DolzCL03GWFcgzkTXlDGeGvpuh+Ch6/VEvWW5oNtI1fdUh8QvEtEFuE8E7Fg5/2bxl SG1woAWGRpocQ== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Sam Ravnborg , Masahiro Yamada , Michal Marek , linux-kernel@vger.kernel.org Subject: [PATCH] kbuild: do not drop -I without parameter Date: Thu, 5 Jul 2018 11:48:21 +0900 Message-Id: <1530758901-32014-1-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The comment line for addtree says "skip if -I has no parameter". What it actually does is "drop if -I has no parameter". For example, if you have the compiler flag '-I foo' (a space between), it will be converted to 'foo'. This completely changes the meaning. What we want is, "do nothing" for -I without parameter so that '-I foo' is kept as-is. Signed-off-by: Masahiro Yamada --- scripts/Kbuild.include | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.7.4 diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include index b2d14f1..ed303f5 100644 --- a/scripts/Kbuild.include +++ b/scripts/Kbuild.include @@ -214,7 +214,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../%,$(1)),$(patsubst -I%,-I$(srctree)/%,$(1)),$(1)),$(1)) # Find all -I options and call addtree flags = $(foreach o,$($(1)),$(if $(filter -I%,$(o)),$(call addtree,$(o)),$(o)))