From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756917AbdLVV6z (ORCPT ); Fri, 22 Dec 2017 16:58:55 -0500 Received: from mail-pl0-f46.google.com ([209.85.160.46]:40994 "EHLO mail-pl0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756257AbdLVV6x (ORCPT ); Fri, 22 Dec 2017 16:58:53 -0500 X-Google-Smtp-Source: ACJfBotieaUew4u/Mly06AMbz4rHqbvBAxTYUeQZpOckxuJfUG36SghmXrg+4rL9kiyw1SDYY9YJ/g== Date: Fri, 22 Dec 2017 13:58:50 -0800 From: Guenter Roeck To: Douglas Anderson Cc: Masahiro Yamada , malat@debian.org, dave.hansen@intel.com, yang.s@alibaba-inc.com, Matthias Kaehlcke , Cao jin , Arnd Bergmann , Mark Charlebois , linux-kernel@vger.kernel.org, Josh Poimboeuf , Ingo Molnar Subject: Re: [PATCH 1/2] kbuild: Require a 'make clean' if we detect gcc changed underneath us Message-ID: <20171222215850.GA504@roeck-us.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Dec 21, 2017 at 05:53:02PM -0800, Douglas Anderson wrote: > Several people reported that the commit 3298b690b21c ("kbuild: Add a > cache for generated variables") caused them problems when they updated > gcc versions. Specifically the reports all looked something similar > to this: > > > In file included from ./include/uapi/linux/uuid.h:21:0, > > from ./include/linux/uuid.h:19, > > from ./include/linux/mod_devicetable.h:12, > > from scripts/mod/devicetable-offsets.c:2: > > ./include/linux/string.h:8:20: fatal error: stdarg.h: No such file or > > directory > > #include > > Masahiro Yamada determined that the problem was with: > > NOSTDINC_FLAGS += -nostdinc -isystem $(call shell-cached,$(CC) > -print-file-name=include) > > Specifically that the stale result of -print-file-name is stored in > the cache file. It was determined that a "make clean" fixed the > problems in all cases. > > In this particular case we could certainly try to clean just the cache > when we detect a gcc update, but it seems like overall it's a bad idea > to do an incremental build when gcc changes. We should warn the user > and tell them that they need a 'make clean'. > > Fixes: 3298b690b21c ("kbuild: Add a cache for generated variables") > Reported-by: Yang Shi > Reported-by: Dave Hansen > Reported-by: Mathieu Malaterre > Signed-off-by: Douglas Anderson Unfortunately, it doesn't work as-is. Trying to build for mips with two different compilers, and trying to run "make clean" with the 2nd compiler version, results in: scripts/Kbuild.include:490: *** Detected new CC version (050400 vs 040803). Please 'make clean'. Stop. Makefile:1297: recipe for target '_clean_.' failed make: *** [_clean_.] Error 2 make: *** Waiting for unfinished jobs.... scripts/Kbuild.include:490: *** Detected new CC version (050400 vs 040803). Please 'make clean'. Stop. Makefile:1297: recipe for target '_clean_arch/mips' failed make: *** [_clean_arch/mips] Error 2 scripts/Kbuild.include:490: *** Detected new CC version (050400 vs 040803). Please 'make clean'. Stop. Makefile:1297: recipe for target '_clean_arch/mips/boot/dts' failed make: *** [_clean_arch/mips/boot/dts] Error 2 make: *** wait: No child processes. Stop. Guenter