[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20070612091209.760b5225.randy.dunlap@oracle.com>
Date: Tue, 12 Jun 2007 09:12:09 -0700
From: Randy Dunlap <randy.dunlap@...cle.com>
To: Oleg Verych <olecom@...wer.upol.cz>
Cc: Sam Ravnborg <sam@...nborg.org>,
Rusty Russell <rusty@...tcorp.com.au>,
LKML <linux-kernel@...r.kernel.org>,
kbuild-devel@...ts.sourceforge.net
Subject: Re: [patch] kbuild: remember ARCH in the object directory
On Tue, 12 Jun 2007 12:31:56 +0200 Oleg Verych wrote:
> [patch] kbuild: remember ARCH in the object directory
>
> - rephrase some related (misspelled) comments,
> - remove all trailing whitespace in the top Makefile,
>
> * remember ARCH in the output directory, thus making build of i386
> on amd64 *actually* convenient,
>
> - harmless refactoring of the Makefile generating.
>
> Signed-off-by: Oleg Verych <olecom@...wer.upol.cz>
> ---
>
> Just lazy typing `make ARCH=i386` every time i want to check lguest.
>
> Makefile | 17 ++++++++---------
> scripts/mkmakefile | 42 ++++++++++++++++++++++++------------------
> 2 files changed, 32 insertions(+), 27 deletions(-)
I did:
# build a linux-2.6.22-rc4-git4 kernel source tree & cd into it
# mkdir BLD
$ make ARCH=i386 O=BLD defconfig
$ make -j4 O=BLD all >BLD/bld.out 2>&1
and it cried to me:
GEN /scsi/linsrc/linux-2.6.22-rc4-git4/BLD/Makefile
scripts/kconfig/conf -s arch/x86_64/Kconfig
#... many config warning lines
*
* Restart config...
*
*
* Processor type and features
*
Subarchitecture Type
> 1. PC-compatible (X86_PC)
2. Support for ScaleMP vSMP (X86_VSMP) (NEW)
choice[1-2]: aborted!
Console input/output is redirected. Run 'make oldconfig' to update configuration.
make[3]: *** [silentoldconfig] Error 1
make[2]: *** [silentoldconfig] Error 2
make[1]: *** [include/config/auto.conf] Error 2
make: *** [all] Error 2
I.e., see the line above that says:
scripts/kconfig/conf -s arch/x86_64/Kconfig
It defaulted to ARCH=x86_64 even though BLD/Makefile contained:
ARCH = i386
What did I do wrong??
> Index: linux-2.6.22-rc4-mm2/scripts/mkmakefile
> ===================================================================
> --- linux-2.6.22-rc4-mm2.orig/scripts/mkmakefile 2007-06-12 11:21:27.755466250 +0200
> +++ linux-2.6.22-rc4-mm2/scripts/mkmakefile 2007-06-12 12:04:13.675826250 +0200
> @@ -1,6 +1,6 @@
> -#!/bin/sh
> +#!/bin/sh -e
> # Generates a small Makefile used in the root of the output
> -# directory, to allow make to be started from there.
> -# The Makefile also allow for more convinient build of external modules
> +# directory, to allow kernel build to be started from there.
> +# External modules can't built with it as well.
>
> # Usage
> @@ -9,28 +9,34 @@
> # $3 - version
> # $4 - patchlevel
> +# $5 - ARCH
>
> +set -e
>
> -test ! -r $2/Makefile -o -O $2/Makefile || exit 0
> echo " GEN $2/Makefile"
> +echo "#
> +# Automatically generated by
> +# $0
> +#
> +VERSION = $3
> +PATCHLEVEL = $4
> +
> +KERNELSRC = $1
> +KERNELOUTPUT = $2
> +ARCH = $5
> +" >$2/Makefile
>
> -cat << EOF > $2/Makefile
> -# Automatically generated by $0: don't edit
> +cat << "EOF" >> $2/Makefile
> +MAKEFLAGS += -rR --no-print-directory
>
> -VERSION = $3
> -PATCHLEVEL = $4
> +export ARCH
>
> -KERNELSRC := $1
> -KERNELOUTPUT := $2
> -
> -MAKEFLAGS += --no-print-directory
> +all:
> + $(MAKE) -C $(KERNELSRC) O=$(KERNELOUTPUT)
>
> -.PHONY: all \$(MAKECMDGOALS)
> +$(filter-out all Makefile,$(MAKECMDGOALS)) %/:
> + $(MAKE) -C $(KERNELSRC) O=$(KERNELOUTPUT) $@
>
> -all:
> - \$(MAKE) -C \$(KERNELSRC) O=\$(KERNELOUTPUT)
> +.PHONY: all $(MAKECMDGOALS)
>
> Makefile:;
> -
> -\$(filter-out all Makefile,\$(MAKECMDGOALS)) %/:
> - \$(MAKE) -C \$(KERNELSRC) O=\$(KERNELOUTPUT) \$@
> EOF
> Index: linux-2.6.22-rc4-mm2/Makefile
> ===================================================================
> --- linux-2.6.22-rc4-mm2.orig/Makefile 2007-06-12 11:35:20.559513250 +0200
> +++ linux-2.6.22-rc4-mm2/Makefile 2007-06-12 11:51:10.438877000 +0200
> @@ -156,5 +156,5 @@ export srctree objtree VPATH TOPDIR
> # first, and if a usermode build is happening, the "ARCH=um" on the command
> # line overrides the setting of ARCH below. If a native build is happening,
> -# then ARCH is assigned, getting whatever value it gets normally, and
> +# then ARCH is assigned, getting whatever value it gets normally, and
> # SUBARCH is subsequently ignored.
>
> @@ -242,5 +242,5 @@ export KBUILD_CHECKSRC KBUILD_SRC KBUILD
> #
> # If $(quiet) is empty, the whole command will be printed.
> -# If it is set to "quiet_", only the short version will be printed.
> +# If it is set to "quiet_", only the short version will be printed.
> # If it is set to "silent_", nothing will be printed at all, since
> # the variable $(silent_cmd_cc_o_c) doesn't exist.
> @@ -352,11 +352,10 @@ scripts/basic/%: scripts_basic ;
>
> PHONY += outputmakefile
> -# outputmakefile generates a Makefile in the output directory, if using a
> -# separate output directory. This allows convenient use of make in the
> -# output directory.
> outputmakefile:
> +# generate a Makefile in the output directory, if using a
> +# separate output directory; allows convenient use of make there
> ifneq ($(KBUILD_SRC),)
> $(Q)$(CONFIG_SHELL) $(srctree)/scripts/mkmakefile \
> - $(srctree) $(objtree) $(VERSION) $(PATCHLEVEL)
> + $(srctree) $(objtree) $(VERSION) $(PATCHLEVEL) $(ARCH)
> endif
>
> @@ -699,5 +698,5 @@ endef
> cmd_ksym_ld = $(cmd_vmlinux__)
> define rule_ksym_ld
> - :
> + :
> +$(call cmd,vmlinux_version)
> $(call cmd,vmlinux__)
> @@ -750,5 +749,5 @@ endif
> $(Q)rm -f .old_version
>
> -# The actual objects are generated when descending,
> +# The actual objects are generated when descending,
> # make sure no implicit rule kicks in
> $(sort $(vmlinux-init) $(vmlinux-main)) $(vmlinux-lds): $(vmlinux-dirs) ;
> @@ -1454,5 +1453,5 @@ endif
> $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost
>
> -# FIXME Should go into a make.lib or something
> +# FIXME Should go into a make.lib or something
> # ===========================================================================
>
---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists