From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:9712 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727912AbgDCJq6 (ORCPT ); Fri, 3 Apr 2020 05:46:58 -0400 Received: from pps.filterd (m0098421.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 0339V5kQ111557 for ; Fri, 3 Apr 2020 05:46:57 -0400 Received: from e06smtp05.uk.ibm.com (e06smtp05.uk.ibm.com [195.75.94.101]) by mx0a-001b2d01.pphosted.com with ESMTP id 305emfstkh-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 03 Apr 2020 05:46:56 -0400 Received: from localhost by e06smtp05.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 3 Apr 2020 10:46:35 +0100 Date: Fri, 3 Apr 2020 11:46:49 +0200 From: Philipp Rudo Subject: Re: [PATCH] kbuild: add dummy toolchains to enable all cc-option etc. in Kconfig In-Reply-To: <20200403090224.24045-1-masahiroy@kernel.org> References: <20200403090224.24045-1-masahiroy@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-Id: <20200403114649.1c1a149f@laptop2-ibm.local> Sender: linux-s390-owner@vger.kernel.org List-ID: To: Masahiro Yamada Cc: linux-kbuild@vger.kernel.org, Jeremy Cline , Heiko Carstens , Vasily Gorbik , linux-s390@vger.kernel.org, Michal Kubecek , linux-kernel@vger.kernel.org Hi Masahiro, On Fri, 3 Apr 2020 18:02:24 +0900 Masahiro Yamada wrote: > Staring v4.18, Kconfig evaluates compiler capabilities, and hides CONFIG > options your compiler does not support. This works well if you configure > and build the kernel on the same host machine. > > It is inconvenient if you prepare the .config that is carried to a > different build environment (typically this happens when you package > the kernel for distros) because using a different compiler potentially > produces different CONFIG options than the real build environment. > So, you probably want to make as many options visible as possible. > In other words, you need to create a super-set of CONFIG options that > cover any build environment. If some of the CONFIG options turned out > to be unsupported on the build machine, they are automatically disabled > by the nature of Kconfig. > > However, it is not feasible to get a full-featured compiler for every > arch. > > This issue was discussed here: > > https://lkml.org/lkml/2019/12/9/620 > > Other than distros, savedefconfig is also a problem. Some arch subsytems > periodically resync defconfig files. If you use a less-capable compiler > for savedefconfig, options that do not meet 'depends on $(cc-option,...)' > will be forcibly disabled. So, defconfig && savedefconfig may silently > change the behavior. > > This commit adds a set of dummy toolchains that pretend to support any > feature. > > Most of compiler features are tested by cc-option, which simply checks > the exit code of $(CC). The dummy tools are just a shell script that > exits with 0 in most cases. So, $(cc-option, ...) is evaluated as 'y'. > > There are more complicated checks such as: > > scripts/gcc-x86_{32,64}-has-stack-protector.sh > scripts/gcc-plugin.sh > scripts/tools-support-relr.sh > > I tried my best to implement the dummy scripts to pass all checks. > > From the top directory of the source tree, you can do: > > $ make CROSS_COMPILE=scripts/dummy-tools/ oldconfig > > Signed-off-by: Masahiro Yamada look good to me Reviewed-by: Philipp Rudo Thanks a lot Philipp