[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 10:11:12AM +0200, Lorenzo Milesi wrote:
> > A bit off topic but...
> > 
> > Can I compile a 2.4.26 kernel for a Pentium2 on my Amd64?
> 
> I can compile a kernel for my i386 pxa255 on an amd64, so yeah I think
> you can manage a p2 just the same.  setting ARCH and CC to the right
> values should take care of it.  Just treat it as a cross compile.
> make-kpkg can do it.
> 
> ie:
> ARCH=i386 CC=i386-linux-gcc CROSS_COMPILE=i386-linux KPKG_ARCH=i386
> make-kpkg --append_to_version my-kernel--revision 3 --bzimage kernel_image

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.

With kind regards,
Oliver Korpilla

-- 
+++ NEU: GMX DSL_Flatrate! Schon ab 14,99 EUR/Monat! +++

GMX Garantie: Surfen ohne Tempo-Limit! http://www.gmx.net/de/go/dsl



Reply to: