# [SOLVED] Kernel cross compilation: no i686 option

## Yttrium

Hello,

i want to compile a kernel on my Core2Duo E6600 (amd64) for an Athlon (i686). I looked into this guide

http://www.gentoo.org/proj/en/base/embedded/handbook/?part=1&chap=6

but I can't find these options in the Makefile for the hardened-2.6.29 sources.

From the command line I can only specify arch=x86 or arch=i386. 

Which one should I use?

make ARCH=x86 CROSS_COMPILE=i686-pc-linux-gnu-

or

make ARCH=i386 CROSS_COMPILE=i686-pc-linux-gnu-

cat /proc/cpuinfo

```
processor       : 0                              

vendor_id       : AuthenticAMD                   

cpu family      : 6                              

model           : 4                              

model name      : AMD Athlon(tm) processor       

stepping        : 2                              

cpu MHz         : 550.051

cache size      : 256 KB

fdiv_bug        : no

hlt_bug         : no

f00f_bug        : no

coma_bug        : no

fpu             : yes

fpu_exception   : yes

cpuid level     : 1

wp              : yes

flags           : fpu vme de pse tsc msr pae mce cx8 mtrr pge mca cmov pat pse36 mmx fxsr syscall mmxext 3dnowext 3dnow up

bogomips        : 1100.10

clflush size    : 32
```

EDIT

In the menuconfig of the kernel I choose Athlon/Duron/K7 without generic x86 support.

----------

## gringo

in case you are running a multilib system and have 32 bit emu support in your kernel its quite simple : ARCH="i386" make foo and you are done, no need to mess around with the CROSS_COMPILE var.

cheers

----------

## Yttrium

Yes on my main computer I use amd64 with multilib support. But the Athlon machine doesn't understand 64 bit. I just want to get the best out of it, so I wonder whether x86 would be better than i386. Does it support both?

And why don't I need the CROSS_COMPILE option? If i told the compiler to use arch=x86 without any cross_compile option selected, how would it know that it shouldn't create x86_64 code?

It's very annoying to test it because I don't have a monitor for the AMD computer. I hope the first compiled kernel will just work instantly.

----------

## gringo

 *Quote:*   

> so I wonder whether x86 would be better than i386

 

arch=i386 doesnt really exist anymore inside the kernel, there is one arch called x86 for 32bit and 64bit x86 based processors. The kernel image you will build will actually always be 32bit, it will only switch to long mode at runtime.

The arch=i386 is a compatibility hack to make people happy by enabling x86_64 users to easily built a 32bit image only.

 *Quote:*   

> And why don't I need the CROSS_COMPILE option?

 

because it is not needed in a working multilib environment : your compiler can build the code natively for 32bit.

 *Quote:*   

> If i told the compiler to use arch=x86 without any cross_compile option selected, how would it know that it shouldn't create x86_64 code? 

 

just use arch=i386 instead of arch=x86.

cheers

----------

## Yttrium

Now I don't need to be "afraid" anymore of wasting perfomance, when using the i386 option for my i686 machine. Thank you for the explanation.

----------

