[Nix-dev] Re: bootstrap tools for i686 can't build 2.6.28 kernel headers

Michael Cashwell mboards at prograde.net
Mon Jan 10 18:08:21 CET 2011


Peter Simons <simons <at> cryp.to> writes:

> it appears that the bootstrap tools for i686 come with version
> 3.82 of GNU Make. That version won't compile Linux 2.6.28,
> because the kernel makefiles mix implicit and normal rules. As a
> result, I can no longer bootstrap, because I need those old
> kernel headers to build glibc 2.5. Curiously enough, this problem
> doesn't seem to occur on x86_64.

I've hit this with several bootstrap tools I build. Here's the patch I use for
2.6.28.6 which should be close to what you are using.

# fix older linux kernels when building using new(er) version of make to avoid:
# Makefile:442: *** mixed implicit and normal rules.  Stop.
# see <http://blog.gmane.org/gmane.comp.gnu.make.bugs/month=20081201>
# The problem is that we did stuff like this:
#
# config %config: ...
# 
# The solution was simple - the above was split into two with identical
# prerequisites and commands.
diff -Nurp linux-2.6.28.6/Makefile linux-2.6.28.6-mod/Makefile
--- linux-2.6.28.6/Makefile	2009-02-17 12:29:27.000000000 -0500
+++ linux-2.6.28.6-mod/Makefile	2011-01-10 11:59:25.000000000 -0500
@@ -439,7 +439,11 @@ ifeq ($(config-targets),1)
 include $(srctree)/arch/$(SRCARCH)/Makefile
 export KBUILD_DEFCONFIG KBUILD_KCONFIG
 
-config %config: scripts_basic outputmakefile FORCE
+config: scripts_basic outputmakefile FORCE
+	$(Q)mkdir -p include/linux include/config
+	$(Q)$(MAKE) $(build)=scripts/kconfig $@
+
+%config: scripts_basic outputmakefile FORCE
 	$(Q)mkdir -p include/linux include/config
 	$(Q)$(MAKE) $(build)=scripts/kconfig $@
 
@@ -1604,7 +1608,11 @@ endif
 	$(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
 
 # Modules
-/ %/: prepare scripts FORCE
+/: prepare scripts FORCE
+	$(cmd_crmodverdir)
+	$(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1) \
+	$(build)=$(build-dir)
+%/: prepare scripts FORCE
 	$(cmd_crmodverdir)
 	$(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1) \
 	$(build)=$(build-dir)





More information about the nix-dev mailing list