2020-08-21 17:24:39

by Alexey Dobriyan

[permalink] [raw]
Subject: make defconfig (Re: + x86-defconfigs-explicitly-unset-config_64bit-in-i386_defconfig.patch added to -mm tree)

On Thu, Aug 20, 2020 at 02:29:40PM -0700, [email protected] wrote:
> Subject: x86/defconfigs: Explicitly unset CONFIG_64BIT in i386_defconfig
>
> A recent refresh of the defconfigs got rid of the following (unset)
> config:
>
> # CONFIG_64BIT is not set
>
> Innocuous as it seems, when the config file is saved again the
> behavior is changed so that CONFIG_64BIT=y.
>
> Currently,
>
> $ make i386_defconfig
> $ grep CONFIG_64BIT .config
> CONFIG_64BIT=y
>
> whereas previously (and with this patch):
>
> $ make i386_defconfig
> $ grep CONFIG_64BIT .config
> # CONFIG_64BIT is not set

It is highly, highly, highly advisable to always pass ARCH when dealing
with 32/64-bit archs:

+---------------------------------------+
| make ARCH=x86_64 defconfig |
| make ARCH=i386 defconfig |
+---------------------------------------+

The reason is that long ago ARCH was deduced from bitness of the system
make was run on, so that

make allnoconfig

gave 32-bit config on 32-but system and 64-bit on 64-bit system which is
natural thing to do.

During i386/x86_64 merge CONFIG_64BIT became user visible option!
" make allnoconfig" started giving 32-bit config even on x86_64 and 64-bit
defconfig and allmodconfig which it does to this day.

Always passing ARCH is the only way to maintain sanity. I have shell
alias to always pass ARCH=x86_64 so that bitness is both deterministic
and can be overridden.


2020-08-21 17:28:22

by Randy Dunlap

[permalink] [raw]
Subject: Re: make defconfig (Re: + x86-defconfigs-explicitly-unset-config_64bit-in-i386_defconfig.patch added to -mm tree)

On 8/21/20 10:22 AM, Alexey Dobriyan wrote:
> On Thu, Aug 20, 2020 at 02:29:40PM -0700, [email protected] wrote:
>> Subject: x86/defconfigs: Explicitly unset CONFIG_64BIT in i386_defconfig
>>
>> A recent refresh of the defconfigs got rid of the following (unset)
>> config:
>>
>> # CONFIG_64BIT is not set
>>
>> Innocuous as it seems, when the config file is saved again the
>> behavior is changed so that CONFIG_64BIT=y.
>>
>> Currently,
>>
>> $ make i386_defconfig
>> $ grep CONFIG_64BIT .config
>> CONFIG_64BIT=y
>>
>> whereas previously (and with this patch):
>>
>> $ make i386_defconfig
>> $ grep CONFIG_64BIT .config
>> # CONFIG_64BIT is not set
>
> It is highly, highly, highly advisable to always pass ARCH when dealing
> with 32/64-bit archs:
>
> +---------------------------------------+
> | make ARCH=x86_64 defconfig |
> | make ARCH=i386 defconfig |
> +---------------------------------------+

I certainly always do that and I also avoid
ARCH=x86
although it is supported/allowed.

--
~Randy

2020-08-21 18:53:43

by Sedat Dilek

[permalink] [raw]
Subject: Re: make defconfig (Re: + x86-defconfigs-explicitly-unset-config_64bit-in-i386_defconfig.patch added to -mm tree)

On Fri, Aug 21, 2020 at 7:27 PM Randy Dunlap <[email protected]> wrote:
>
> On 8/21/20 10:22 AM, Alexey Dobriyan wrote:
> > On Thu, Aug 20, 2020 at 02:29:40PM -0700, [email protected] wrote:
> >> Subject: x86/defconfigs: Explicitly unset CONFIG_64BIT in i386_defconfig
> >>
> >> A recent refresh of the defconfigs got rid of the following (unset)
> >> config:
> >>
> >> # CONFIG_64BIT is not set
> >>
> >> Innocuous as it seems, when the config file is saved again the
> >> behavior is changed so that CONFIG_64BIT=y.
> >>
> >> Currently,
> >>
> >> $ make i386_defconfig
> >> $ grep CONFIG_64BIT .config
> >> CONFIG_64BIT=y
> >>
> >> whereas previously (and with this patch):
> >>
> >> $ make i386_defconfig
> >> $ grep CONFIG_64BIT .config
> >> # CONFIG_64BIT is not set
> >
> > It is highly, highly, highly advisable to always pass ARCH when dealing
> > with 32/64-bit archs:
> >
> > +---------------------------------------+
> > | make ARCH=x86_64 defconfig |
> > | make ARCH=i386 defconfig |
> > +---------------------------------------+
>
> I certainly always do that and I also avoid
> ARCH=x86
> although it is supported/allowed.
>

Unsure, if this already documented - if not - might be good to document it.

While playing with ClangBuiltLinux issue #194 this was not clear to me.

- Sedat -

[1] https://github.com/ClangBuiltLinux/linux/issues/194
[2] https://github.com/ClangBuiltLinux/linux/issues/194#issuecomment-662433916
[3] https://github.com/ClangBuiltLinux/linux/issues/194#issuecomment-662613396
[4] https://github.com/ClangBuiltLinux/linux/issues/194#issuecomment-662620461