From: Heinrich Schuchardt Date: Sat, 17 Oct 2020 19:57:31 +0200 Subject: [PATCH 1/1] Makefile: consistent include path for out of tree build In-Reply-To: <20201017164928.GE14816@bill-the-cat> References: <20201017164253.234284-1-xypron.glpk@gmx.de> <20201017164928.GE14816@bill-the-cat> Message-ID: <3db83ee8-442e-7504-16fa-eeefe15114c8@gmx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 10/17/20 6:49 PM, Tom Rini wrote: > On Sat, Oct 17, 2020 at 06:42:53PM +0200, Heinrich Schuchardt wrote: > >> When compiling path/foo.c, we should not add -I$(scr_tree)/path to the gcc >> flags. Otherwise we get different build results for in tree and out of tree >> builds. >> >> Signed-off-by: Heinrich Schuchardt >> --- >> scripts/Makefile.lib | 6 ++---- >> 1 file changed, 2 insertions(+), 4 deletions(-) >> >> diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib >> index 56e9d54242..98817084f4 100644 >> --- a/scripts/Makefile.lib >> +++ b/scripts/Makefile.lib >> @@ -136,10 +136,8 @@ __cpp_flags = $(_cpp_flags) >> else >> >> # -I$(obj) locates generated .h files >> -# $(call addtree,-I$(obj)) locates .h files in srctree, from generated .c files >> -# and locates generated .h files >> -# FIXME: Replace both with specific CFLAGS* statements in the makefiles >> -__c_flags = $(if $(obj),$(call addtree,-I$(src)) -I$(obj)) \ >> +# FIXME: Replace with specific CFLAGS* statements in the makefiles >> +__c_flags = $(if $(obj), -I$(obj)) \ >> $(call flags,_c_flags) >> __a_flags = $(call flags,_a_flags) >> __cpp_flags = $(call flags,_cpp_flags) > > As this will make future re-syncs with the Kbuild system harder, NAK. > > I would suggest making this problem show up in the Linux kernel, get it > addressed there, and then backport. Or, if it can't be and it's just > another problem related to our last sync being on v4.19, help syncing up > with v4.20 and so forth would be greatly appreciated. > v4.20 does not even exist as maintained release. Current Linux stable is v5.9. addtree() does not exist in scripts/Makefile.lib of Linux next-20201016. So I would not expect the kernel people to fix our outdated script. Best regards Heinrich