Skip to contentSkip to conversation

Compiling an i386 kernel on AMD Opteron

DISCUSSION Stephan von Krawczynski 2 participants 4 messages Sep 4, 2003

lore
Share & tools
lore
#0 lore raw

Hello,

is it possible to compile a kernel on Opteron for i386 (32-bit) and not 64 bit Opteron with usual make procedures?

When I do a simple "make menuconfig" I can only see the Opteron processor type in "Processor type and features" ...

Regards,
Stephan

#1 lore raw
Quoted 7 lines · Stephan von Krawczynski

Hello,

is it possible to compile a kernel on Opteron for i386 (32-bit) and not 64 bit Opteron with usual make procedures?

When I do a simple "make menuconfig" I can only see the Opteron processor type in "Processor type and features" ...

You need to learn about cross-compilation.

make ARCH=i386

is the first step for you. Most people doing this also have cross-compilation tool sets (compilers, linkers, libcs etc), and the CROSS_COMPILE= make variable can be set to pick those up.

E.g., I do
make ARCH=x86_64 CROSS_COMPILE=x86_64-unknown-linux- or
make ARCH=ppc CROSS_COMPILE=ppc-unknown-linux- when building x86-64 or ppc32 kernels on an i386 host.

Your x86-64 gcc should be able to generate 32-bit binaries using the -m32 flag, so something like make ARCH=i386 CFLAGS=-m32 might work.

#2 lore raw
Quoted 10 lines · On Thu, 4 Sep 2003 12:15:17 +0200 Mikael Pettersson <[email protected]> wrote:
Quoted 7 lines · Stephan von Krawczynski

Hello,

is it possible to compile a kernel on Opteron for i386 (32-bit) and not 64 bit Opteron with usual make procedures?

When I do a simple "make menuconfig" I can only see the Opteron processor type in "Processor type and features" ...

You need to learn about cross-compilation.

Do you really call it cross-compilation if you are working on a 32-bit linux (Opteron driven) and try to compile a new kernel for the very same box?

I guess it should indeed be possible to recognise that at least opterons are able to support multiple platforms. That's why I think one should be able to select them at menuconfig rather than via make options. Sure this processor is somehow unique, on the other hand you are as well able to compile for 386 on a P4. I know this is not really comparable but it points roughly in the same direction...

Regards,
Stephan

#3 lore raw
Quoted 9 lines · Stephan von Krawczynski
Quoted 6 lines · On Thu, 4 Sep 2003 12:15:17 +0200 Mikael Pettersson <[email protected]> wrote:
Quoted 5 lines · Stephan von Krawczynski

Hello,

is it possible to compile a kernel on Opteron for i386 (32-bit) and not 64 bit Opteron with usual make procedures?

Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

When I do a simple "make menuconfig" I can only see the Opteron processor type in "Processor type and features" ...

You need to learn about cross-compilation.

Do you really call it cross-compilation if you are working on a 32-bit linux (Opteron driven) and try to compile a new kernel for the very same box?

Not if you're running a 32-bit kernel on the Opteron, but your statement above,

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

When I do a simple "make menuconfig" I can only see the Opteron processor type in "Processor type and features" ...

indicated (to me at least) that you were running a 64-bit kernel.

What does `uname -m' say?

make mrproper and try again?