diff mbox series

[v2,1/3] kbuild: use 'include' directive to load auto.conf from top Makefile

Message ID 1529762169-13488-1-git-send-email-yamada.masahiro@socionext.com
State Superseded
Headers show
Series [v2,1/3] kbuild: use 'include' directive to load auto.conf from top Makefile | expand

Commit Message

Masahiro Yamada June 23, 2018, 1:56 p.m. UTC
When you build targets that require the kernel configuration, dot-config
is set to 1, then the top-level Makefile includes auto.conf.  However,
Make considers its inclusion is optional because the '-include' directive
is used.

If a necessary configuration file is missing for the external module
building, the following error message is displayed:

  ERROR: Kernel configuration is invalid.
         include/generated/autoconf.h or include/config/auto.conf are missing.
         Run 'make oldconfig && make prepare' on kernel src to fix it.

However, Make still continues building; /bin/false let the creation of
'include/config/auto.config' fail, but Make can ignore the error since
it is included by the '-include' directive.

Use the 'include' directive instead.  This allows the /bin/false
to correctly terminate the whole build process.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

---

Changes in v2:
  - New patch

 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

-- 
2.7.4

Comments

kernel test robot June 23, 2018, 6:59 p.m. UTC | #1
Hi Masahiro,

I love your patch! Yet something to improve:

[auto build test ERROR on kbuild/for-next]
[also build test ERROR on v4.18-rc1 next-20180622]
[cannot apply to mmarek/for-next mmarek/rc-fixes]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Masahiro-Yamada/kbuild-use-include-directive-to-load-auto-conf-from-top-Makefile/20180623-220114
base:   https://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild.git for-next
config: xtensa-nommu_kc705_defconfig (attached as .config)
compiler: xtensa-de212-elf-gcc (crosstool-NG crosstool-ng-1.23.0-307-g452ee331) 7.3.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        GCC_VERSION=7.3.0 make.cross ARCH=xtensa 

All errors (new ones prefixed by >>):

>> Makefile:592: include/config/auto.conf: No such file or directory

   drivers/staging/mt7621-dts/Kconfig:4:warning: 'BUILTIN_DTB' has wrong type. 'select' only accept arguments of bool and tristate type
   <stdin>:1332:2: warning: #warning syscall io_pgetevents not implemented [-Wcpp]
   <stdin>:1335:2: warning: #warning syscall rseq not implemented [-Wcpp]

vim +592 Makefile

   590	
   591	ifeq ($(dot-config),1)
 > 592	include include/config/auto.conf

   593	endif
   594	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
Masahiro Yamada June 24, 2018, 8:56 a.m. UTC | #2
Hi.

2018-06-24 3:59 GMT+09:00 kbuild test robot <lkp@intel.com>:
> Hi Masahiro,

>

> I love your patch! Yet something to improve:

>

> [auto build test ERROR on kbuild/for-next]

> [also build test ERROR on v4.18-rc1 next-20180622]

> [cannot apply to mmarek/for-next mmarek/rc-fixes]

> [if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

>

> url:    https://github.com/0day-ci/linux/commits/Masahiro-Yamada/kbuild-use-include-directive-to-load-auto-conf-from-top-Makefile/20180623-220114

> base:   https://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild.git for-next

> config: xtensa-nommu_kc705_defconfig (attached as .config)

> compiler: xtensa-de212-elf-gcc (crosstool-NG crosstool-ng-1.23.0-307-g452ee331) 7.3.0

> reproduce:

>         wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross

>         chmod +x ~/bin/make.cross

>         # save the attached .config to linux build tree

>         GCC_VERSION=7.3.0 make.cross ARCH=xtensa


This did not work for me
because the make.cross script tries to download GCC 7.3.0 xtensa-linux
but it is missing in the web site.

$ GCC_VERSION=7.3.0 make.cross ARCH=xtensa
Cannot find xtensa-linux under
https://download.01.org/0day-ci/cross-package check
/tmp/crosstool-files


I installed xtensa-de212-elf-gcc by hand,
but I could not reproduce the error.


GCC_VERSION=7.2.0 make.cross ARCH=xtensa
worked, but I could not reproduce the issue either.
(the build terminated with a different error.)


Where can I see the full build log?


> All errors (new ones prefixed by >>):

>

>>> Makefile:592: include/config/auto.conf: No such file or directory

>    drivers/staging/mt7621-dts/Kconfig:4:warning: 'BUILTIN_DTB' has wrong type. 'select' only accept arguments of bool and tristate type

>    <stdin>:1332:2: warning: #warning syscall io_pgetevents not implemented [-Wcpp]

>    <stdin>:1335:2: warning: #warning syscall rseq not implemented [-Wcpp]

>

> vim +592 Makefile

>

>    590

>    591  ifeq ($(dot-config),1)

>  > 592  include include/config/auto.conf

>    593  endif

>    594

>

> ---

> 0-DAY kernel test infrastructure                Open Source Technology Center

> https://lists.01.org/pipermail/kbuild-all                   Intel Corporation




-- 
Best Regards
Masahiro Yamada
Philip Li June 24, 2018, 10:35 a.m. UTC | #3
On Sun, Jun 24, 2018 at 05:56:24PM +0900, Masahiro Yamada wrote:
> Hi.

> 

> 2018-06-24 3:59 GMT+09:00 kbuild test robot <lkp@intel.com>:

> > Hi Masahiro,

> >

> > I love your patch! Yet something to improve:

> >

> > [auto build test ERROR on kbuild/for-next]

> > [also build test ERROR on v4.18-rc1 next-20180622]

> > [cannot apply to mmarek/for-next mmarek/rc-fixes]

> > [if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

> >

> > url:    https://github.com/0day-ci/linux/commits/Masahiro-Yamada/kbuild-use-include-directive-to-load-auto-conf-from-top-Makefile/20180623-220114

> > base:   https://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild.git for-next

> > config: xtensa-nommu_kc705_defconfig (attached as .config)

> > compiler: xtensa-de212-elf-gcc (crosstool-NG crosstool-ng-1.23.0-307-g452ee331) 7.3.0

> > reproduce:

> >         wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross

> >         chmod +x ~/bin/make.cross

> >         # save the attached .config to linux build tree

> >         GCC_VERSION=7.3.0 make.cross ARCH=xtensa

> 

> This did not work for me

> because the make.cross script tries to download GCC 7.3.0 xtensa-linux

> but it is missing in the web site.

> 

> $ GCC_VERSION=7.3.0 make.cross ARCH=xtensa

> Cannot find xtensa-linux under

> https://download.01.org/0day-ci/cross-package check

> /tmp/crosstool-files

thanks for info, we will fix it as early as possible, and
reproduce the issue to provide feedback later.

> 

> 

> I installed xtensa-de212-elf-gcc by hand,

> but I could not reproduce the error.

> 

> 

> GCC_VERSION=7.2.0 make.cross ARCH=xtensa

> worked, but I could not reproduce the issue either.

> (the build terminated with a different error.)

> 

> 

> Where can I see the full build log?

> 

> 

> > All errors (new ones prefixed by >>):

> >

> >>> Makefile:592: include/config/auto.conf: No such file or directory

> >    drivers/staging/mt7621-dts/Kconfig:4:warning: 'BUILTIN_DTB' has wrong type. 'select' only accept arguments of bool and tristate type

> >    <stdin>:1332:2: warning: #warning syscall io_pgetevents not implemented [-Wcpp]

> >    <stdin>:1335:2: warning: #warning syscall rseq not implemented [-Wcpp]

> >

> > vim +592 Makefile

> >

> >    590

> >    591  ifeq ($(dot-config),1)

> >  > 592  include include/config/auto.conf

> >    593  endif

> >    594

> >

> > ---

> > 0-DAY kernel test infrastructure                Open Source Technology Center

> > https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

> 

> 

> 

> -- 

> Best Regards

> Masahiro Yamada

> _______________________________________________

> kbuild-all mailing list

> kbuild-all@lists.01.org

> https://lists.01.org/mailman/listinfo/kbuild-all
Masahiro Yamada June 28, 2018, 1:39 p.m. UTC | #4
2018-06-24 3:59 GMT+09:00 kbuild test robot <lkp@intel.com>:
> Hi Masahiro,

>

> I love your patch! Yet something to improve:

>

> [auto build test ERROR on kbuild/for-next]

> [also build test ERROR on v4.18-rc1 next-20180622]

> [cannot apply to mmarek/for-next mmarek/rc-fixes]

> [if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

>

> url:    https://github.com/0day-ci/linux/commits/Masahiro-Yamada/kbuild-use-include-directive-to-load-auto-conf-from-top-Makefile/20180623-220114

> base:   https://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild.git for-next

> config: xtensa-nommu_kc705_defconfig (attached as .config)

> compiler: xtensa-de212-elf-gcc (crosstool-NG crosstool-ng-1.23.0-307-g452ee331) 7.3.0

> reproduce:

>         wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross

>         chmod +x ~/bin/make.cross

>         # save the attached .config to linux build tree

>         GCC_VERSION=7.3.0 make.cross ARCH=xtensa

>

> All errors (new ones prefixed by >>):

>

>>> Makefile:592: include/config/auto.conf: No such file or directory



I was able to reproduce this.


This depends on the version of GNU Make.

The warning is displayed if you use GNU Make 4.1 or older.
No more annoying warning is displayed for GNU Make 4.2 or later.

Probably, this commit in GNU Make:

commit 87a5f98d248fe63fe6e3e53ee3e1b1b1fa5e49dc
Author: Paul Smith <psmith@gnu.org>
Date:   Sat Apr 9 19:49:27 2016 -0400

    [SV 102] Don't show unnecessary include file errors.


However, 4.2 is quite new.  I will do something with it.


Thanks.






>    drivers/staging/mt7621-dts/Kconfig:4:warning: 'BUILTIN_DTB' has wrong type. 'select' only accept arguments of bool and tristate type

>    <stdin>:1332:2: warning: #warning syscall io_pgetevents not implemented [-Wcpp]

>    <stdin>:1335:2: warning: #warning syscall rseq not implemented [-Wcpp]

>

> vim +592 Makefile

>

>    590

>    591  ifeq ($(dot-config),1)

>  > 592  include include/config/auto.conf

>    593  endif

>    594

>

> ---

> 0-DAY kernel test infrastructure                Open Source Technology Center

> https://lists.01.org/pipermail/kbuild-all                   Intel Corporation




-- 
Best Regards
Masahiro Yamada
diff mbox series

Patch

diff --git a/Makefile b/Makefile
index ca2af1a..413c2ed 100644
--- a/Makefile
+++ b/Makefile
@@ -589,7 +589,7 @@  virt-y		:= virt/
 endif # KBUILD_EXTMOD
 
 ifeq ($(dot-config),1)
--include include/config/auto.conf
+include include/config/auto.conf
 endif
 
 # The all: target is the default when no target is given on the