From mboxrd@z Thu Jan 1 00:00:00 1970 From: Masahiro Yamada Date: Fri, 21 Feb 2020 09:18:50 +0000 Subject: Re: [PATCH] kbuild: use KBUILD_DEFCONFIG as the fallback for DEFCONFIG_LIST Message-Id: List-Id: References: <20200216154502.26478-1-masahiroy@kernel.org> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable To: Marek Szyprowski Cc: Rich Felker , Linux-sh list , Catalin Marinas , Guo Ren , "H. Peter Anvin" , sparclinux , "open list:SIFIVE DRIVERS" , Vincent Chen , Will Deacon , Anton Ivanov , Yoshinori Sato , Richard Weinberger , X86 ML , Ingo Molnar , Albert Ou , Linux Kbuild mailing list , Jeff Dike , linux-um@lists.infradead.org, Borislav Petkov , Greentime Hu , Paul Walmsley , Thomas Gleixner , "linux-arm-kernel@lists.infradead.org" , Nick Hu , Linux Kernel Mailing List , Palmer Dabbelt , "David S. Miller" On Fri, Feb 21, 2020 at 5:50 PM Marek Szyprowski wrote: > > Dear All, > > On 16.02.2020 16:45, Masahiro Yamada wrote: > > Most of the Kconfig commands (except defconfig and all*config) read the > > .config file as a base set of CONFIG options. > > > > When it does not exist, the files in DEFCONFIG_LIST are searched in this > > order and loaded if found. > > > > I do not see much sense in the last two entries in DEFCONFIG_LIST. > > > > [1] ARCH_DEFCONFIG > > > > The entry for DEFCONFIG_LIST is guarded by 'depends on !UML'. So, the > > ARCH_DEFCONFIG definition in arch/x86/um/Kconfig is meaningless. > > > > arch/{sh,sparc,x86}/Kconfig define ARCH_DEFCONFIG depending on 32 or 64 > > bit variant symbols. This is a little bit strange; ARCH_DEFCONFIG should > > be a fixed string because the base config file is loaded before the sym= bol > > evaluation stage. > > > > Using KBUILD_DEFCONFIG is saner because it is fixed before Kconfig is > > invoked. Fortunately, arch/{sh,sparc,x86}/Makefile define it in the > > same way, and it works as expected. Hence, replace ARCH_DEFCONFIG with > > "arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG)". > > > > [2] arch/$(ARCH)/defconfig > > > > This file path is no longer valid. The defconfig files are always locat= ed > > in the arch configs/ directories. > > > > $ find arch -name defconfig | sort > > arch/alpha/configs/defconfig > > arch/arm64/configs/defconfig > > arch/csky/configs/defconfig > > arch/nds32/configs/defconfig > > arch/riscv/configs/defconfig > > arch/s390/configs/defconfig > > arch/unicore32/configs/defconfig > > > > The path arch/*/configs/defconfig is already covered by > > "arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG)". So, this file path is > > not necessary. > > > > Signed-off-by: Masahiro Yamada > > This patch landed in today's linux-next (next-20200221) and broke arm64 > builds: > > --->8--- > > $ make ARCH=3Darm64 CROSS_COMPILE=AArch64-linux-gnu- defconfig > *** Default configuration is based on 'defconfig' > # > # configuration written to .config > # > $ make ARCH=3Darm64 CROSS_COMPILE=AArch64-linux-gnu- Image.gz > scripts/kconfig/conf --syncconfig Kconfig > scripts/kconfig/conf --syncconfig Kconfig > scripts/kconfig/conf --syncconfig Kconfig > scripts/kconfig/conf --syncconfig Kconfig > scripts/kconfig/conf --syncconfig Kconfig > ... > > (endless loop) > > --->8--- > > Reverting it fixes the issue: My bad. This is because arch/arm64/Makefile does not define KBUILD_DEFCONFIG. I will drop it. Sorry about that. > > --->8--- > > $ git revert cdd5d1a207d6a3a06c9e627a0234d9a6af6ad347 > [detached HEAD 1080d6a13b6d] Revert "kbuild: use KBUILD_DEFCONFIG as the > fallback for DEFCONFIG_LIST" > 5 files changed, 22 insertions(+), 1 deletion(-) > $ make ARCH=3Darm64 CROSS_COMPILE=AArch64-linux-gnu- defconfig > *** Default configuration is based on 'defconfig' > # > # No change to .config > # > $ make ARCH=3Darm64 CROSS_COMPILE=AArch64-linux-gnu- Image.gz > scripts/kconfig/conf --syncconfig Kconfig > UPD include/config/kernel.release > UPD include/generated/utsrelease.h > CC scripts/mod/empty.o > ... > > $ aarch64-linux-gnu-gcc --version > aarch64-linux-gnu-gcc (Ubuntu/Linaro 7.4.0-1ubuntu1~18.04.1) 7.4.0 > Copyright (C) 2017 Free Software Foundation, Inc. > This is free software; see the source for copying conditions. There is NO > warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOS= E. > --->8--- > > It looks that the issue is similar to the one described here: > > https://patchwork.kernel.org/patch/10453685/ > > I hope this report helps fixing the issue. > > > --- > > > > arch/sh/Kconfig | 5 ----- > > arch/sparc/Kconfig | 5 ----- > > arch/x86/Kconfig | 5 ----- > > arch/x86/um/Kconfig | 5 ----- > > init/Kconfig | 3 +-- > > 5 files changed, 1 insertion(+), 22 deletions(-) > > > > diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig > > index 9ece111b0254..b4f0e37b83eb 100644 > > --- a/arch/sh/Kconfig > > +++ b/arch/sh/Kconfig > > @@ -87,11 +87,6 @@ config SUPERH64 > > select HAVE_EXIT_THREAD > > select KALLSYMS > > > > -config ARCH_DEFCONFIG > > - string > > - default "arch/sh/configs/shx3_defconfig" if SUPERH32 > > - default "arch/sh/configs/cayman_defconfig" if SUPERH64 > > - > > config GENERIC_BUG > > def_bool y > > depends on BUG && SUPERH32 > > diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig > > index c1dd6dd642f4..0de15380d1fc 100644 > > --- a/arch/sparc/Kconfig > > +++ b/arch/sparc/Kconfig > > @@ -95,11 +95,6 @@ config SPARC64 > > select PCI_DOMAINS if PCI > > select ARCH_HAS_GIGANTIC_PAGE > > > > -config ARCH_DEFCONFIG > > - string > > - default "arch/sparc/configs/sparc32_defconfig" if SPARC32 > > - default "arch/sparc/configs/sparc64_defconfig" if SPARC64 > > - > > config ARCH_PROC_KCORE_TEXT > > def_bool y > > > > diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig > > index beea77046f9b..98935f4387f9 100644 > > --- a/arch/x86/Kconfig > > +++ b/arch/x86/Kconfig > > @@ -240,11 +240,6 @@ config OUTPUT_FORMAT > > default "elf32-i386" if X86_32 > > default "elf64-x86-64" if X86_64 > > > > -config ARCH_DEFCONFIG > > - string > > - default "arch/x86/configs/i386_defconfig" if X86_32 > > - default "arch/x86/configs/x86_64_defconfig" if X86_64 > > - > > config LOCKDEP_SUPPORT > > def_bool y > > > > diff --git a/arch/x86/um/Kconfig b/arch/x86/um/Kconfig > > index a8985e1f7432..95d26a69088b 100644 > > --- a/arch/x86/um/Kconfig > > +++ b/arch/x86/um/Kconfig > > @@ -27,11 +27,6 @@ config X86_64 > > def_bool 64BIT > > select MODULES_USE_ELF_RELA > > > > -config ARCH_DEFCONFIG > > - string > > - default "arch/um/configs/i386_defconfig" if X86_32 > > - default "arch/um/configs/x86_64_defconfig" if X86_64 > > - > > config 3_LEVEL_PGTABLES > > bool "Three-level pagetables" if !64BIT > > default 64BIT > > diff --git a/init/Kconfig b/init/Kconfig > > index 452bc1835cd4..6ccdb168dee5 100644 > > --- a/init/Kconfig > > +++ b/init/Kconfig > > @@ -6,8 +6,7 @@ config DEFCONFIG_LIST > > default "/lib/modules/$(shell,uname -r)/.config" > > default "/etc/kernel-config" > > default "/boot/config-$(shell,uname -r)" > > - default ARCH_DEFCONFIG > > - default "arch/$(ARCH)/defconfig" > > + default "arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG)" > > > > config CC_IS_GCC > > def_bool $(success,$(CC) --version | head -n 1 | grep -q gcc) > > Best regards > -- > Marek Szyprowski, PhD > Samsung R&D Institute Poland > --=20 Best Regards Masahiro Yamada From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D0ABEC35641 for ; Fri, 21 Feb 2020 09:19:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9429020679 for ; Fri, 21 Feb 2020 09:19:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1582276792; bh=Nrwh0w6uot9bvfAZ2gkHYhrOm0I7pUhzHr/n4fpMHkI=; h=References:In-Reply-To:From:Date:Subject:To:Cc:List-ID:From; b=V4AWECqUg2fGp6uxwcLyNSiIz1W6VOEV6fR5fEz9R440u/Zwx/s/lUTsH5LS2SdCg tSxNOUtzOfTRj+HjEgIAEyXWecgk8qwGbYYj2WbJtJ1Cgh9/Ljau9NyMCI4yPVXZvH mSb1Q1iXPupVJIEgBjSHaTJeGfKFlQBUP5keOXkw= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727640AbgBUJTv (ORCPT ); Fri, 21 Feb 2020 04:19:51 -0500 Received: from conssluserg-02.nifty.com ([210.131.2.81]:51795 "EHLO conssluserg-02.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726244AbgBUJTu (ORCPT ); Fri, 21 Feb 2020 04:19:50 -0500 Received: from mail-vk1-f170.google.com (mail-vk1-f170.google.com [209.85.221.170]) (authenticated) by conssluserg-02.nifty.com with ESMTP id 01L9JRP8001277; Fri, 21 Feb 2020 18:19:27 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-02.nifty.com 01L9JRP8001277 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1582276768; bh=VmuyVpcSR865JyPo0oVfgzMcmXUB4YPWqRffdg846F0=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=k6u9vPdhI6KhWgKFa+85uXqNS1YYMM3fPKwoQ0+mXFsCqC7Qtlm+j6wX6feBp9XGB 1BUxPU3PkoHO0BiRd2yZ2GByfUpx2+NP2NrIFgVObece6IUxFK2PRcUi6twQPO1gfY JBNqel9zTN4MB38yKaZgPGo43xybEJenJCh0+WTcb2kMMpi9ShcEqSpv/q8kJpQ6pE wlvStdWh0o5oQLZD9jkzu7XGI0oUs1yDNxY9A1jlyDo2S3apE1l/wh2hRBM5LlrFYN ElbrhVjxY+Edkw76jlulz1LngNsLOKencNnkq1Bf51eNsfukbttbhAgvjQTyVvfFPY nahV40hzNGuiw== X-Nifty-SrcIP: [209.85.221.170] Received: by mail-vk1-f170.google.com with SMTP id w67so386968vkf.1; Fri, 21 Feb 2020 01:19:27 -0800 (PST) X-Gm-Message-State: APjAAAVuYtRmr0nDg/8kBaJmiVRZrTkYGZPn6ASzt1mnGzYG2oDvaAPk /Wmf3GvNKPFMMLvEYH0ZhYR939Jh+5FQvx0jfk8= X-Google-Smtp-Source: APXvYqzaz0mPSZK/ntfmxfvFupJ42NyBQt0nUrM/n8cwK4Ehx6Qt0V2MsrTaIIELjQXW5ad1WZ9ao8dfI393Harrrkg= X-Received: by 2002:a1f:72c3:: with SMTP id n186mr16153825vkc.12.1582276766520; Fri, 21 Feb 2020 01:19:26 -0800 (PST) MIME-Version: 1.0 References: <20200216154502.26478-1-masahiroy@kernel.org> In-Reply-To: From: Masahiro Yamada Date: Fri, 21 Feb 2020 18:18:50 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] kbuild: use KBUILD_DEFCONFIG as the fallback for DEFCONFIG_LIST To: Marek Szyprowski Cc: Linux Kbuild mailing list , X86 ML , sparclinux , Linux-sh list , linux-um@lists.infradead.org, Linux Kernel Mailing List , Albert Ou , Anton Ivanov , Borislav Petkov , "David S. Miller" , Greentime Hu , Guo Ren , "H. Peter Anvin" , Ingo Molnar , Jeff Dike , Nick Hu , Palmer Dabbelt , Paul Walmsley , Rich Felker , Richard Weinberger , Thomas Gleixner , Vincent Chen , Yoshinori Sato , "open list:SIFIVE DRIVERS" , "linux-arm-kernel@lists.infradead.org" , Catalin Marinas , Will Deacon Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Feb 21, 2020 at 5:50 PM Marek Szyprowski wrote: > > Dear All, > > On 16.02.2020 16:45, Masahiro Yamada wrote: > > Most of the Kconfig commands (except defconfig and all*config) read the > > .config file as a base set of CONFIG options. > > > > When it does not exist, the files in DEFCONFIG_LIST are searched in this > > order and loaded if found. > > > > I do not see much sense in the last two entries in DEFCONFIG_LIST. > > > > [1] ARCH_DEFCONFIG > > > > The entry for DEFCONFIG_LIST is guarded by 'depends on !UML'. So, the > > ARCH_DEFCONFIG definition in arch/x86/um/Kconfig is meaningless. > > > > arch/{sh,sparc,x86}/Kconfig define ARCH_DEFCONFIG depending on 32 or 64 > > bit variant symbols. This is a little bit strange; ARCH_DEFCONFIG should > > be a fixed string because the base config file is loaded before the symbol > > evaluation stage. > > > > Using KBUILD_DEFCONFIG is saner because it is fixed before Kconfig is > > invoked. Fortunately, arch/{sh,sparc,x86}/Makefile define it in the > > same way, and it works as expected. Hence, replace ARCH_DEFCONFIG with > > "arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG)". > > > > [2] arch/$(ARCH)/defconfig > > > > This file path is no longer valid. The defconfig files are always located > > in the arch configs/ directories. > > > > $ find arch -name defconfig | sort > > arch/alpha/configs/defconfig > > arch/arm64/configs/defconfig > > arch/csky/configs/defconfig > > arch/nds32/configs/defconfig > > arch/riscv/configs/defconfig > > arch/s390/configs/defconfig > > arch/unicore32/configs/defconfig > > > > The path arch/*/configs/defconfig is already covered by > > "arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG)". So, this file path is > > not necessary. > > > > Signed-off-by: Masahiro Yamada > > This patch landed in today's linux-next (next-20200221) and broke arm64 > builds: > > --->8--- > > $ make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- defconfig > *** Default configuration is based on 'defconfig' > # > # configuration written to .config > # > $ make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- Image.gz > scripts/kconfig/conf --syncconfig Kconfig > scripts/kconfig/conf --syncconfig Kconfig > scripts/kconfig/conf --syncconfig Kconfig > scripts/kconfig/conf --syncconfig Kconfig > scripts/kconfig/conf --syncconfig Kconfig > ... > > (endless loop) > > --->8--- > > Reverting it fixes the issue: My bad. This is because arch/arm64/Makefile does not define KBUILD_DEFCONFIG. I will drop it. Sorry about that. > > --->8--- > > $ git revert cdd5d1a207d6a3a06c9e627a0234d9a6af6ad347 > [detached HEAD 1080d6a13b6d] Revert "kbuild: use KBUILD_DEFCONFIG as the > fallback for DEFCONFIG_LIST" > 5 files changed, 22 insertions(+), 1 deletion(-) > $ make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- defconfig > *** Default configuration is based on 'defconfig' > # > # No change to .config > # > $ make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- Image.gz > scripts/kconfig/conf --syncconfig Kconfig > UPD include/config/kernel.release > UPD include/generated/utsrelease.h > CC scripts/mod/empty.o > ... > > $ aarch64-linux-gnu-gcc --version > aarch64-linux-gnu-gcc (Ubuntu/Linaro 7.4.0-1ubuntu1~18.04.1) 7.4.0 > Copyright (C) 2017 Free Software Foundation, Inc. > This is free software; see the source for copying conditions. There is NO > warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. > --->8--- > > It looks that the issue is similar to the one described here: > > https://patchwork.kernel.org/patch/10453685/ > > I hope this report helps fixing the issue. > > > --- > > > > arch/sh/Kconfig | 5 ----- > > arch/sparc/Kconfig | 5 ----- > > arch/x86/Kconfig | 5 ----- > > arch/x86/um/Kconfig | 5 ----- > > init/Kconfig | 3 +-- > > 5 files changed, 1 insertion(+), 22 deletions(-) > > > > diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig > > index 9ece111b0254..b4f0e37b83eb 100644 > > --- a/arch/sh/Kconfig > > +++ b/arch/sh/Kconfig > > @@ -87,11 +87,6 @@ config SUPERH64 > > select HAVE_EXIT_THREAD > > select KALLSYMS > > > > -config ARCH_DEFCONFIG > > - string > > - default "arch/sh/configs/shx3_defconfig" if SUPERH32 > > - default "arch/sh/configs/cayman_defconfig" if SUPERH64 > > - > > config GENERIC_BUG > > def_bool y > > depends on BUG && SUPERH32 > > diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig > > index c1dd6dd642f4..0de15380d1fc 100644 > > --- a/arch/sparc/Kconfig > > +++ b/arch/sparc/Kconfig > > @@ -95,11 +95,6 @@ config SPARC64 > > select PCI_DOMAINS if PCI > > select ARCH_HAS_GIGANTIC_PAGE > > > > -config ARCH_DEFCONFIG > > - string > > - default "arch/sparc/configs/sparc32_defconfig" if SPARC32 > > - default "arch/sparc/configs/sparc64_defconfig" if SPARC64 > > - > > config ARCH_PROC_KCORE_TEXT > > def_bool y > > > > diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig > > index beea77046f9b..98935f4387f9 100644 > > --- a/arch/x86/Kconfig > > +++ b/arch/x86/Kconfig > > @@ -240,11 +240,6 @@ config OUTPUT_FORMAT > > default "elf32-i386" if X86_32 > > default "elf64-x86-64" if X86_64 > > > > -config ARCH_DEFCONFIG > > - string > > - default "arch/x86/configs/i386_defconfig" if X86_32 > > - default "arch/x86/configs/x86_64_defconfig" if X86_64 > > - > > config LOCKDEP_SUPPORT > > def_bool y > > > > diff --git a/arch/x86/um/Kconfig b/arch/x86/um/Kconfig > > index a8985e1f7432..95d26a69088b 100644 > > --- a/arch/x86/um/Kconfig > > +++ b/arch/x86/um/Kconfig > > @@ -27,11 +27,6 @@ config X86_64 > > def_bool 64BIT > > select MODULES_USE_ELF_RELA > > > > -config ARCH_DEFCONFIG > > - string > > - default "arch/um/configs/i386_defconfig" if X86_32 > > - default "arch/um/configs/x86_64_defconfig" if X86_64 > > - > > config 3_LEVEL_PGTABLES > > bool "Three-level pagetables" if !64BIT > > default 64BIT > > diff --git a/init/Kconfig b/init/Kconfig > > index 452bc1835cd4..6ccdb168dee5 100644 > > --- a/init/Kconfig > > +++ b/init/Kconfig > > @@ -6,8 +6,7 @@ config DEFCONFIG_LIST > > default "/lib/modules/$(shell,uname -r)/.config" > > default "/etc/kernel-config" > > default "/boot/config-$(shell,uname -r)" > > - default ARCH_DEFCONFIG > > - default "arch/$(ARCH)/defconfig" > > + default "arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG)" > > > > config CC_IS_GCC > > def_bool $(success,$(CC) --version | head -n 1 | grep -q gcc) > > Best regards > -- > Marek Szyprowski, PhD > Samsung R&D Institute Poland > -- Best Regards Masahiro Yamada From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from conssluserg-02.nifty.com ([210.131.2.81]:51795 "EHLO conssluserg-02.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726244AbgBUJTu (ORCPT ); Fri, 21 Feb 2020 04:19:50 -0500 MIME-Version: 1.0 References: <20200216154502.26478-1-masahiroy@kernel.org> In-Reply-To: From: Masahiro Yamada Date: Fri, 21 Feb 2020 18:18:50 +0900 Message-ID: Subject: Re: [PATCH] kbuild: use KBUILD_DEFCONFIG as the fallback for DEFCONFIG_LIST Content-Type: text/plain; charset="UTF-8" Sender: linux-kbuild-owner@vger.kernel.org List-ID: To: Marek Szyprowski Cc: Linux Kbuild mailing list , X86 ML , sparclinux , Linux-sh list , linux-um@lists.infradead.org, Linux Kernel Mailing List , Albert Ou , Anton Ivanov , Borislav Petkov , "David S. Miller" , Greentime Hu , Guo Ren , "H. Peter Anvin" , Ingo Molnar , Jeff Dike , Nick Hu , Palmer Dabbelt , Paul Walmsley , Rich Felker , Richard Weinberger , Thomas Gleixner , Vincent Chen , Yoshinori Sato , "open list:SIFIVE DRIVERS" , "linux-arm-kernel@lists.infradead.org" , Catalin Marinas , Will Deacon On Fri, Feb 21, 2020 at 5:50 PM Marek Szyprowski wrote: > > Dear All, > > On 16.02.2020 16:45, Masahiro Yamada wrote: > > Most of the Kconfig commands (except defconfig and all*config) read the > > .config file as a base set of CONFIG options. > > > > When it does not exist, the files in DEFCONFIG_LIST are searched in this > > order and loaded if found. > > > > I do not see much sense in the last two entries in DEFCONFIG_LIST. > > > > [1] ARCH_DEFCONFIG > > > > The entry for DEFCONFIG_LIST is guarded by 'depends on !UML'. So, the > > ARCH_DEFCONFIG definition in arch/x86/um/Kconfig is meaningless. > > > > arch/{sh,sparc,x86}/Kconfig define ARCH_DEFCONFIG depending on 32 or 64 > > bit variant symbols. This is a little bit strange; ARCH_DEFCONFIG should > > be a fixed string because the base config file is loaded before the symbol > > evaluation stage. > > > > Using KBUILD_DEFCONFIG is saner because it is fixed before Kconfig is > > invoked. Fortunately, arch/{sh,sparc,x86}/Makefile define it in the > > same way, and it works as expected. Hence, replace ARCH_DEFCONFIG with > > "arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG)". > > > > [2] arch/$(ARCH)/defconfig > > > > This file path is no longer valid. The defconfig files are always located > > in the arch configs/ directories. > > > > $ find arch -name defconfig | sort > > arch/alpha/configs/defconfig > > arch/arm64/configs/defconfig > > arch/csky/configs/defconfig > > arch/nds32/configs/defconfig > > arch/riscv/configs/defconfig > > arch/s390/configs/defconfig > > arch/unicore32/configs/defconfig > > > > The path arch/*/configs/defconfig is already covered by > > "arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG)". So, this file path is > > not necessary. > > > > Signed-off-by: Masahiro Yamada > > This patch landed in today's linux-next (next-20200221) and broke arm64 > builds: > > --->8--- > > $ make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- defconfig > *** Default configuration is based on 'defconfig' > # > # configuration written to .config > # > $ make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- Image.gz > scripts/kconfig/conf --syncconfig Kconfig > scripts/kconfig/conf --syncconfig Kconfig > scripts/kconfig/conf --syncconfig Kconfig > scripts/kconfig/conf --syncconfig Kconfig > scripts/kconfig/conf --syncconfig Kconfig > ... > > (endless loop) > > --->8--- > > Reverting it fixes the issue: My bad. This is because arch/arm64/Makefile does not define KBUILD_DEFCONFIG. I will drop it. Sorry about that. > > --->8--- > > $ git revert cdd5d1a207d6a3a06c9e627a0234d9a6af6ad347 > [detached HEAD 1080d6a13b6d] Revert "kbuild: use KBUILD_DEFCONFIG as the > fallback for DEFCONFIG_LIST" > 5 files changed, 22 insertions(+), 1 deletion(-) > $ make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- defconfig > *** Default configuration is based on 'defconfig' > # > # No change to .config > # > $ make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- Image.gz > scripts/kconfig/conf --syncconfig Kconfig > UPD include/config/kernel.release > UPD include/generated/utsrelease.h > CC scripts/mod/empty.o > ... > > $ aarch64-linux-gnu-gcc --version > aarch64-linux-gnu-gcc (Ubuntu/Linaro 7.4.0-1ubuntu1~18.04.1) 7.4.0 > Copyright (C) 2017 Free Software Foundation, Inc. > This is free software; see the source for copying conditions. There is NO > warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. > --->8--- > > It looks that the issue is similar to the one described here: > > https://patchwork.kernel.org/patch/10453685/ > > I hope this report helps fixing the issue. > > > --- > > > > arch/sh/Kconfig | 5 ----- > > arch/sparc/Kconfig | 5 ----- > > arch/x86/Kconfig | 5 ----- > > arch/x86/um/Kconfig | 5 ----- > > init/Kconfig | 3 +-- > > 5 files changed, 1 insertion(+), 22 deletions(-) > > > > diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig > > index 9ece111b0254..b4f0e37b83eb 100644 > > --- a/arch/sh/Kconfig > > +++ b/arch/sh/Kconfig > > @@ -87,11 +87,6 @@ config SUPERH64 > > select HAVE_EXIT_THREAD > > select KALLSYMS > > > > -config ARCH_DEFCONFIG > > - string > > - default "arch/sh/configs/shx3_defconfig" if SUPERH32 > > - default "arch/sh/configs/cayman_defconfig" if SUPERH64 > > - > > config GENERIC_BUG > > def_bool y > > depends on BUG && SUPERH32 > > diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig > > index c1dd6dd642f4..0de15380d1fc 100644 > > --- a/arch/sparc/Kconfig > > +++ b/arch/sparc/Kconfig > > @@ -95,11 +95,6 @@ config SPARC64 > > select PCI_DOMAINS if PCI > > select ARCH_HAS_GIGANTIC_PAGE > > > > -config ARCH_DEFCONFIG > > - string > > - default "arch/sparc/configs/sparc32_defconfig" if SPARC32 > > - default "arch/sparc/configs/sparc64_defconfig" if SPARC64 > > - > > config ARCH_PROC_KCORE_TEXT > > def_bool y > > > > diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig > > index beea77046f9b..98935f4387f9 100644 > > --- a/arch/x86/Kconfig > > +++ b/arch/x86/Kconfig > > @@ -240,11 +240,6 @@ config OUTPUT_FORMAT > > default "elf32-i386" if X86_32 > > default "elf64-x86-64" if X86_64 > > > > -config ARCH_DEFCONFIG > > - string > > - default "arch/x86/configs/i386_defconfig" if X86_32 > > - default "arch/x86/configs/x86_64_defconfig" if X86_64 > > - > > config LOCKDEP_SUPPORT > > def_bool y > > > > diff --git a/arch/x86/um/Kconfig b/arch/x86/um/Kconfig > > index a8985e1f7432..95d26a69088b 100644 > > --- a/arch/x86/um/Kconfig > > +++ b/arch/x86/um/Kconfig > > @@ -27,11 +27,6 @@ config X86_64 > > def_bool 64BIT > > select MODULES_USE_ELF_RELA > > > > -config ARCH_DEFCONFIG > > - string > > - default "arch/um/configs/i386_defconfig" if X86_32 > > - default "arch/um/configs/x86_64_defconfig" if X86_64 > > - > > config 3_LEVEL_PGTABLES > > bool "Three-level pagetables" if !64BIT > > default 64BIT > > diff --git a/init/Kconfig b/init/Kconfig > > index 452bc1835cd4..6ccdb168dee5 100644 > > --- a/init/Kconfig > > +++ b/init/Kconfig > > @@ -6,8 +6,7 @@ config DEFCONFIG_LIST > > default "/lib/modules/$(shell,uname -r)/.config" > > default "/etc/kernel-config" > > default "/boot/config-$(shell,uname -r)" > > - default ARCH_DEFCONFIG > > - default "arch/$(ARCH)/defconfig" > > + default "arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG)" > > > > config CC_IS_GCC > > def_bool $(success,$(CC) --version | head -n 1 | grep -q gcc) > > Best regards > -- > Marek Szyprowski, PhD > Samsung R&D Institute Poland > -- Best Regards Masahiro Yamada From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A15CEC35640 for ; Fri, 21 Feb 2020 09:20:23 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6BAD120679 for ; Fri, 21 Feb 2020 09:20:23 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="dNubAXFf"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=nifty.com header.i=@nifty.com header.b="k6u9vPdh" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6BAD120679 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-riscv-bounces+infradead-linux-riscv=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type:To: Subject:Message-ID:Date:From:In-Reply-To:References:MIME-Version:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=VmuyVpcSR865JyPo0oVfgzMcmXUB4YPWqRffdg846F0=; b=dNubAXFfsDZ+DrttNZI+AcJGD NFEc3S6vAu7xa64Ftc+MS4/1joHs+JdhRcQSObF6jFgF2UHCkvA+X0aoUNGtlV65ifAcViqkyJJem diG2RGMPeDwCckn+psLrjd9vw9wAPMtBbATM3O/M13HAyA7623oRFNlwufS8HhL/MRwz9Y50mFNEO CIuOXb2AH7h3un16xAOt5wPoBHxZ9+K7cIphsCPkAoLprNzbPD02ivgyXzN/EBoBjau8jKRitVU/W Sby2xG5R+2e882VP1CM33gLau7jkWjqmoK2JxIoR7mEuAg3GxqcKbnDQH8G7P7Q35R/NSIZOPEVPL atuGj2ILw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1j54To-0006bg-P1; Fri, 21 Feb 2020 09:20:16 +0000 Received: from conssluserg-04.nifty.com ([210.131.2.83]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1j54Tb-0005Eo-3E; Fri, 21 Feb 2020 09:20:05 +0000 Received: from mail-vk1-f174.google.com (mail-vk1-f174.google.com [209.85.221.174]) (authenticated) by conssluserg-04.nifty.com with ESMTP id 01L9JRK8023932; Fri, 21 Feb 2020 18:19:27 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-04.nifty.com 01L9JRK8023932 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1582276768; bh=VmuyVpcSR865JyPo0oVfgzMcmXUB4YPWqRffdg846F0=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=k6u9vPdhI6KhWgKFa+85uXqNS1YYMM3fPKwoQ0+mXFsCqC7Qtlm+j6wX6feBp9XGB 1BUxPU3PkoHO0BiRd2yZ2GByfUpx2+NP2NrIFgVObece6IUxFK2PRcUi6twQPO1gfY JBNqel9zTN4MB38yKaZgPGo43xybEJenJCh0+WTcb2kMMpi9ShcEqSpv/q8kJpQ6pE wlvStdWh0o5oQLZD9jkzu7XGI0oUs1yDNxY9A1jlyDo2S3apE1l/wh2hRBM5LlrFYN ElbrhVjxY+Edkw76jlulz1LngNsLOKencNnkq1Bf51eNsfukbttbhAgvjQTyVvfFPY nahV40hzNGuiw== X-Nifty-SrcIP: [209.85.221.174] Received: by mail-vk1-f174.google.com with SMTP id g7so368429vkl.12; Fri, 21 Feb 2020 01:19:27 -0800 (PST) X-Gm-Message-State: APjAAAWy9sTKuYnEvS8CmJyeKKSdIF1Bt+BwDBnqdJx3iumG5f1rqDDw /BzKcPdU3zL045nj9T2LsKOzL5dbqp3Qml6O/hQ= X-Google-Smtp-Source: APXvYqzaz0mPSZK/ntfmxfvFupJ42NyBQt0nUrM/n8cwK4Ehx6Qt0V2MsrTaIIELjQXW5ad1WZ9ao8dfI393Harrrkg= X-Received: by 2002:a1f:72c3:: with SMTP id n186mr16153825vkc.12.1582276766520; Fri, 21 Feb 2020 01:19:26 -0800 (PST) MIME-Version: 1.0 References: <20200216154502.26478-1-masahiroy@kernel.org> In-Reply-To: From: Masahiro Yamada Date: Fri, 21 Feb 2020 18:18:50 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] kbuild: use KBUILD_DEFCONFIG as the fallback for DEFCONFIG_LIST To: Marek Szyprowski Content-Type: text/plain; charset="UTF-8" X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200221_012003_378204_AAF7DE43 X-CRM114-Status: GOOD ( 28.97 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Rich Felker , Linux-sh list , Catalin Marinas , Guo Ren , "H. Peter Anvin" , sparclinux , "open list:SIFIVE DRIVERS" , Vincent Chen , Will Deacon , Anton Ivanov , Yoshinori Sato , Richard Weinberger , X86 ML , Ingo Molnar , Albert Ou , Linux Kbuild mailing list , Jeff Dike , linux-um@lists.infradead.org, Borislav Petkov , Greentime Hu , Paul Walmsley , Thomas Gleixner , "linux-arm-kernel@lists.infradead.org" , Nick Hu , Linux Kernel Mailing List , Palmer Dabbelt , "David S. Miller" Sender: "linux-riscv" Errors-To: linux-riscv-bounces+infradead-linux-riscv=archiver.kernel.org@lists.infradead.org On Fri, Feb 21, 2020 at 5:50 PM Marek Szyprowski wrote: > > Dear All, > > On 16.02.2020 16:45, Masahiro Yamada wrote: > > Most of the Kconfig commands (except defconfig and all*config) read the > > .config file as a base set of CONFIG options. > > > > When it does not exist, the files in DEFCONFIG_LIST are searched in this > > order and loaded if found. > > > > I do not see much sense in the last two entries in DEFCONFIG_LIST. > > > > [1] ARCH_DEFCONFIG > > > > The entry for DEFCONFIG_LIST is guarded by 'depends on !UML'. So, the > > ARCH_DEFCONFIG definition in arch/x86/um/Kconfig is meaningless. > > > > arch/{sh,sparc,x86}/Kconfig define ARCH_DEFCONFIG depending on 32 or 64 > > bit variant symbols. This is a little bit strange; ARCH_DEFCONFIG should > > be a fixed string because the base config file is loaded before the symbol > > evaluation stage. > > > > Using KBUILD_DEFCONFIG is saner because it is fixed before Kconfig is > > invoked. Fortunately, arch/{sh,sparc,x86}/Makefile define it in the > > same way, and it works as expected. Hence, replace ARCH_DEFCONFIG with > > "arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG)". > > > > [2] arch/$(ARCH)/defconfig > > > > This file path is no longer valid. The defconfig files are always located > > in the arch configs/ directories. > > > > $ find arch -name defconfig | sort > > arch/alpha/configs/defconfig > > arch/arm64/configs/defconfig > > arch/csky/configs/defconfig > > arch/nds32/configs/defconfig > > arch/riscv/configs/defconfig > > arch/s390/configs/defconfig > > arch/unicore32/configs/defconfig > > > > The path arch/*/configs/defconfig is already covered by > > "arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG)". So, this file path is > > not necessary. > > > > Signed-off-by: Masahiro Yamada > > This patch landed in today's linux-next (next-20200221) and broke arm64 > builds: > > --->8--- > > $ make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- defconfig > *** Default configuration is based on 'defconfig' > # > # configuration written to .config > # > $ make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- Image.gz > scripts/kconfig/conf --syncconfig Kconfig > scripts/kconfig/conf --syncconfig Kconfig > scripts/kconfig/conf --syncconfig Kconfig > scripts/kconfig/conf --syncconfig Kconfig > scripts/kconfig/conf --syncconfig Kconfig > ... > > (endless loop) > > --->8--- > > Reverting it fixes the issue: My bad. This is because arch/arm64/Makefile does not define KBUILD_DEFCONFIG. I will drop it. Sorry about that. > > --->8--- > > $ git revert cdd5d1a207d6a3a06c9e627a0234d9a6af6ad347 > [detached HEAD 1080d6a13b6d] Revert "kbuild: use KBUILD_DEFCONFIG as the > fallback for DEFCONFIG_LIST" > 5 files changed, 22 insertions(+), 1 deletion(-) > $ make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- defconfig > *** Default configuration is based on 'defconfig' > # > # No change to .config > # > $ make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- Image.gz > scripts/kconfig/conf --syncconfig Kconfig > UPD include/config/kernel.release > UPD include/generated/utsrelease.h > CC scripts/mod/empty.o > ... > > $ aarch64-linux-gnu-gcc --version > aarch64-linux-gnu-gcc (Ubuntu/Linaro 7.4.0-1ubuntu1~18.04.1) 7.4.0 > Copyright (C) 2017 Free Software Foundation, Inc. > This is free software; see the source for copying conditions. There is NO > warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. > --->8--- > > It looks that the issue is similar to the one described here: > > https://patchwork.kernel.org/patch/10453685/ > > I hope this report helps fixing the issue. > > > --- > > > > arch/sh/Kconfig | 5 ----- > > arch/sparc/Kconfig | 5 ----- > > arch/x86/Kconfig | 5 ----- > > arch/x86/um/Kconfig | 5 ----- > > init/Kconfig | 3 +-- > > 5 files changed, 1 insertion(+), 22 deletions(-) > > > > diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig > > index 9ece111b0254..b4f0e37b83eb 100644 > > --- a/arch/sh/Kconfig > > +++ b/arch/sh/Kconfig > > @@ -87,11 +87,6 @@ config SUPERH64 > > select HAVE_EXIT_THREAD > > select KALLSYMS > > > > -config ARCH_DEFCONFIG > > - string > > - default "arch/sh/configs/shx3_defconfig" if SUPERH32 > > - default "arch/sh/configs/cayman_defconfig" if SUPERH64 > > - > > config GENERIC_BUG > > def_bool y > > depends on BUG && SUPERH32 > > diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig > > index c1dd6dd642f4..0de15380d1fc 100644 > > --- a/arch/sparc/Kconfig > > +++ b/arch/sparc/Kconfig > > @@ -95,11 +95,6 @@ config SPARC64 > > select PCI_DOMAINS if PCI > > select ARCH_HAS_GIGANTIC_PAGE > > > > -config ARCH_DEFCONFIG > > - string > > - default "arch/sparc/configs/sparc32_defconfig" if SPARC32 > > - default "arch/sparc/configs/sparc64_defconfig" if SPARC64 > > - > > config ARCH_PROC_KCORE_TEXT > > def_bool y > > > > diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig > > index beea77046f9b..98935f4387f9 100644 > > --- a/arch/x86/Kconfig > > +++ b/arch/x86/Kconfig > > @@ -240,11 +240,6 @@ config OUTPUT_FORMAT > > default "elf32-i386" if X86_32 > > default "elf64-x86-64" if X86_64 > > > > -config ARCH_DEFCONFIG > > - string > > - default "arch/x86/configs/i386_defconfig" if X86_32 > > - default "arch/x86/configs/x86_64_defconfig" if X86_64 > > - > > config LOCKDEP_SUPPORT > > def_bool y > > > > diff --git a/arch/x86/um/Kconfig b/arch/x86/um/Kconfig > > index a8985e1f7432..95d26a69088b 100644 > > --- a/arch/x86/um/Kconfig > > +++ b/arch/x86/um/Kconfig > > @@ -27,11 +27,6 @@ config X86_64 > > def_bool 64BIT > > select MODULES_USE_ELF_RELA > > > > -config ARCH_DEFCONFIG > > - string > > - default "arch/um/configs/i386_defconfig" if X86_32 > > - default "arch/um/configs/x86_64_defconfig" if X86_64 > > - > > config 3_LEVEL_PGTABLES > > bool "Three-level pagetables" if !64BIT > > default 64BIT > > diff --git a/init/Kconfig b/init/Kconfig > > index 452bc1835cd4..6ccdb168dee5 100644 > > --- a/init/Kconfig > > +++ b/init/Kconfig > > @@ -6,8 +6,7 @@ config DEFCONFIG_LIST > > default "/lib/modules/$(shell,uname -r)/.config" > > default "/etc/kernel-config" > > default "/boot/config-$(shell,uname -r)" > > - default ARCH_DEFCONFIG > > - default "arch/$(ARCH)/defconfig" > > + default "arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG)" > > > > config CC_IS_GCC > > def_bool $(success,$(CC) --version | head -n 1 | grep -q gcc) > > Best regards > -- > Marek Szyprowski, PhD > Samsung R&D Institute Poland > -- Best Regards Masahiro Yamada From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F057BC35640 for ; Fri, 21 Feb 2020 09:20:07 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id ACA8620679 for ; Fri, 21 Feb 2020 09:20:07 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="OwU2Rig0"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=nifty.com header.i=@nifty.com header.b="k6u9vPdh" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org ACA8620679 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Vp6H0VVLAcFsbsRqQk4qg8LuotGcTAC1EcUDMd/UAkE=; b=OwU2Rig0xMFAcp lRC+xLGQoT36LAuAjsC+9n3ZBVrmxAINHvwEHEZxKDeoqE0aJmSFwfESG9zn0YeJZ/jk24NnCaI5w qZ1eA4fji2weEvazSj6/S/7avZr2+0+kYeJnWooYjVHdd0jsJLhMIvkZWi8S5ZwhJ3Zf0H6GQA/MN gEdyrivP/RoGGtN2yHXE/PZJvtX5kKx6UKt3b0EfqolpSsbomW37bxBiy3x8RMXawt0hPVDtUYgLw pUGfOz6tUN5/f+MBsBTaCo+EEftEfv8F1mNKUtxzisVMiRtQiijFKcdNQ6NPN8cEGQp79KfLmjFv5 kTLEtWJbZCwrhm6JMn2Q==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1j54Tf-00064L-5M; Fri, 21 Feb 2020 09:20:07 +0000 Received: from conssluserg-04.nifty.com ([210.131.2.83]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1j54Tb-0005Eo-3E; Fri, 21 Feb 2020 09:20:05 +0000 Received: from mail-vk1-f174.google.com (mail-vk1-f174.google.com [209.85.221.174]) (authenticated) by conssluserg-04.nifty.com with ESMTP id 01L9JRK8023932; Fri, 21 Feb 2020 18:19:27 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-04.nifty.com 01L9JRK8023932 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1582276768; bh=VmuyVpcSR865JyPo0oVfgzMcmXUB4YPWqRffdg846F0=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=k6u9vPdhI6KhWgKFa+85uXqNS1YYMM3fPKwoQ0+mXFsCqC7Qtlm+j6wX6feBp9XGB 1BUxPU3PkoHO0BiRd2yZ2GByfUpx2+NP2NrIFgVObece6IUxFK2PRcUi6twQPO1gfY JBNqel9zTN4MB38yKaZgPGo43xybEJenJCh0+WTcb2kMMpi9ShcEqSpv/q8kJpQ6pE wlvStdWh0o5oQLZD9jkzu7XGI0oUs1yDNxY9A1jlyDo2S3apE1l/wh2hRBM5LlrFYN ElbrhVjxY+Edkw76jlulz1LngNsLOKencNnkq1Bf51eNsfukbttbhAgvjQTyVvfFPY nahV40hzNGuiw== X-Nifty-SrcIP: [209.85.221.174] Received: by mail-vk1-f174.google.com with SMTP id g7so368429vkl.12; Fri, 21 Feb 2020 01:19:27 -0800 (PST) X-Gm-Message-State: APjAAAWy9sTKuYnEvS8CmJyeKKSdIF1Bt+BwDBnqdJx3iumG5f1rqDDw /BzKcPdU3zL045nj9T2LsKOzL5dbqp3Qml6O/hQ= X-Google-Smtp-Source: APXvYqzaz0mPSZK/ntfmxfvFupJ42NyBQt0nUrM/n8cwK4Ehx6Qt0V2MsrTaIIELjQXW5ad1WZ9ao8dfI393Harrrkg= X-Received: by 2002:a1f:72c3:: with SMTP id n186mr16153825vkc.12.1582276766520; Fri, 21 Feb 2020 01:19:26 -0800 (PST) MIME-Version: 1.0 References: <20200216154502.26478-1-masahiroy@kernel.org> In-Reply-To: From: Masahiro Yamada Date: Fri, 21 Feb 2020 18:18:50 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] kbuild: use KBUILD_DEFCONFIG as the fallback for DEFCONFIG_LIST To: Marek Szyprowski X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200221_012003_378204_AAF7DE43 X-CRM114-Status: GOOD ( 28.97 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Rich Felker , Linux-sh list , Catalin Marinas , Guo Ren , "H. Peter Anvin" , sparclinux , "open list:SIFIVE DRIVERS" , Vincent Chen , Will Deacon , Anton Ivanov , Yoshinori Sato , Richard Weinberger , X86 ML , Ingo Molnar , Albert Ou , Linux Kbuild mailing list , Jeff Dike , linux-um@lists.infradead.org, Borislav Petkov , Greentime Hu , Paul Walmsley , Thomas Gleixner , "linux-arm-kernel@lists.infradead.org" , Nick Hu , Linux Kernel Mailing List , Palmer Dabbelt , "David S. Miller" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, Feb 21, 2020 at 5:50 PM Marek Szyprowski wrote: > > Dear All, > > On 16.02.2020 16:45, Masahiro Yamada wrote: > > Most of the Kconfig commands (except defconfig and all*config) read the > > .config file as a base set of CONFIG options. > > > > When it does not exist, the files in DEFCONFIG_LIST are searched in this > > order and loaded if found. > > > > I do not see much sense in the last two entries in DEFCONFIG_LIST. > > > > [1] ARCH_DEFCONFIG > > > > The entry for DEFCONFIG_LIST is guarded by 'depends on !UML'. So, the > > ARCH_DEFCONFIG definition in arch/x86/um/Kconfig is meaningless. > > > > arch/{sh,sparc,x86}/Kconfig define ARCH_DEFCONFIG depending on 32 or 64 > > bit variant symbols. This is a little bit strange; ARCH_DEFCONFIG should > > be a fixed string because the base config file is loaded before the symbol > > evaluation stage. > > > > Using KBUILD_DEFCONFIG is saner because it is fixed before Kconfig is > > invoked. Fortunately, arch/{sh,sparc,x86}/Makefile define it in the > > same way, and it works as expected. Hence, replace ARCH_DEFCONFIG with > > "arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG)". > > > > [2] arch/$(ARCH)/defconfig > > > > This file path is no longer valid. The defconfig files are always located > > in the arch configs/ directories. > > > > $ find arch -name defconfig | sort > > arch/alpha/configs/defconfig > > arch/arm64/configs/defconfig > > arch/csky/configs/defconfig > > arch/nds32/configs/defconfig > > arch/riscv/configs/defconfig > > arch/s390/configs/defconfig > > arch/unicore32/configs/defconfig > > > > The path arch/*/configs/defconfig is already covered by > > "arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG)". So, this file path is > > not necessary. > > > > Signed-off-by: Masahiro Yamada > > This patch landed in today's linux-next (next-20200221) and broke arm64 > builds: > > --->8--- > > $ make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- defconfig > *** Default configuration is based on 'defconfig' > # > # configuration written to .config > # > $ make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- Image.gz > scripts/kconfig/conf --syncconfig Kconfig > scripts/kconfig/conf --syncconfig Kconfig > scripts/kconfig/conf --syncconfig Kconfig > scripts/kconfig/conf --syncconfig Kconfig > scripts/kconfig/conf --syncconfig Kconfig > ... > > (endless loop) > > --->8--- > > Reverting it fixes the issue: My bad. This is because arch/arm64/Makefile does not define KBUILD_DEFCONFIG. I will drop it. Sorry about that. > > --->8--- > > $ git revert cdd5d1a207d6a3a06c9e627a0234d9a6af6ad347 > [detached HEAD 1080d6a13b6d] Revert "kbuild: use KBUILD_DEFCONFIG as the > fallback for DEFCONFIG_LIST" > 5 files changed, 22 insertions(+), 1 deletion(-) > $ make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- defconfig > *** Default configuration is based on 'defconfig' > # > # No change to .config > # > $ make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- Image.gz > scripts/kconfig/conf --syncconfig Kconfig > UPD include/config/kernel.release > UPD include/generated/utsrelease.h > CC scripts/mod/empty.o > ... > > $ aarch64-linux-gnu-gcc --version > aarch64-linux-gnu-gcc (Ubuntu/Linaro 7.4.0-1ubuntu1~18.04.1) 7.4.0 > Copyright (C) 2017 Free Software Foundation, Inc. > This is free software; see the source for copying conditions. There is NO > warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. > --->8--- > > It looks that the issue is similar to the one described here: > > https://patchwork.kernel.org/patch/10453685/ > > I hope this report helps fixing the issue. > > > --- > > > > arch/sh/Kconfig | 5 ----- > > arch/sparc/Kconfig | 5 ----- > > arch/x86/Kconfig | 5 ----- > > arch/x86/um/Kconfig | 5 ----- > > init/Kconfig | 3 +-- > > 5 files changed, 1 insertion(+), 22 deletions(-) > > > > diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig > > index 9ece111b0254..b4f0e37b83eb 100644 > > --- a/arch/sh/Kconfig > > +++ b/arch/sh/Kconfig > > @@ -87,11 +87,6 @@ config SUPERH64 > > select HAVE_EXIT_THREAD > > select KALLSYMS > > > > -config ARCH_DEFCONFIG > > - string > > - default "arch/sh/configs/shx3_defconfig" if SUPERH32 > > - default "arch/sh/configs/cayman_defconfig" if SUPERH64 > > - > > config GENERIC_BUG > > def_bool y > > depends on BUG && SUPERH32 > > diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig > > index c1dd6dd642f4..0de15380d1fc 100644 > > --- a/arch/sparc/Kconfig > > +++ b/arch/sparc/Kconfig > > @@ -95,11 +95,6 @@ config SPARC64 > > select PCI_DOMAINS if PCI > > select ARCH_HAS_GIGANTIC_PAGE > > > > -config ARCH_DEFCONFIG > > - string > > - default "arch/sparc/configs/sparc32_defconfig" if SPARC32 > > - default "arch/sparc/configs/sparc64_defconfig" if SPARC64 > > - > > config ARCH_PROC_KCORE_TEXT > > def_bool y > > > > diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig > > index beea77046f9b..98935f4387f9 100644 > > --- a/arch/x86/Kconfig > > +++ b/arch/x86/Kconfig > > @@ -240,11 +240,6 @@ config OUTPUT_FORMAT > > default "elf32-i386" if X86_32 > > default "elf64-x86-64" if X86_64 > > > > -config ARCH_DEFCONFIG > > - string > > - default "arch/x86/configs/i386_defconfig" if X86_32 > > - default "arch/x86/configs/x86_64_defconfig" if X86_64 > > - > > config LOCKDEP_SUPPORT > > def_bool y > > > > diff --git a/arch/x86/um/Kconfig b/arch/x86/um/Kconfig > > index a8985e1f7432..95d26a69088b 100644 > > --- a/arch/x86/um/Kconfig > > +++ b/arch/x86/um/Kconfig > > @@ -27,11 +27,6 @@ config X86_64 > > def_bool 64BIT > > select MODULES_USE_ELF_RELA > > > > -config ARCH_DEFCONFIG > > - string > > - default "arch/um/configs/i386_defconfig" if X86_32 > > - default "arch/um/configs/x86_64_defconfig" if X86_64 > > - > > config 3_LEVEL_PGTABLES > > bool "Three-level pagetables" if !64BIT > > default 64BIT > > diff --git a/init/Kconfig b/init/Kconfig > > index 452bc1835cd4..6ccdb168dee5 100644 > > --- a/init/Kconfig > > +++ b/init/Kconfig > > @@ -6,8 +6,7 @@ config DEFCONFIG_LIST > > default "/lib/modules/$(shell,uname -r)/.config" > > default "/etc/kernel-config" > > default "/boot/config-$(shell,uname -r)" > > - default ARCH_DEFCONFIG > > - default "arch/$(ARCH)/defconfig" > > + default "arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG)" > > > > config CC_IS_GCC > > def_bool $(success,$(CC) --version | head -n 1 | grep -q gcc) > > Best regards > -- > Marek Szyprowski, PhD > Samsung R&D Institute Poland > -- Best Regards Masahiro Yamada _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel