From: Jaswinder Singh Rajput on
Hello,

I am trying to build 32 bit kernel image on 64-bit machine but after
'make menuconfig' it automatically switches 32-bit to 64-bit.

Is this a BUG or did intentionally.

How can I fix this issue.


..config (before)
#
# Automatically generated make config: don't edit
# Linux kernel version: 2.6.34
# Wed May 26 03:40:31 2010
#
# CONFIG_64BIT is not set
CONFIG_X86_32=y
# CONFIG_X86_64 is not set
CONFIG_X86=y
CONFIG_INSTRUCTION_DECODER=y
CONFIG_OUTPUT_FORMAT="elf32-i386"
CONFIG_ARCH_DEFCONFIG="arch/x86/configs/i386_defconfig"
CONFIG_GENERIC_TIME=y

..config (after 'make menuconfig' on 64-bit box)
#
# Automatically generated make config: don't edit
# Linux kernel version: 2.6.34
# Wed May 26 23:49:18 2010
#
CONFIG_64BIT=y
# CONFIG_X86_32 is not set
CONFIG_X86_64=y
CONFIG_X86=y
CONFIG_INSTRUCTION_DECODER=y
CONFIG_OUTPUT_FORMAT="elf64-x86-64"
CONFIG_ARCH_DEFCONFIG="arch/x86/configs/x86_64_defconfig"
CONFIG_GENERIC_TIME=y

Thanks,
--
Jaswinder Singh.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
From: Rafael J. Wysocki on
On Thursday 27 May 2010, Jaswinder Singh Rajput wrote:
> Hello,
>
> I am trying to build 32 bit kernel image on 64-bit machine but after
> 'make menuconfig' it automatically switches 32-bit to 64-bit.

Try 'linux32 make menuconfig' and 'linux32 make'.

Rafael
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
From: Jaswinder Singh Rajput on
Hello Rafael,

On Thu, May 27, 2010 at 5:43 AM, Rafael J. Wysocki <rjw(a)sisk.pl> wrote:
> On Thursday 27 May 2010, Jaswinder Singh Rajput wrote:
>> Hello,
>>
>> I am trying to build 32 bit kernel image on 64-bit machine but after
>> 'make menuconfig' it automatically switches 32-bit to 64-bit.
>
> Try 'linux32 make menuconfig' and 'linux32 make'.
>

Yes, this works :-)

But I wonder then what is the point/use of CONFIG_X86_32 if compiler
is not listening to it.

Logically compiler should set appropriate flags based on .config settings.

Thanks,
--
Jaswinder Singh.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
From: Américo Wang on
On Thu, May 27, 2010 at 09:39:51AM +0530, Jaswinder Singh Rajput wrote:
>Hello Rafael,
>
>On Thu, May 27, 2010 at 5:43 AM, Rafael J. Wysocki <rjw(a)sisk.pl> wrote:
>> On Thursday 27 May 2010, Jaswinder Singh Rajput wrote:
>>> Hello,
>>>
>>> I am trying to build 32 bit kernel image on 64-bit machine but after
>>> 'make menuconfig' it automatically switches 32-bit to 64-bit.
>>
>> Try 'linux32 make menuconfig' and 'linux32 make'.
>>
>
>Yes, this works :-)


I think 'make ARCH=i386 menuconfig' also works.

>
>But I wonder then what is the point/use of CONFIG_X86_32 if compiler
>is not listening to it.
>
>Logically compiler should set appropriate flags based on .config settings.
>

It's not compiler, it's kbuild, kbuild tries to determine the arch
by 'uname -m'.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
From: Jaswinder Singh Rajput on
On Thu, May 27, 2010 at 10:01 AM, Am�rico Wang <xiyou.wangcong(a)gmail.com> wrote:
> On Thu, May 27, 2010 at 09:39:51AM +0530, Jaswinder Singh Rajput wrote:
>>
>>But I wonder then what is the point/use of CONFIG_X86_32 if compiler
>>is not listening to it.
>>
>>Logically compiler should set appropriate flags based on .config settings.
>>
>
> It's not compiler, it's kbuild, kbuild tries to determine the arch
> by 'uname -m'.
>

Ahh, then kbuild is buggy, kbuild should check .config instead of
'uname -m' and verify from user if it mismatches.

Thanks,
--
Jaswinder Singh.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/