[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [ot]Can I compile a kernel for a P2?



On Fri, Apr 22, 2005 at 09:05:01PM +0200, Oliver Korpilla wrote:
> If you set the CROSS_COMPILE variable to the full path of the gcc executable
> including the prefix, like e.g. CROSS_COMPILE=/opt/gcc-cross/bin/i386-linux-
> (don't forget the trailing dash, the tool names are simply appended to this
> string!), and ARCH to the target arch, ARCH=i386, _and_ have a cross
> toolchain installed, this should compile with no problem. 
> 
> I compiled for a PowerPC (ARCH=ppc) with a toolchain generated for usage in
> a x86 32-bit environment. It was a combination of gcc and glibc. I set
> CROSS_COMPILE and ARCH like above, did "make oldconfig; make zImage" and
> everything went A OK with this setup, so it should clearly run x86_64 -> x86
> . But where to get a cross toolchain from? I generate mine myself, but are
> there any precompiled ones for Debian in special? I don't know. It might be
> simpler to install a chroot, I guess. I did so, was no big deal, runs great
> - the HOWTO explains it clearly.

Since you can run the native i386 compiler, you don't need a cross
compiler, just a chroot 32bit environment.  The only reason for the
variables like ARCH in the first place is to override the detection of
the x86_64 from uname -m which is how the kernel decides the default
ARCH to configure for.  The regular i386 compiler will run and produce
native code after all as long as that is what the kernel is configured
for and hence expects you are fine.

Len



Reply to: