Cross Dressing Architecture: Which CPU Do I Wear?
I’m going to make this a quick post because it’s late and I am just trying to get something done… I’m cross compiling a kernel for a small device. The problem is that my work station is an i7 running 64 bit Gentoo. The target is a Via C7 and while I could probably do everything in 64 bit on the device I don’t necessarily want to double my memory register widths on a device that is cramped for memory. Gentoo has an awesome tool called crossdev that automatically built the toolchain for my target device.
The problem now is that I can’t fool make. It knows something is wrong with what I am doing. I even decided to
chroot in to a i686 only environment Make still freaked out that I was being crazy trying to compile code. The error was, “CPU you selected does not support x86-64 instruction set”! I’ve
searched around the internet and no one had
an immediate solution. Of course… I got to thinking… I’ll alter the Makefile to set the arch… changed some uname -m to echo i686’s here some ARCH=${ARCH} to ARCH=i686’s there… Still it wouldn’t compile! Even -m32 didn’t work. Make knew something was up and I realized that the make binary was doing
this check.
The solution was really simple… It’s something I did long ago to compile a 32bit kernel. Most distros ship with arch and setarch. The arch command tells you what you’re running. The setarch command sets your arch to anything you want! I want i686! Everything compiled
great after and we all had tea and scones.