From patchwork Thu May 17 06:16:41 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 10405459 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 416F360230 for ; Thu, 17 May 2018 06:18:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 266C228949 for ; Thu, 17 May 2018 06:18:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1A2A62894F; Thu, 17 May 2018 06:18:53 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 20AD828949 for ; Thu, 17 May 2018 06:18:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751231AbeEQGSv (ORCPT ); Thu, 17 May 2018 02:18:51 -0400 Received: from conuserg-10.nifty.com ([210.131.2.77]:24132 "EHLO conuserg-10.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750815AbeEQGSu (ORCPT ); Thu, 17 May 2018 02:18:50 -0400 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-10.nifty.com with ESMTP id w4H6HbU0002841; Thu, 17 May 2018 15:17:40 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-10.nifty.com w4H6HbU0002841 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1526537860; bh=aSQS3FUJ5e9EiNCD8cynkA8thqQ6GIhoa7wXOMABLyU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sq5USuqomOD497a1nNm2pZIPl3t1VK1mHZUTJT8GoaZz6ctG2PAAsTXrMLMW3vN57 3IvX1w5fYhTal9suKCG4Y6MKZhjCOLrnj3131/aqNqoclTDg8DTtr/56XYc2bQ213U xljVFR9z1Awrkcy8PSGU0JtDHYJQcEgyMsmPRW3JvPvhvN8daC1FKd/pZDjPL2FPKW VTt5BtAMuDyTyTALSlsmKczLCQNUvRhYb3f7QwqDDFnxBO00BCVdL4ag1yy9dkXh55 NC7Q963oH8j76A3I1YFnlmeZRXptOqbfY35OXLLawLXgg1HgdUCxXFlVXmXri8NVTV cwdQGPyh+z7dw== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Linus Torvalds , Sam Ravnborg , Ulf Magnusson , "Luis R . Rodriguez" , linux-kernel@vger.kernel.org, Nicholas Piggin , Kees Cook , Emese Revfy , x86@kernel.org, Masahiro Yamada Subject: [PATCH v4 02/31] kbuild: remove CONFIG_CROSS_COMPILE support Date: Thu, 17 May 2018 15:16:41 +0900 Message-Id: <1526537830-22606-3-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1526537830-22606-1-git-send-email-yamada.masahiro@socionext.com> References: <1526537830-22606-1-git-send-email-yamada.masahiro@socionext.com> Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Kbuild provides a couple of ways to specify CROSS_COMPILE: [1] Command line [2] Environment [3] arch/*/Makefile (only some architectures) [4] CONFIG_CROSS_COMPILE [4] is problematic for the compiler capability tests in Kconfig. CONFIG_CROSS_COMPILE allows users to change the compiler prefix from 'make menuconfig', etc. It means, the compiler options would have to be all re-calculated everytime CONFIG_CROSS_COMPILE is changed. To avoid complexity and performance issues, I'd like to evaluate the shell commands statically, i.e. only parsing Kconfig files. I guess the majority is [1] or [2]. Currently, there are only 5 defconfig files that specify CONFIG_CROSS_COMPILE. arch/arm/configs/lpc18xx_defconfig arch/hexagon/configs/comet_defconfig arch/nds32/configs/defconfig arch/openrisc/configs/or1ksim_defconfig arch/openrisc/configs/simple_smp_defconfig Signed-off-by: Masahiro Yamada Reviewed-by: Kees Cook --- Changes in v4: None Changes in v3: None Changes in v2: None Makefile | 3 --- init/Kconfig | 9 --------- 2 files changed, 12 deletions(-) diff --git a/Makefile b/Makefile index e78f73f..01b2211 100644 --- a/Makefile +++ b/Makefile @@ -316,12 +316,9 @@ SUBARCH := $(shell uname -m | sed -e s/i.86/x86/ -e s/x86_64/x86/ \ # CROSS_COMPILE can be set on the command line # make CROSS_COMPILE=ia64-linux- # Alternatively CROSS_COMPILE can be set in the environment. -# A third alternative is to store a setting in .config so that plain -# "make" in the configured kernel build directory always uses that. # Default value for CROSS_COMPILE is not to prefix executables # Note: Some architectures assign CROSS_COMPILE in their arch/*/Makefile ARCH ?= $(SUBARCH) -CROSS_COMPILE ?= $(CONFIG_CROSS_COMPILE:"%"=%) # Architecture as present in compile.h UTS_MACHINE := $(ARCH) diff --git a/init/Kconfig b/init/Kconfig index f013afc..4537962 100644 --- a/init/Kconfig +++ b/init/Kconfig @@ -54,15 +54,6 @@ config INIT_ENV_ARG_LIMIT Maximum of each of the number of arguments and environment variables passed to init from the kernel command line. - -config CROSS_COMPILE - string "Cross-compiler tool prefix" - help - Same as running 'make CROSS_COMPILE=prefix-' but stored for - default make runs in this kernel build directory. You don't - need to set this unless you want the configured kernel build - directory to select the cross-compiler automatically. - config COMPILE_TEST bool "Compile also drivers which will not load" depends on !UML