Probably if you compile – many times – Linux for embedded hardware you change Makefile to your specific architecture and compiler. An example:
# Set the ARCH and CROSS_COMPILE default values ARCH ?= arm CROSS_COMPILE ?= arm-unknown-linux-gnu-
Latest Linux (~2.6.31) turns it deprecated (commit 575543347b5baed0ca927cb90ba8807396fe9cc9). Now the settings are saved in two files named:
include/generated/kernel.arch
include/generated/kernel.cross
What changes?
Using the new way you don’t edit Makefile anymore, just need set once your definitions for cross compiling:
$ make ARCH=arm CROSS_COMPILE=arm-unknown-linux-gnu-
And for next builds just run make
$ make
This works both for plain builds and for O=… builds.