From patchwork Wed Jan 16 02:56:40 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 155684 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp140461jaa; Tue, 15 Jan 2019 18:57:15 -0800 (PST) X-Google-Smtp-Source: ALg8bN4VFKWghw3BMJyxCHcd6qw0mK1LneICNkb1PiQK8j8p+2D5kr25ARgEfZi44dkQYZRs2yqX X-Received: by 2002:a17:902:468:: with SMTP id 95mr7368883ple.3.1547607435205; Tue, 15 Jan 2019 18:57:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547607435; cv=none; d=google.com; s=arc-20160816; b=UiX1ufwNQ6vP2C8YkTeNdXPrHtqGG6as3jdr2TGkmNrAD4ROF47V7FYljCUdG3/vKC SrkK+lA9jHF/7Zky5yPCVkDFAUamCYD/ATcWvayExSHpOKdj8v7as7otc2K8bHovni9Y fwwC8hNjS50+z8HEK2aN5dtKATA5bGG2+5A9+XpCB8Xgv+3i95i8OJGx8Vyhcp+AVp9O 2uSMmT0+nJNfr+/0y7n38Q0tk91I1mKrmic7nMDU8K0ZRpqjXQDGj803Uzkrhour7UK5 3H1+HoWfNHh1CwWvz1wfCho9MN2MF5Ee4t/QNGP5q5icTMJd7RY+V419m8lgci8pUn8g uX/A== 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; bh=b3st7iXaosPz9TNOoCrIJxfgJyY5GuSh79BYsiKfgy0=; b=XrznYD5IljBKQw28/jXysn5kCs1kl0NqFs+a53fQoXHrC/aZNlwJ3r4usKhNf685Xa FZV/4kiepHrps1tH5JV9nfWAfh0ik3ZeoBywFQ4Mw2U5KQ+oOBErtAIwa2fc2TPE5eYy 1fQl9q0WdktiKg1r2NvgU6CTWI5P/AL66E2sXkcFMT+5IJa9e2VneZ6b9xkDAqvwca1f sCNbegmSZ4ZT/uP4GVVUbYLigrktt9n46c+vdr4BfWBo9F2l7jQ4bnndCjLteSY9loA0 /lMoYOCL3TP3a7B37ltZhzK6/wYilYeZFng7/PIx4fNYnOswMCyw6BNKSy0a5mlwSBZy fT2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=1blJ79iW; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-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 y29si4690175pgk.376.2019.01.15.18.57.14; Tue, 15 Jan 2019 18:57:15 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of devicetree-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=1blJ79iW; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729746AbfAPC5O (ORCPT + 7 others); Tue, 15 Jan 2019 21:57:14 -0500 Received: from conuserg-10.nifty.com ([210.131.2.77]:48887 "EHLO conuserg-10.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727883AbfAPC5O (ORCPT ); Tue, 15 Jan 2019 21:57:14 -0500 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-10.nifty.com with ESMTP id x0G2uksR010468; Wed, 16 Jan 2019 11:56:46 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-10.nifty.com x0G2uksR010468 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1547607407; bh=b3st7iXaosPz9TNOoCrIJxfgJyY5GuSh79BYsiKfgy0=; h=From:To:Cc:Subject:Date:From; b=1blJ79iW00qDBdbScxwA9YuKYI0cp1PNQVf/if0DjJlkMy5s2bQu6VXoBSU3S9vdy OLHPA5bMO1pePez6H1bE8V3eHzXI4ntBIkHa9SYE5qoXI0v4U0yB8n8hrkeTBENZfh HD95nQdjvJXYg+OzjgxjRFVCVEkd7HIYWvvUHOBcApmFqMaEIXSF/NHsHiOTIhBEJp jln1I5x5/iInK2rxZ2RqCO8XnzfqoLTtbw+6aE2uJ/pUL1cnrlR9Bk3Wbzaz3nvJF0 grcW+0H1U9uBGSNcfW0KcxnNgWFQ2okIYOQa61+Pt1q8sGvG7hN2C+eBqFrgfuBPVh WXbgJllgX01WQ== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: devicetree@vger.kernel.org, Masahiro Yamada , Michal Marek , linux-kernel@vger.kernel.org Subject: [PATCH 1/2] kbuild: skip 'addtree' and 'flags' magic for external module build Date: Wed, 16 Jan 2019 11:56:40 +0900 Message-Id: <1547607401-20118-1-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org When building an external module, $(obj) is the absolute path to it. The header search paths from ccflags-y etc. should not be tweaked. Signed-off-by: Masahiro Yamada --- scripts/Makefile.host | 6 ++++-- scripts/Makefile.lib | 11 ++++++----- 2 files changed, 10 insertions(+), 7 deletions(-) -- 2.7.4 diff --git a/scripts/Makefile.host b/scripts/Makefile.host index 0393f75..a115259 100644 --- a/scripts/Makefile.host +++ b/scripts/Makefile.host @@ -67,13 +67,15 @@ _hostc_flags = $(KBUILD_HOSTCFLAGS) $(HOST_EXTRACFLAGS) \ _hostcxx_flags = $(KBUILD_HOSTCXXFLAGS) $(HOST_EXTRACXXFLAGS) \ $(HOSTCXXFLAGS_$(basetarget).o) -ifeq ($(KBUILD_SRC),) __hostc_flags = $(_hostc_flags) __hostcxx_flags = $(_hostcxx_flags) -else + +ifeq ($(KBUILD_EXTMOD),) +ifneq ($(KBUILD_SRC),) __hostc_flags = -I$(obj) $(call flags,_hostc_flags) __hostcxx_flags = -I$(obj) $(call flags,_hostcxx_flags) endif +endif hostc_flags = -Wp,-MD,$(depfile) $(__hostc_flags) hostcxx_flags = -Wp,-MD,$(depfile) $(__hostcxx_flags) diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index 12b88d0..ecad15b 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib @@ -137,14 +137,14 @@ _c_flags += $(if $(patsubst n%,, \ $(CFLAGS_KCOV)) endif -# If building the kernel in a separate objtree expand all occurrences -# of -Idir to -I$(srctree)/dir except for absolute paths (starting with '/'). - -ifeq ($(KBUILD_SRC),) __c_flags = $(_c_flags) __a_flags = $(_a_flags) __cpp_flags = $(_cpp_flags) -else + +# If building the kernel in a separate objtree expand all occurrences +# of -Idir to -I$(srctree)/dir except for absolute paths (starting with '/'). +ifeq ($(KBUILD_EXTMOD),) +ifneq ($(KBUILD_SRC),) # -I$(obj) locates generated .h files # $(call addtree,-I$(obj)) locates .h files in srctree, from generated .c files @@ -155,6 +155,7 @@ __c_flags = $(if $(obj),$(call addtree,-I$(src)) -I$(obj)) \ __a_flags = $(call flags,_a_flags) __cpp_flags = $(call flags,_cpp_flags) endif +endif c_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(LINUXINCLUDE) \ -include $(srctree)/include/linux/compiler_types.h \