From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from cantor2.suse.de ([195.135.220.15]:37677 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751346Ab1LJO1M (ORCPT ); Sat, 10 Dec 2011 09:27:12 -0500 Message-ID: <4EE36C43.2040508@suse.cz> Date: Sat, 10 Dec 2011 15:27:15 +0100 From: Michal Marek MIME-Version: 1.0 Subject: Re: Rewriting kernel config after generation References: <20111202053342.GA13877@p183.telecom.by> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sender: linux-kbuild-owner@vger.kernel.org List-ID: To: Alexey Dobriyan Cc: sam@ravnborg.org, linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org On 6.12.2011 12:45, Alexey Dobriyan wrote: > On Fri, Dec 2, 2011 at 7:33 AM, Alexey Dobriyan wrote: >> I'm trying to add compiling with -march=native to the kernel. >> The problem is that then some config options become discoverable at >> the beginning of the compilation. For example, >> CONFIG_X86_L1_CACHE_SHIFT=6 can be derived from "--param l1-cache-line-size=64". >> I suspect this is no-go, because all the dependency logic must be >> duplicated somewhere else (in the march=native script) for the above >> to work. >> >> Is there any cleaner way I'm missing? >> >> In theory, such script could even turn off CONFIG_CPU_SUP_AMD >> if it detects Intel CPU. > > Hrph, this is harder than it looks because "silentoldconfig" is done at > the beginning rewriting whatever changes done to .config by hand. :-( X86_L1_CACHE_SHIFT has no prompt, so it cannot be modified by the user. You would need to add a prompt if you want to modify it, e.g. config X86_L1_CACHE_SHIFT int prompt "..." if X86_MARCH_NATIVE But I wonder why is this needed. To build for the native cpu, you only need to detect what cpu you are running and select the matching processor family. The x86 Kconfig/Makefile will then take care of setting the right kconfig options and the right -march= parameter for gcc. Michal