From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753350AbcHPMWr (ORCPT ); Tue, 16 Aug 2016 08:22:47 -0400 Received: from bes.se.axis.com ([195.60.68.10]:47142 "EHLO bes.se.axis.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752214AbcHPMWq (ORCPT ); Tue, 16 Aug 2016 08:22:46 -0400 Subject: Re: [PATCH] kbuild: do not add srctree to sysroot relative includes To: Michal Marek , Lars Persson References: <1471347658-9219-1-git-send-email-larper@axis.com> <90494889-24e4-64be-422e-d7cc344f03da@suse.com> CC: , From: Lars Persson Message-ID: Date: Tue, 16 Aug 2016 14:22:35 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Icedove/45.2.0 MIME-Version: 1.0 In-Reply-To: <90494889-24e4-64be-422e-d7cc344f03da@suse.com> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.0.5.60] X-ClientProxiedBy: XBOX02.axis.com (10.0.5.16) To XBOX02.axis.com (10.0.5.16) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 08/16/2016 01:59 PM, Michal Marek wrote: > On 2016-08-16 13:40, Lars Persson wrote: >> We need to filter out also -I=/path to allow sysroot relative >> include paths in the makefiles of external modules. >> >> Signed-off-by: Lars Persson >> --- >> scripts/Kbuild.include | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include >> index 1792198..ffe5c6c 100644 >> --- a/scripts/Kbuild.include >> +++ b/scripts/Kbuild.include >> @@ -206,7 +206,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../% -I=%,$(1)),$(patsubst -I%,-I$(srctree)/%,$(1)),$(1))) > > Hi Lars, > > Two questions: 1) Where is the -I=/... syntax documented? I could not > find it gcc docs. You should find this in your gcc manual: If dir begins with "=", then the "=" will be replaced by the sysroot prefix; see --sysroot and -isysroot. 2) Why do these Makefiles use --sysroot at all? The > kernel does not use any system libraries and the host programs are > compiled for the host architecture. One use-case is with the yocto build system. Suppose we have two kernel modules A and B. A installs header files into the sysroot that B will include. - Lars