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 \ From patchwork Wed Jan 16 02:56:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 155685 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp140614jaa; Tue, 15 Jan 2019 18:57:27 -0800 (PST) X-Google-Smtp-Source: ALg8bN6M/0ouSFh2rNsVPhiM3J+ii1Ts+eKsx7yC4bdF4/fSkC76lxcI+dQqtw5SQ14KDiN4XgGR X-Received: by 2002:a62:e044:: with SMTP id f65mr7294795pfh.208.1547607447790; Tue, 15 Jan 2019 18:57:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547607447; cv=none; d=google.com; s=arc-20160816; b=c2KS6A4wPeSzSGRyYzSe3wpjWcvZFJVYJS7AWT6rxrDMCz7rdc1wV/56Q2m79J9RnU rU2WUhijJDW6GBwDZyQz5oeYYLHNJZz2lVBZh6JuMVhntNO4/vBTiobPqMBkb830Hw2z mCetKqX6s25F5ezVrQ+LoJWVnzLyF/XN/oaPVsiqsx74DLArzO2EYwDZsSFLBGot51QM rglg4ime1EML/pLeNtLhcSVdsM8SYdVq7hfO5K1K8AxeaycJAQfh+s3fGToAqqvrphvh 51ZQGXqFUsb9WOGr+O+3AEKgkfkra+YsfdXxodpnbuQdL9JFAVmFZptX9Jmn64ORBP6L SW6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:dkim-filter; bh=IlGcv8kn+7pcad/nWtO0JJAMgDS4Ul+f1F9xFRcEK7s=; b=alCvpcc0P9Au7tS1Xg5icsGGx6oB5u73CBGA1JJBw+rw9QJ8c41WE7eVhRLEivn5EL q3uZi7KZ2mKO186vkds6f7/EfUOJYn+VYITec97ghXBpNkE/s5z9U2kGKgcYnHCFWvcH SrQC78gvRpO2ZWY44D0JjstesKxC/q+4inZKwbusTH6aFbkgOxKlq6jyIAbJmXkkY2Eq Z2TZ5r5j3Lfrx4SgeHBz7oJkJcBfSU/ck5RlrA9TkUepRqct7LlNsEDll5BaMbs1zPC7 3AoXGsN0/vopgYx2KLuGt6QaN9+IZ2pokV73gS4HjUb8ZwN3rvS1j6xB0ZPNdMPsqgdV 9Ing== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=tfopv3kf; 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 k33si5063853pld.374.2019.01.15.18.57.27; Tue, 15 Jan 2019 18:57:27 -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=tfopv3kf; 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 S1729927AbfAPC51 (ORCPT + 7 others); Tue, 15 Jan 2019 21:57:27 -0500 Received: from conuserg-10.nifty.com ([210.131.2.77]:49547 "EHLO conuserg-10.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727883AbfAPC50 (ORCPT ); Tue, 15 Jan 2019 21:57:26 -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 x0G2uksS010468; Wed, 16 Jan 2019 11:56:47 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-10.nifty.com x0G2uksS010468 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1547607407; bh=IlGcv8kn+7pcad/nWtO0JJAMgDS4Ul+f1F9xFRcEK7s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tfopv3kfUnZrL/Td8x/+9NMIWA6dvCq/XCM1R3dEnFOzKcjtrESUhP2rVGSaTE5wO rcoAkzhTHsi7kqhLMwueZ3k6YsPgmX7G99bnBWuu1GLmYSa6YyND7/Lf3Y7zzFhkzo 2d9ZgLYv/lbbKYMlKrAKxv13U7uj8KMkjctySP4TWvhspj4lmq8R61cZUGBXnNcYvG wAwyEGqPpe76nKTycAuUQ0bOfv8UgQkY6UpfSP+kW6PIaxTTrDEq8Z0iGkkvnGpR+l xrlI5qZEfWkK6zJ02Vm4695FcDKXIO1v7gv9JX4ipEngrZpGbfDGxN3IaPZcajO4y1 +FQ9gAzOUoBRw== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: devicetree@vger.kernel.org, Masahiro Yamada , linux-kernel@vger.kernel.org, Michal Marek , Mauro Rossi , Rob Herring , Frank Rowand Subject: [PATCH 2/2] kbuild: add -I$(srctree)/$(src) automatically for hostprogs with O= Date: Wed, 16 Jan 2019 11:56:41 +0900 Message-Id: <1547607401-20118-2-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1547607401-20118-1-git-send-email-yamada.masahiro@socionext.com> References: <1547607401-20118-1-git-send-email-yamada.masahiro@socionext.com> Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org When building kernel objects with the O= option, scripts/Makefile.lib automatically adds both -I$(srctree)/$(src) and -I$(obj) so each Makefile does not need to add them explicitly. In contrast, scripts/Makefile.host adds only -I$(obj) when building host programs with the O= option. As a result, each Makefile must add the extra option to include checkin headers from generated C files. Let's cater to this in the build system for consistency, and drop extra options from the kconfig, dtc, genksyms Makefiles. Signed-off-by: Masahiro Yamada --- scripts/Makefile.host | 4 ++-- scripts/dtc/Makefile | 4 ---- scripts/genksyms/Makefile | 4 ---- scripts/kconfig/Makefile | 2 -- 4 files changed, 2 insertions(+), 12 deletions(-) -- 2.7.4 diff --git a/scripts/Makefile.host b/scripts/Makefile.host index a115259..c41d5a1d 100644 --- a/scripts/Makefile.host +++ b/scripts/Makefile.host @@ -72,8 +72,8 @@ __hostcxx_flags = $(_hostcxx_flags) ifeq ($(KBUILD_EXTMOD),) ifneq ($(KBUILD_SRC),) -__hostc_flags = -I$(obj) $(call flags,_hostc_flags) -__hostcxx_flags = -I$(obj) $(call flags,_hostcxx_flags) +__hostc_flags = -I $(srctree)/$(src) -I $(obj) $(call flags,_hostc_flags) +__hostcxx_flags = -I $(srctree)/$(src) -I $(obj) $(call flags,_hostcxx_flags) endif endif diff --git a/scripts/dtc/Makefile b/scripts/dtc/Makefile index 5f227d8..72d3fa4 100644 --- a/scripts/dtc/Makefile +++ b/scripts/dtc/Makefile @@ -22,9 +22,5 @@ dtc-objs += yamltree.o HOSTLDLIBS_dtc := -lyaml endif -# Generated files need one more search path to include headers in source tree -HOSTCFLAGS_dtc-lexer.lex.o := -I$(src) -HOSTCFLAGS_dtc-parser.tab.o := -I$(src) - # dependencies on generated files need to be listed explicitly $(obj)/dtc-lexer.lex.o: $(obj)/dtc-parser.tab.h diff --git a/scripts/genksyms/Makefile b/scripts/genksyms/Makefile index 03b7ce9..ae5953d 100644 --- a/scripts/genksyms/Makefile +++ b/scripts/genksyms/Makefile @@ -30,9 +30,5 @@ $(obj)/parse.tab.h: $(src)/parse.y FORCE endif -# -I needed for generated C source (shipped source) -HOSTCFLAGS_parse.tab.o := -I$(src) -HOSTCFLAGS_lex.lex.o := -I$(src) - # dependencies on generated files need to be listed explicitly $(obj)/lex.lex.o: $(obj)/parse.tab.h diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile index 1819735..12cb5eb 100644 --- a/scripts/kconfig/Makefile +++ b/scripts/kconfig/Makefile @@ -146,8 +146,6 @@ help: common-objs := confdata.o expr.o symbol.o preprocess.o zconf.lex.o zconf.tab.o $(obj)/zconf.lex.o: $(obj)/zconf.tab.h -HOSTCFLAGS_zconf.lex.o := -I$(src) -HOSTCFLAGS_zconf.tab.o := -I$(src) # conf: Used for defconfig, oldconfig and related targets hostprogs-y += conf