diff mbox

[v4,2/2] kbuild: Cache a few more calls to the compiler

Message ID 20171016171246.15712-3-dianders@chromium.org (mailing list archive)
State New, archived
Headers show

Commit Message

Doug Anderson Oct. 16, 2017, 5:12 p.m. UTC
These are a few stragglers that I left out of the original patch to
cache calls to the C compiler ("kbuild: Add a cache for generated
variables") because they bleed out into the main Makefile and thus
uglify things a little bit.  The idea is the same here, though.

Signed-off-by: Douglas Anderson <dianders@chromium.org>
Tested-by: Ingo Molnar <mingo@kernel.org>
Tested-by: Guenter Roeck <linux@roeck-us.net>
---

Changes in v4: None
Changes in v3:
- Add Tested-by for Ingo and Guenter since v2 and v3 are very similar

Changes in v2:
- Abstract at a different level (like shell-cached) per Masahiro Yamada

 Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Doug Anderson Dec. 20, 2017, 5:11 p.m. UTC | #1
Hi,

On Tue, Dec 19, 2017 at 5:18 PM, Dave Hansen <dave.hansen@intel.com> wrote:
> I'm seeing some build breakage that I bisected to commit 4e56207130eda:
>
>>   CC      kernel/bounds.s
>> In file included from /home/davehans/linux.git/include/asm-generic/bug.h:15:0,
>>                  from /home/davehans/linux.git/arch/x86/include/asm/bug.h:81,
>>                  from /home/davehans/linux.git/include/linux/bug.h:4,
>>                  from /home/davehans/linux.git/include/linux/page-flags.h:9,
>>                  from /home/davehans/linux.git/kernel/bounds.c:9:
>> /home/davehans/linux.git/include/linux/kernel.h:5:20: fatal error: stdarg.h: No such file or directory
>>  #include <stdarg.h>
>>                     ^
>> compilation terminated.
>
> It's odd because I'm pretty sure I've done 4.15-rc compiles on this
> system before without issues.  I suspect something in my config
> (attached) is triggering this.
>
> Does this look familiar to anyone?
>
> gcc -v
> Using built-in specs.
> COLLECT_GCC=/usr/bin/gcc
> COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/6.4.1/lto-wrapper
> Target: x86_64-redhat-linux
> Configured with: ../configure --enable-bootstrap
> --enable-languages=c,c++,objc,obj-c++,fortran,ada,go,lto --prefix=/usr
> --mandir=/usr/share/man --infodir=/usr/share/info
> --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-shared
> --enable-threads=posix --enable-checking=release --enable-multilib
> --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions
> --enable-gnu-unique-object --enable-linker-build-id
> --with-linker-hash-style=gnu --enable-plugin --enable-initfini-array
> --disable-libgcj --with-isl --enable-libmpx
> --enable-gnu-indirect-function --with-tune=generic --with-arch_32=i686
> --build=x86_64-redhat-linux
> Thread model: posix
> gcc version 6.4.1 20170727 (Red Hat 6.4.1-1) (GCC)

Yes, it appears to be related to upgrading your compiler without doing
a "make clean".  Discussion can be found at
<https://lkml.org/lkml/2017/12/16/315>, or search for the subject

  [BUG] Build error for 4.15-rc3 kernel caused by patch "kbuild: Add a
cache for generated variables"

-Doug
--
To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/Makefile b/Makefile
index a2d715d7a327..5c82cca84d29 100644
--- a/Makefile
+++ b/Makefile
@@ -638,7 +638,7 @@  KBUILD_CFLAGS += $(call cc-ifversion, -lt, 0409, \
 KBUILD_CFLAGS	+= $(call cc-option,--param=allow-store-data-races=0)
 
 # check for 'asm goto'
-ifeq ($(shell $(CONFIG_SHELL) $(srctree)/scripts/gcc-goto.sh $(CC) $(KBUILD_CFLAGS)), y)
+ifeq ($(call shell-cached,$(CONFIG_SHELL) $(srctree)/scripts/gcc-goto.sh $(CC) $(KBUILD_CFLAGS)), y)
 	KBUILD_CFLAGS += -DCC_HAVE_ASM_GOTO
 	KBUILD_AFLAGS += -DCC_HAVE_ASM_GOTO
 endif
@@ -774,7 +774,7 @@  KBUILD_CFLAGS	+= $(call cc-option,-fdata-sections,)
 endif
 
 # arch Makefile may override CC so keep this after arch Makefile is included
-NOSTDINC_FLAGS += -nostdinc -isystem $(shell $(CC) -print-file-name=include)
+NOSTDINC_FLAGS += -nostdinc -isystem $(call shell-cached,$(CC) -print-file-name=include)
 CHECKFLAGS     += $(NOSTDINC_FLAGS)
 
 # warn about C99 declaration after statement