* KBuild problem (or difference) in 2.6.14-rc3
@ 2005-10-10 22:43 Mark Rustad
2005-10-12 16:57 ` Mark Rustad
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Mark Rustad @ 2005-10-10 22:43 UTC (permalink / raw)
To: linux-kernel
I have noticed a change in Kbuild behavior when going from 2.6.13.x
to 2.6.14-rc3. I build kernels with a separate objects directory. It
has been my practice since beginning with 2.6 kernels last year, to
put changed files into the objects directory structure to override an
unmodified source tree. Starting with 2.6.14, I find that Makefiles
in the objects directory structure area not used. I find that source
and Kconfig files do override as they used to, but Makefiles do not.
I don't really know if this new behavior is intended or not, but it
sure messes my kernel build methodology up. It looks to me like the
problem was introduced by changes in scripts/Makefile.build. I think
that this is the change causing me trouble:
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -10,8 +10,11 @@ __build:
# Read .config if it exist, otherwise ignore
-include .config
-include $(if $(wildcard $(obj)/Kbuild), $(obj)/Kbuild, $(obj)/Makefile)
+# The filename Kbuild has precedence over Makefile
+kbuild-dir := $(if $(filter /%,$(src)),$(src),$(srctree)/$(src))
+include $(if $(wildcard $(kbuild-dir)/Kbuild), $(kbuild-dir)/Kbuild,
$(kbuild-dir)/Makefile)
+include scripts/Kbuild.include
include scripts/Makefile.lib
ifdef host-progs
Does anyone know if this change in behavior was intended? I realize
that I may be doing something a little bit unusual, but I have been
doing things this way very successfully since at least 2.6.5.
--
Mark Rustad, MRustad@mac.com
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: KBuild problem (or difference) in 2.6.14-rc3
2005-10-10 22:43 KBuild problem (or difference) in 2.6.14-rc3 Mark Rustad
@ 2005-10-12 16:57 ` Mark Rustad
2005-10-14 14:23 ` [PATCH 2.6.14-rc4] kbuild: once again use Makefiles in obj tree Mark Rustad
2005-10-14 14:28 ` [PATCH 2.6.14-rc4] kbuild: Eliminate build error when KALLSYMS not defined Mark Rustad
2 siblings, 0 replies; 6+ messages in thread
From: Mark Rustad @ 2005-10-12 16:57 UTC (permalink / raw)
To: linux-kernel
I believe that I have found and fixed the problem that I encountered yesterday with Makefiles not being used from the objects directory. I also verified that the same problem exists in 2.6.14-rc4. I believe that the following patch fixes it.
Signed-off-by: Mark Rustad <mrustad@mac.com>
--- a/scripts/Makefile.build 2005-10-11 09:27:42.150471811 -0500
+++ b/scripts/Makefile.build 2005-10-11 11:28:10.748640516 -0500
@@ -12,7 +12,11 @@
# The filename Kbuild has precedence over Makefile
kbuild-dir := $(if $(filter /%,$(src)),$(src),$(srctree)/$(src))
-include $(if $(wildcard $(kbuild-dir)/Kbuild), $(kbuild-dir)/Kbuild, $(kbuild-dir)/Makefile)
+kbuild-inc := $(wildcard $(obj)/Kbuild)
+kbuild-inc := $(if $(kbuild-inc),$(kbuild-inc),$(wildcard $(kbuild-dir)/Kbuild))
+kbuild-inc := $(if $(kbuild-inc),$(kbuild-inc),$(wildcard $(obj)/Makefile))
+kbuild-inc := $(if $(kbuild-inc),$(kbuild-inc),$(kbuild-dir)/Makefile)
+include $(kbuild-inc)
include scripts/Kbuild.include
include scripts/Makefile.lib
--- a/scripts/Makefile.clean 2005-10-11 09:27:42.150471811 -0500
+++ b/scripts/Makefile.clean 2005-10-11 11:28:20.622769436 -0500
@@ -14,7 +14,11 @@
# The filename Kbuild has precedence over Makefile
kbuild-dir := $(if $(filter /%,$(src)),$(src),$(srctree)/$(src))
-include $(if $(wildcard $(kbuild-dir)/Kbuild), $(kbuild-dir)/Kbuild, $(kbuild-dir)/Makefile)
+kbuild-inc := $(wildcard $(obj)/Kbuild)
+kbuild-inc := $(if $(kbuild-inc),$(kbuild-inc),$(wildcard $(kbuild-dir)/Kbuild))
+kbuild-inc := $(if $(kbuild-inc),$(kbuild-inc),$(wildcard $(obj)/Makefile))
+kbuild-inc := $(if $(kbuild-inc),$(kbuild-inc),$(kbuild-dir)/Makefile)
+include $(kbuild-inc)
# Figure out what we need to build from the various variables
# ==========================================================================
I also encountered a build error with 2.6.14-rc4 when CONFIG_KALLSYMS is not defined. The error message in a fragment of the output was:
CC arch/i386/lib/usercopy.o
AR arch/i386/lib/lib.a
/bin/sh: line 1: +@: command not found
make[3]: warning: jobserver unavailable: using -j1. Add `+' to parent make rule.
CHK include/linux/compile.h
The following patch seems to fix it.
Signed-off-by: Mark Rustad <mrustad@mac.com>
--- a/Makefile 2005-10-12 10:42:37.787722969 -0500
+++ b/Makefile 2005-10-12 10:42:58.396913248 -0500
@@ -662,6 +662,7 @@
# Generate System.map and verify that the content is consistent
define rule_vmlinux__
+ :
$(if $(CONFIG_KALLSYMS),,+$(call cmd,vmlinux_version))
$(call cmd,vmlinux__)
--
Mark Rustad, mrustad@mac.com
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 2.6.14-rc4] kbuild: once again use Makefiles in obj tree
2005-10-10 22:43 KBuild problem (or difference) in 2.6.14-rc3 Mark Rustad
2005-10-12 16:57 ` Mark Rustad
@ 2005-10-14 14:23 ` Mark Rustad
2005-10-16 21:15 ` Sam Ravnborg
2005-10-14 14:28 ` [PATCH 2.6.14-rc4] kbuild: Eliminate build error when KALLSYMS not defined Mark Rustad
2 siblings, 1 reply; 6+ messages in thread
From: Mark Rustad @ 2005-10-14 14:23 UTC (permalink / raw)
To: linux-kernel
I believe that I have found and fixed the problem that I encountered earlier this week
with Makefiles not being used from the objects tree as they had been in every 2.6 kernel
I have worked with since 2.6.5. I I view this as a regression in 2.6.14-rc4. I believe
that the following patch fixes it.
--- a/scripts/Makefile.build 2005-10-11 09:27:42.150471811 -0500
+++ b/scripts/Makefile.build 2005-10-11 11:28:10.748640516 -0500
@@ -12,7 +12,11 @@
# The filename Kbuild has precedence over Makefile
kbuild-dir := $(if $(filter /%,$(src)),$(src),$(srctree)/$(src))
-include $(if $(wildcard $(kbuild-dir)/Kbuild), $(kbuild-dir)/Kbuild, $(kbuild-dir)/Makefile)
+kbuild-inc := $(wildcard $(obj)/Kbuild)
+kbuild-inc := $(if $(kbuild-inc),$(kbuild-inc),$(wildcard $(kbuild-dir)/Kbuild))
+kbuild-inc := $(if $(kbuild-inc),$(kbuild-inc),$(wildcard $(obj)/Makefile))
+kbuild-inc := $(if $(kbuild-inc),$(kbuild-inc),$(kbuild-dir)/Makefile)
+include $(kbuild-inc)
include scripts/Kbuild.include
include scripts/Makefile.lib
--- a/scripts/Makefile.clean 2005-10-11 09:27:42.150471811 -0500
+++ b/scripts/Makefile.clean 2005-10-11 11:28:20.622769436 -0500
@@ -14,7 +14,11 @@
# The filename Kbuild has precedence over Makefile
kbuild-dir := $(if $(filter /%,$(src)),$(src),$(srctree)/$(src))
-include $(if $(wildcard $(kbuild-dir)/Kbuild), $(kbuild-dir)/Kbuild, $(kbuild-dir)/Makefile)
+kbuild-inc := $(wildcard $(obj)/Kbuild)
+kbuild-inc := $(if $(kbuild-inc),$(kbuild-inc),$(wildcard $(kbuild-dir)/Kbuild))
+kbuild-inc := $(if $(kbuild-inc),$(kbuild-inc),$(wildcard $(obj)/Makefile))
+kbuild-inc := $(if $(kbuild-inc),$(kbuild-inc),$(kbuild-dir)/Makefile)
+include $(kbuild-inc)
# Figure out what we need to build from the various variables
# ==========================================================================
Signed-off-by: Mark Rustad <mrustad@mac.com>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 2.6.14-rc4] kbuild: once again use Makefiles in obj tree
2005-10-14 14:23 ` [PATCH 2.6.14-rc4] kbuild: once again use Makefiles in obj tree Mark Rustad
@ 2005-10-16 21:15 ` Sam Ravnborg
0 siblings, 0 replies; 6+ messages in thread
From: Sam Ravnborg @ 2005-10-16 21:15 UTC (permalink / raw)
To: Mark Rustad; +Cc: linux-kernel
On Fri, Oct 14, 2005 at 09:23:28AM -0500, Mark Rustad wrote:
> I believe that I have found and fixed the problem that I encountered earlier this week
> with Makefiles not being used from the objects tree as they had been in every 2.6 kernel
> I have worked with since 2.6.5. I I view this as a regression in 2.6.14-rc4. I believe
> that the following patch fixes it.
Hi Mark.
kbuild will not guarantee you way of working in all cases. Therefore no
special implementation will be accepted to try to support it for
specific files.
The changes you point out that breaks your working methodology was added
to fix broken support for external modules.
Sam
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 2.6.14-rc4] kbuild: Eliminate build error when KALLSYMS not defined
2005-10-10 22:43 KBuild problem (or difference) in 2.6.14-rc3 Mark Rustad
2005-10-12 16:57 ` Mark Rustad
2005-10-14 14:23 ` [PATCH 2.6.14-rc4] kbuild: once again use Makefiles in obj tree Mark Rustad
@ 2005-10-14 14:28 ` Mark Rustad
2 siblings, 0 replies; 6+ messages in thread
From: Mark Rustad @ 2005-10-14 14:28 UTC (permalink / raw)
To: linux-kernel
I encountered a build error with 2.6.14-rc4 when CONFIG_KALLSYMS is not defined. The error
message in a fragment of the output was:
CC arch/i386/lib/usercopy.o
AR arch/i386/lib/lib.a
/bin/sh: line 1: +@: command not found
make[3]: warning: jobserver unavailable: using -j1. Add `+' to parent make rule.
CHK include/linux/compile.h
The following patch seems to fix it. I can't say that I really know why, but noticed this
construct elsewhere in the Makefile and it seems to work.
--- a/Makefile 2005-10-12 10:42:37.787722969 -0500
+++ b/Makefile 2005-10-12 10:42:58.396913248 -0500
@@ -662,6 +662,7 @@
# Generate System.map and verify that the content is consistent
define rule_vmlinux__
+ :
$(if $(CONFIG_KALLSYMS),,+$(call cmd,vmlinux_version))
$(call cmd,vmlinux__)
Signed-off-by: Mark Rustad <mrustad@mac.com>
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 2.6.14-rc4] kbuild: once again use Makefiles in obj tree
@ 2005-10-20 15:02 Mark Rustad
0 siblings, 0 replies; 6+ messages in thread
From: Mark Rustad @ 2005-10-20 15:02 UTC (permalink / raw)
To: linux-kernel; +Cc: Sam Ravnborg
This is a re-send of a patch that I mistakenly only sent to Sam. This reflects a simplfication
of an earlier patch to restore the use of Makefiles from the objects tree, which is something
that stopped working somewhere in 2.6.14. The previous patch had extended the behavior for Kbuild
files, whereas this patch does not do that.
Sam,
On 10/16/05 at 11:15 PM Sam Ravnborg <sam@ravnborg.org> wrote:
>On Fri, Oct 14, 2005 at 09:23:28AM -0500, Mark Rustad wrote:
>> I believe that I have found and fixed the problem that I encountered earlier this week
>> with Makefiles not being used from the objects tree as they had been in every 2.6 kernel
>> I have worked with since 2.6.5. I I view this as a regression in 2.6.14-rc4. I believe
>> that the following patch fixes it.
>
>Hi Mark.
>kbuild will not guarantee you way of working in all cases. Therefore no
>special implementation will be accepted to try to support it for
>specific files.
>
>The changes you point out that breaks your working methodology was added
>to fix broken support for external modules.
I tested the (slightly) simplified patch today and it seems fine. So, this checks for Kbuild
files in one place, and Makefile in two, thereby not extending the behavior that Makefiles
had prior to 2.6.14-rc* to Kbuild files.
Below is the patch I tried today. Please consider it.
This patch restores behavior that the build system had up through 2.6.13.
That is, that Makefiles present in the objects tree are used in favor of
those in the source tree when an objects tree is in use.
This patch does not extend that behavior for Kbuild files.
Signed-off-by: Mark Rustad <mrustad@mac.com>
---
--- a/scripts/Makefile.build 2005-10-11 09:27:42.000000000 -0500
+++ b/scripts/Makefile.build 2005-10-18 09:11:22.042672607 -0500
@@ -12,7 +12,10 @@ __build:
# The filename Kbuild has precedence over Makefile
kbuild-dir := $(if $(filter /%,$(src)),$(src),$(srctree)/$(src))
-include $(if $(wildcard $(kbuild-dir)/Kbuild), $(kbuild-dir)/Kbuild, $(kbuild-dir)/Makefile)
+kbuild-inc := $(wildcard $(kbuild-dir)/Kbuild)
+kbuild-inc := $(if $(kbuild-inc),$(kbuild-inc),$(wildcard $(obj)/Makefile))
+kbuild-inc := $(if $(kbuild-inc),$(kbuild-inc),$(kbuild-dir)/Makefile)
+include $(kbuild-inc)
include scripts/Kbuild.include
include scripts/Makefile.lib
--- a/scripts/Makefile.clean 2005-10-11 09:27:42.000000000 -0500
+++ b/scripts/Makefile.clean 2005-10-18 09:11:44.165706089 -0500
@@ -14,7 +14,10 @@ clean := -f $(if $(KBUILD_SRC),$(srctree
# The filename Kbuild has precedence over Makefile
kbuild-dir := $(if $(filter /%,$(src)),$(src),$(srctree)/$(src))
-include $(if $(wildcard $(kbuild-dir)/Kbuild), $(kbuild-dir)/Kbuild, $(kbuild-dir)/Makefile)
+kbuild-inc := $(wildcard $(kbuild-dir)/Kbuild)
+kbuild-inc := $(if $(kbuild-inc),$(kbuild-inc),$(wildcard $(obj)/Makefile))
+kbuild-inc := $(if $(kbuild-inc),$(kbuild-inc),$(kbuild-dir)/Makefile)
+include $(kbuild-inc)
# Figure out what we need to build from the various variables
# ==========================================================================
--
Mark Rustad, mrustad@mac.com
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2005-10-20 15:02 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-10-10 22:43 KBuild problem (or difference) in 2.6.14-rc3 Mark Rustad
2005-10-12 16:57 ` Mark Rustad
2005-10-14 14:23 ` [PATCH 2.6.14-rc4] kbuild: once again use Makefiles in obj tree Mark Rustad
2005-10-16 21:15 ` Sam Ravnborg
2005-10-14 14:28 ` [PATCH 2.6.14-rc4] kbuild: Eliminate build error when KALLSYMS not defined Mark Rustad
2005-10-20 15:02 [PATCH 2.6.14-rc4] kbuild: once again use Makefiles in obj tree Mark Rustad
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®