Hi,
I am running Debian Lenny on AMD X2 64-bit Dual Core processor.
Code:
Linux debian 2.6.26 #1 SMP Thu Oct 9 17:33:13 PDT 2008 x86_64 GNU/Linux
Now I am trying to compile a 2.6.26 kernel (32-bit kernel) for a 32-bit machine (target machine) on my current 64-bit machine (i.e. cross-compiling) but I am getting error when I run make-kpkg:
Code:
debian:/usr/src/linux-2.6.27# fakeroot make-kpkg --initrd --arch i386 kernel_image kernel_headers
exec debian/rules DEBIAN_REVISION=2.6.27-10.00.Custom KPKG_ARCH=i386 INITRD=YES kernel_image kernel_headers
dpkg-architecture: warning: Specified GNU system type i486-linux-gnu does not match gcc system type x86_64-linux-gnu.
dpkg-architecture: warning: Specified GNU system type i486-linux-gnu does not match gcc system type x86_64-linux-gnu.
dpkg-architecture: warning: Specified GNU system type i486-linux-gnu does not match gcc system type x86_64-linux-gnu.
dpkg-architecture: warning: Specified GNU system type i486-linux-gnu does not match gcc system type x86_64-linux-gnu.
====== making target CONFIG-common [new prereqs: testdir]======
====== making target CONFIG-common [new prereqs: stamp-conf]======
This is kernel package version 11.001-0.1.
====== making stamp-arch-conf because of ======
====== making target CONFIG-arch [new prereqs: stamp-arch-conf]======
====== making conf.vars because of Makefile .config ======
/usr/src/linux-2.6.27/scripts/gcc-version.sh: line 25: i486-linux-gnu-gcc: command not found
/usr/src/linux-2.6.27/scripts/gcc-version.sh: line 26: i486-linux-gnu-gcc: command not found
make[1]: i486-linux-gnu-gcc: Command not found
====== making target CONFIG-arch [new prereqs: .config conf.vars]======
This is kernel package version 11.001-0.1.
====== making target CONFIG/linux-headers-2.6.27 [new prereqs: CONFIG-arch]======
====== making target CONFIG/linux-image-2.6.27 [new prereqs: CONFIG-arch]======
====== making target CONFIG/linux-uml-2.6.27 [new prereqs: CONFIG-arch]======
====== making target CONFIG/linux-xen0-2.6.27 [new prereqs: CONFIG-arch]======
====== making target CONFIG/linux-xenu-2.6.27 [new prereqs: CONFIG-arch]======
====== making stamp-configure-arch because of ======
====== making target configure-arch [new prereqs: stamp-configure-arch]======
====== making stamp-indep-conf because of ======
====== making target CONFIG-indep [new prereqs: stamp-indep-conf]======
====== making target debian/stamp-kernel-conf [new prereqs: .config Makefile]======
/usr/bin/make CROSS_COMPILE=i486-linux-gnu- ARCH=i386 \
oldconfig
make[1]: Entering directory `/usr/src/linux-2.6.27'
scripts/kconfig/conf -o arch/x86/Kconfig
#
# configuration written to .config
#
make[1]: Leaving directory `/usr/src/linux-2.6.27'
/usr/bin/make CROSS_COMPILE=i486-linux-gnu- ARCH=i386 prepare
/usr/src/linux-2.6.27/scripts/gcc-version.sh: line 25: i486-linux-gnu-gcc: command not found
/usr/src/linux-2.6.27/scripts/gcc-version.sh: line 26: i486-linux-gnu-gcc: command not found
make[1]: i486-linux-gnu-gcc: Command not found
make[1]: Entering directory `/usr/src/linux-2.6.27'
scripts/kconfig/conf -s arch/x86/Kconfig
make[1]: Leaving directory `/usr/src/linux-2.6.27'
/usr/src/linux-2.6.27/scripts/gcc-version.sh: line 25: i486-linux-gnu-gcc: command not found
/usr/src/linux-2.6.27/scripts/gcc-version.sh: line 26: i486-linux-gnu-gcc: command not found
make[1]: i486-linux-gnu-gcc: Command not found
make[1]: Entering directory `/usr/src/linux-2.6.27'
CHK include/linux/version.h
CHK include/linux/utsrelease.h
CC kernel/bounds.s
/bin/sh: i486-linux-gnu-gcc: command not found
make[2]: *** [kernel/bounds.s] Error 127
make[1]: *** [prepare0] Error 2
make[1]: Leaving directory `/usr/src/linux-2.6.27'
make: *** [debian/stamp-kernel-conf] Error 2
debian:/usr/src/linux-2.6.27#
So basically I am getting errors like:
Code:
make[1]: i486-linux-gnu-gcc: Command not found
As per "man make-kpkg":
Code:
--arch foo
This is useful for setting the architecture when you are cross compiling. If you are not cross compiling, the architecture is determined automatically. The
same effect can be achieved by setting the environment variable KPKG_ARCH. The value should be whatever DEB_HOST_ARCH_CPU contains when dpkg-architecture is
run on the target machine, or it can be an other architecture in a multi-arch set (like i386/amd64).
On searching for "i486-linux-gnu-gcc" I
found that the package that needs to be installed is gcc which is already installed on my system.
How do I resolve this issue?
EDIT Here is the
solution.