Skip to content
Commit 57554334 authored by Sam Ravnborg's avatar Sam Ravnborg
Browse files

kbuild: save ARCH & CROSS_COMPILE when building a kernel



When building a kernel for a different architecture
kbuild requires the user always to specify ARCH and
CROSS_COMPILE on the command-line.

We use the asm symlink to detect if user forgets to
specify the correct ARCH value - but that symlink
is about to die. And we do now want to loose this check.

This patch save the settings of ARCH and CROSS_COMPILE
in two files named:

    include/generated/kernel.arch
    include/generated/kernel.cross

The settings are saved during "make *config" time
and always read.

If user try to change the settings we error out.

This works both for plain builds and for O=...
builds.

So now you can do:
$ mkdir sparc64
$ make O=sparc64 ARCH=sparc64 CROSS_COMPILE=sparc64-linux- defconfig
$ cd sparc64
$ make

Notice that you no longer need to tell kbuild
the settings of ARCH and CROSS_COMPILE when you type make
in the output directory.

Likewise for plain builds where you do not use O=...

Signed-off-by: default avatarSam Ravnborg <sam@ravnborg.org>
Cc: Roland McGrath <roland@redhat.com>
parent caa27b66
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment