2003-09-04 09:52:13

by Stephan von Krawczynski

[permalink] [raw]
Subject: Compiling an i386 kernel on AMD Opteron

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


2003-09-04 10:15:23

by Mikael Pettersson

[permalink] [raw]
Subject: Re: Compiling an i386 kernel on AMD Opteron

Stephan von Krawczynski writes:
> 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.

2003-09-04 17:24:26

by Stephan von Krawczynski

[permalink] [raw]
Subject: Re: Compiling an i386 kernel on AMD Opteron

On Thu, 4 Sep 2003 12:15:17 +0200
Mikael Pettersson <[email protected]> wrote:

> Stephan von Krawczynski writes:
> > 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

2003-09-04 18:52:42

by Mikael Pettersson

[permalink] [raw]
Subject: Re: Compiling an i386 kernel on AMD Opteron

Stephan von Krawczynski writes:
> On Thu, 4 Sep 2003 12:15:17 +0200
> Mikael Pettersson <[email protected]> wrote:
>
> > Stephan von Krawczynski writes:
> > > 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?

Not if you're running a 32-bit kernel on the Opteron, but your statement above,
> > > 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?