2018-07-08 06:36:21

by Bernd Edlinger

[permalink] [raw]
Subject: [PATCH] Fix the oldconfig target rule

The next make after an oldconfig reads in the outdated
include/config/auto.conf which can kill the make before
it is able to call the syncconfig target.

$ make defconfig
*** Default configuration is based on 'x86_64_defconfig'
$ make
scripts/kconfig/conf --syncconfig Kconfig
Makefile:936: *** "Cannot generate ORC metadata for CONFIG_UNWINDER_ORC=y,
please install libelf-dev, libelf-devel or elfutils-libelf-devel". Stop.

$ sed -i s/CONFIG_UNWINDER_ORC=y// .configs
$ make oldconfig
Choose kernel unwinder
> 1. ORC unwinder (UNWINDER_ORC) (NEW)
2. Frame pointer unwinder (UNWINDER_FRAME_POINTER)
choice[1-2?]: 2
$ make
Makefile:936: *** "Cannot generate ORC metadata for CONFIG_UNWINDER_ORC=y,
please install libelf-dev, libelf-devel or elfutils-libelf-devel". Stop.

With this patch oldconfig and similar targets like
menuconfig call syncconfig to avoid this failure.

Signed-off-by: Bernd Edlinger <[email protected]>
---
scripts/kconfig/Makefile | 1 +
1 file changed, 1 insertion(+)

diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile
index a3ac2c9..ef34275 100644
--- a/scripts/kconfig/Makefile
+++ b/scripts/kconfig/Makefile
@@ -62,6 +62,7 @@ PHONY += $(simple-targets)

$(simple-targets): $(obj)/conf
$< $(silent) --$@ $(Kconfig)
+ $(Q)$(MAKE) -f $(srctree)/Makefile syncconfig

PHONY += oldnoconfig silentoldconfig savedefconfig defconfig

--
1.9.1


2018-07-08 08:10:41

by Bernd Edlinger

[permalink] [raw]
Subject: Re: [PATCH] Fix the oldconfig target rule

On 07/08/18 08:31, Bernd Edlinger wrote:
> The next make after an oldconfig reads in the outdated
> include/config/auto.conf which can kill the make before
> it is able to call the syncconfig target.
>
> $ make defconfig
> *** Default configuration is based on 'x86_64_defconfig'
> $ make
> scripts/kconfig/conf  --syncconfig Kconfig
> Makefile:936: *** "Cannot generate ORC metadata for CONFIG_UNWINDER_ORC=y,
> please install libelf-dev, libelf-devel or elfutils-libelf-devel".  Stop.
>
> $ sed -i s/CONFIG_UNWINDER_ORC=y// .configs
> $ make oldconfig
> Choose kernel unwinder
>> 1. ORC unwinder (UNWINDER_ORC) (NEW)
>   2. Frame pointer unwinder (UNWINDER_FRAME_POINTER)
> choice[1-2?]: 2
> $ make
> Makefile:936: *** "Cannot generate ORC metadata for CONFIG_UNWINDER_ORC=y,
> please install libelf-dev, libelf-devel or elfutils-libelf-devel".  Stop.
>
> With this patch oldconfig and similar targets like
> menuconfig call syncconfig to avoid this failure.
>
> Signed-off-by: Bernd Edlinger <[email protected]>
> ---
>  scripts/kconfig/Makefile | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile
> index a3ac2c9..ef34275 100644
> --- a/scripts/kconfig/Makefile
> +++ b/scripts/kconfig/Makefile
> @@ -62,6 +62,7 @@ PHONY += $(simple-targets)
>
>  $(simple-targets): $(obj)/conf
>      $< $(silent) --$@ $(Kconfig)
> +    $(Q)$(MAKE) -f $(srctree)/Makefile syncconfig

On second thought, removing the auto.conf might be sufficient:
$(Q)rm -f include/config/auto.conf include/config/auto.conf.cmd

Would you prefer that?


>
>  PHONY += oldnoconfig silentoldconfig savedefconfig defconfig
>

2018-07-08 10:44:02

by Masahiro Yamada

[permalink] [raw]
Subject: Re: [PATCH] Fix the oldconfig target rule

2018-07-08 17:09 GMT+09:00 Bernd Edlinger <[email protected]>:
> On 07/08/18 08:31, Bernd Edlinger wrote:
>> The next make after an oldconfig reads in the outdated
>> include/config/auto.conf which can kill the make before
>> it is able to call the syncconfig target.
>>
>> $ make defconfig
>> *** Default configuration is based on 'x86_64_defconfig'
>> $ make
>> scripts/kconfig/conf --syncconfig Kconfig
>> Makefile:936: *** "Cannot generate ORC metadata for CONFIG_UNWINDER_ORC=y,
>> please install libelf-dev, libelf-devel or elfutils-libelf-devel". Stop.
>>
>> $ sed -i s/CONFIG_UNWINDER_ORC=y// .configs
>> $ make oldconfig
>> Choose kernel unwinder
>>> 1. ORC unwinder (UNWINDER_ORC) (NEW)
>> 2. Frame pointer unwinder (UNWINDER_FRAME_POINTER)
>> choice[1-2?]: 2
>> $ make
>> Makefile:936: *** "Cannot generate ORC metadata for CONFIG_UNWINDER_ORC=y,
>> please install libelf-dev, libelf-devel or elfutils-libelf-devel". Stop.
>>
>> With this patch oldconfig and similar targets like
>> menuconfig call syncconfig to avoid this failure.
>>
>> Signed-off-by: Bernd Edlinger <[email protected]>
>> ---
>> scripts/kconfig/Makefile | 1 +
>> 1 file changed, 1 insertion(+)
>>
>> diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile
>> index a3ac2c9..ef34275 100644
>> --- a/scripts/kconfig/Makefile
>> +++ b/scripts/kconfig/Makefile
>> @@ -62,6 +62,7 @@ PHONY += $(simple-targets)
>>
>> $(simple-targets): $(obj)/conf
>> $< $(silent) --$@ $(Kconfig)
>> + $(Q)$(MAKE) -f $(srctree)/Makefile syncconfig
>
> On second thought, removing the auto.conf might be sufficient:
> $(Q)rm -f include/config/auto.conf include/config/auto.conf.cmd
>
> Would you prefer that?

No.

My suggestion is this:
https://patchwork.kernel.org/patch/10513065/






--
Best Regards
Masahiro Yamada

2018-07-08 11:14:21

by Bernd Edlinger

[permalink] [raw]
Subject: Re: [PATCH] Fix the oldconfig target rule

On 07/08/18 12:41, Masahiro Yamada wrote:
> 2018-07-08 17:09 GMT+09:00 Bernd Edlinger <[email protected]>:
>> On 07/08/18 08:31, Bernd Edlinger wrote:
>>> The next make after an oldconfig reads in the outdated
>>> include/config/auto.conf which can kill the make before
>>> it is able to call the syncconfig target.
>>>
>>> $ make defconfig
>>> *** Default configuration is based on 'x86_64_defconfig'
>>> $ make
>>> scripts/kconfig/conf --syncconfig Kconfig
>>> Makefile:936: *** "Cannot generate ORC metadata for CONFIG_UNWINDER_ORC=y,
>>> please install libelf-dev, libelf-devel or elfutils-libelf-devel". Stop.
>>>
>>> $ sed -i s/CONFIG_UNWINDER_ORC=y// .configs
>>> $ make oldconfig
>>> Choose kernel unwinder
>>>> 1. ORC unwinder (UNWINDER_ORC) (NEW)
>>> 2. Frame pointer unwinder (UNWINDER_FRAME_POINTER)
>>> choice[1-2?]: 2
>>> $ make
>>> Makefile:936: *** "Cannot generate ORC metadata for CONFIG_UNWINDER_ORC=y,
>>> please install libelf-dev, libelf-devel or elfutils-libelf-devel". Stop.
>>>
>>> With this patch oldconfig and similar targets like
>>> menuconfig call syncconfig to avoid this failure.
>>>
>>> Signed-off-by: Bernd Edlinger <[email protected]>
>>> ---
>>> scripts/kconfig/Makefile | 1 +
>>> 1 file changed, 1 insertion(+)
>>>
>>> diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile
>>> index a3ac2c9..ef34275 100644
>>> --- a/scripts/kconfig/Makefile
>>> +++ b/scripts/kconfig/Makefile
>>> @@ -62,6 +62,7 @@ PHONY += $(simple-targets)
>>>
>>> $(simple-targets): $(obj)/conf
>>> $< $(silent) --$@ $(Kconfig)
>>> + $(Q)$(MAKE) -f $(srctree)/Makefile syncconfig
>>
>> On second thought, removing the auto.conf might be sufficient:
>> $(Q)rm -f include/config/auto.conf include/config/auto.conf.cmd
>>
>> Would you prefer that?
>
> No.
>
> My suggestion is this:
> https://patchwork.kernel.org/patch/10513065/
>
>

Ok, thanks a lot.

I tried your patch and it seems reasonable me.
(nit: In the change log entry s/RETPORINE/RETPOLINE/)

However the warning is gone as well, which was probably done
on purpose to push people to install the elf library.

I wonder in general if the test using HOSTCC misses
somehow the possibility that there may be a CROSS_COMPLILE ?


Bernd.