lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20091012210804.GA4267@merkur.ravnborg.org>
Date:	Mon, 12 Oct 2009 23:08:04 +0200
From:	Sam Ravnborg <sam@...nborg.org>
To:	Ingo Molnar <mingo@...e.hu>
Cc:	Linus Torvalds <torvalds@...ux-foundation.org>,
	linux-kernel@...r.kernel.org,
	Peter Zijlstra <a.p.zijlstra@...llo.nl>,
	"Rafael J. Wysocki" <rjw@...k.pl>
Subject: Re: [regressions] Re: kbuild: save ARCH & CROSS_COMPILE when
	building a kernel

> > 
> > The patch in question is reverted in my next push to Linus.
> 
> Thanks! Mind sending the fix/revert here too, so that we can test 
> whether that resolves all the problems?

Here it is.
I intended to send it out before sending pull request to Linus but I forgot.

	Sam

commit 2331d1a6cd3d6e580bc88b9a160066d9e1177fe1
Author: Sam Ravnborg <sam@...nborg.org>
Date:   Sun Oct 11 23:22:58 2009 +0200

    kbuild: revert "save ARCH & CROSS_COMPILE ..."
    
    Revert commit 575543347b5baed0ca927cb90ba8807396fe9cc9
    
    It caused following issues:
    
    - On architectures where ARCH= setting is used to select between
      32 and 64 bit this was no longer possible without "make mrproper"
    - If ARCH was changed then kbuild refused to run "make mrproper"
      because ARCH had changed
    - When CROSS_COMPILE was changed people were asked to run "make mrproper"
      but kbuild refused to run "make mrproper" because CROSS_COMPILE changed.
    - Spaces in CROSS_COMPILE was not 'supported'
    - If an non-existing ARCH= was used kbuild could get stuck
    
    Lessons learned:
    . Despite being simple and straghtforward people uses very different
      approaches when building the kernel.
    
    . CROSS_COMPILE is sometimes used for ccache despite cache being
      only a CC frontend so one would have expected CC to be
      used for this purpose.
    
    . And obviously this was not tested widely enough.
    
    Signed-off-by: Sam Ravnborg <sam@...nborg.org>
    Cc: Pavel Machek <pavel@....cz>
    Cc: Ingo Molnar <mingo@...e.hu>
    Cc: Peter Zijlstra <peterz@...radead.org>
    Cc: Andrew Morton <akpm@...ux-foundation.org>

diff --git a/Makefile b/Makefile
index e50569a..8e5aaee 100644
--- a/Makefile
+++ b/Makefile
@@ -179,46 +179,9 @@ SUBARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ \
 # Alternatively CROSS_COMPILE can be set in the environment.
 # Default value for CROSS_COMPILE is not to prefix executables
 # Note: Some architectures assign CROSS_COMPILE in their arch/*/Makefile
-#
-# To force ARCH and CROSS_COMPILE settings include kernel.* files
-# in the kernel tree - do not patch this file.
 export KBUILD_BUILDHOST := $(SUBARCH)
-
-# Kbuild save the ARCH and CROSS_COMPILE setting in kernel.* files.
-# Restore these settings and check that user did not specify
-# conflicting values.
-
-saved_arch  := $(shell cat include/generated/kernel.arch  2> /dev/null)
-saved_cross := $(shell cat include/generated/kernel.cross 2> /dev/null)
-
-ifneq ($(CROSS_COMPILE),)
-        ifneq ($(saved_cross),)
-                ifneq ($(CROSS_COMPILE),$(saved_cross))
-                        $(error CROSS_COMPILE changed from \
-                                "$(saved_cross)" to \
-                                 to "$(CROSS_COMPILE)". \
-                                 Use "make mrproper" to fix it up)
-                endif
-        endif
-else
-    CROSS_COMPILE := $(saved_cross)
-endif
-
-ifneq ($(ARCH),)
-        ifneq ($(saved_arch),)
-                ifneq ($(saved_arch),$(ARCH))
-                        $(error ARCH changed from \
-                                "$(saved_arch)" to "$(ARCH)". \
-                                 Use "make mrproper" to fix it up)
-                endif
-        endif
-else
-        ifneq ($(saved_arch),)
-                ARCH := $(saved_arch)
-        else
-                ARCH := $(SUBARCH)
-        endif
-endif
+ARCH		?= $(SUBARCH)
+CROSS_COMPILE	?=
 
 # Architecture as present in compile.h
 UTS_MACHINE 	:= $(ARCH)
@@ -483,11 +446,6 @@ ifeq ($(config-targets),1)
 include $(srctree)/arch/$(SRCARCH)/Makefile
 export KBUILD_DEFCONFIG KBUILD_KCONFIG
 
-# save ARCH & CROSS_COMPILE settings
-$(shell mkdir -p include/generated &&                            \
-        echo $(ARCH)          > include/generated/kernel.arch && \
-        echo $(CROSS_COMPILE) > include/generated/kernel.cross)
-
 config: scripts_basic outputmakefile FORCE
 	$(Q)mkdir -p include/linux include/config
 	$(Q)$(MAKE) $(build)=scripts/kconfig $@
--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ