Received: by 10.223.185.116 with SMTP id b49csp500049wrg; Wed, 21 Feb 2018 01:57:35 -0800 (PST) X-Google-Smtp-Source: AH8x22407nIuZiPHDAp7SdSYrttM7nnfNzIQq3UtlMaTQtAi0CAf3SRgIxtdPUYjH4CJ3bzgWf/J X-Received: by 2002:a17:902:40a:: with SMTP id 10-v6mr2621471ple.245.1519207055132; Wed, 21 Feb 2018 01:57:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519207055; cv=none; d=google.com; s=arc-20160816; b=NC0DKSao2R1DfkduRgicPMQBI9ipJbhF1BTfCw94F1CXSYE28n31UA8yYM2bP0w/Ks Hq1xRLIYypOXS4qTQ590o0ojCiaw/7dcv6zSRMHL0FsSDDX48EGQ/ChpnvbopTexKeqI IL81FZMdC1hIfbU/DkfmT8OlwTAC5SUB4KLj9B5UTD+I1i9rBY774BA3Bi21xOLzCObK kf5Ykw/x6mqjN0uWeucsC6uq74OOxu41yHomOgNrD3I8TvERl9W9yTjjojBqZkI9UCiR eet5bms9FPFRGBQR4h6hPCuDg4jUgPiSWuwNPR5yUBK96feQDGxiPff+LhGKcGRoqRkT SAYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=UYl3Z4M4NzIWAW+K+Sl5kmCsn04zVrhGEchfFtkeXbs=; b=ZAIoNffY+rWWaHNmA4xedeRdZZcPhNeL7UB1lsFy+kQ5sIisXdDQx0dc0qqXeRDA5s QrI+8k5g6vrbnU+VID/3OLx6mtskr8rtASBygiwfjLYxqsZ9fvwB2s2/esOEf8nfxmVu iuzxvHbc3DdvYBSYmAIJsJSwd+lHJmNOA9yr3XHJC//TbHZXpuy/Ys4Rijs6HqMW6MMj BYnngn7jjsyqh3/hX/pK0iPuzzpa+tw7FF7nl8JbWe2jNgC5VOqlKMbAXPJMYp4xrQ6f OyWyiBvfltBRg7mpsykMFH5kGa8XsHX60OFWcOkvOO9tPUvyhzILkw9gFBtjNXcCBucn o7IQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=i5RnqzZe; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n79si14186354pfa.148.2018.02.21.01.57.19; Wed, 21 Feb 2018 01:57:35 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=i5RnqzZe; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932653AbeBUJ43 (ORCPT + 99 others); Wed, 21 Feb 2018 04:56:29 -0500 Received: from mail-qk0-f194.google.com ([209.85.220.194]:44632 "EHLO mail-qk0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932612AbeBUJ40 (ORCPT ); Wed, 21 Feb 2018 04:56:26 -0500 Received: by mail-qk0-f194.google.com with SMTP id v124so1174675qkh.11; Wed, 21 Feb 2018 01:56:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=UYl3Z4M4NzIWAW+K+Sl5kmCsn04zVrhGEchfFtkeXbs=; b=i5RnqzZeRwcRBmP5965//TJz10rEDcGKpmOBjhPWxnbc/6gvYlETMhqJMu9SlweoA4 fFhNDmaKHzAcBND90lM7habbtOlG2URisHWi1h2OFCw6op4WZABnFs3Id5U64JF3n7lN 0PGw8HTcsVhulQX2r72CTY9PDuqkzETB6nVqgx0pbNEP6muf0O6AxjxvlJOX+83xX9zw W0TAg++8isoI4y100Sottx4tiA6020U7moyf1wtSTGEp27zNDQ8+6mtuHcO0Mk4Bpfin +/iZtzQMIEXiKbKh48uF619nuYGytx+hNgL0HXB4qzWLkNwjc2SYlTND0DfoYRnC5Nh6 jhBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=UYl3Z4M4NzIWAW+K+Sl5kmCsn04zVrhGEchfFtkeXbs=; b=ZLeo3tNWcz7tjoK++ALw+9kYLslI2Kc5TMd4shcNnuHsH1fZ8JKUsexZcR55XfYdUj urLzoy97ymytoehuPXDCF3NrzG1cZ8C0FG1squ0VHjA1BxNAGcrlHvKEhU4fQ4CHYuUY mejAjTYdmmSkbUJaJu868bhZnRreLWxlIbG6DyNN2T+v7I/ZqzGN0iZyfr6KT44d5bbx YT27ZPyZ6xpBqEZLPZaMrFIy/0LNUClvApwD8WlAMv29ai+2PwzsBGurJWr82seIk6C2 +lKxZc9ymtQ83ToEmeF53smesC1VXZtjiyLgl7OubMfbKSaibpsYWs/GEfegffOeKf6Y /NXQ== X-Gm-Message-State: APf1xPCmlWI0zJ+kbzgEwjo1Bqodv6ECWP7rAdF6+CuefR5rzXbiGFb1 po3WIr78nrHdGQ5gJLA7BMMuF/GC5ZPP7zncr1Q= X-Received: by 10.55.19.76 with SMTP id d73mr4014661qkh.288.1519206985040; Wed, 21 Feb 2018 01:56:25 -0800 (PST) MIME-Version: 1.0 Received: by 10.12.198.17 with HTTP; Wed, 21 Feb 2018 01:56:24 -0800 (PST) In-Reply-To: References: <1518806331-7101-1-git-send-email-yamada.masahiro@socionext.com> <20180218221352.GA6651@ravnborg.org> From: Arnd Bergmann Date: Wed, 21 Feb 2018 10:56:24 +0100 X-Google-Sender-Auth: erArf6J-lT1oLoqdT6TbYVxCaZ4 Message-ID: Subject: Re: [PATCH 00/23] kconfig: move compiler capability tests to Kconfig To: Masahiro Yamada Cc: Ulf Magnusson , Rich Felker , Linux-sh list , Kernel Hardening , Paul Mackerras , "H. Peter Anvin" , sparclinux , Sam Ravnborg , uml-devel , Yoshinori Sato , Jonathan Corbet , X86 ML , Linus Torvalds , Ingo Molnar , Emese Revfy , Kees Cook , Linux Kbuild mailing list , Peter Oberparleiter , Jeff Dike , user-mode-linux-user@lists.sourceforge.net, Thomas Gleixner , Michal Marek , Greg Kroah-Hartman , Randy Dunlap , "open list:DOCUMENTATION" , Linux Kernel Mailing List , Richard Weinberger , linuxppc-dev , "David S. Miller" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Feb 21, 2018 at 8:38 AM, Masahiro Yamada wrote: > 2018-02-20 0:18 GMT+09:00 Ulf Magnusson : > >>> >>> I'm not happy that we in one context can reference CONFIG variables >>> directly, but inside the $(call ...) and $(shell ...) needs the $ prefix. >>> But I could not come up with something un-ambigious where this could be avoided. >> >> I think we should be careful about allowing references to config >> symbols. It mixes up the parsing and evaluation phases, since $() is >> expanded during parsing (which I consider a feature and think is >> needed to retain sanity). >> >> Patch 06/23 removes the last existing instance of symbol references in >> strings by getting rid of 'option env'. That's an improvement to me. >> We shouldn't add it back. > > > This is really important design decision, > so I'd like to hear a little more from experts. > > > For example, x86 allows users to choose sub-arch, either 'i386' or 'x86_64'. > > https://github.com/torvalds/linux/blob/v4.16-rc2/arch/x86/Kconfig#L4 > > > > If the user toggles CONFIG_64BIT, > the bi-arch compiler will work in a slightly different mode > (at least, back-end parts) > > So, my question is, is there a case, > > $(cc-option, -m32 -foo) is y, but > $(cc-option, -m64 -foo) is n ? > (or vice versa) > > > If the answer is yes, $(cc-option -foo) would have to be re-calculated > every time CONFIG_64BIT is toggled. > > This is what I'd like to avoid, though. The -m32/-m64 trick (and -mbig-endian/-mlittle-endian on other architectures as well as a couple of other flags) only works if the compiler is configured to support it. In other cases (e.g. big-endian xtensa), the kernel always detects what the compiler does and silently configures itself to match using Makefile logic. On x86, compilers are usually built as bi-arch, but you can build one that only allows one of them. I can see two reasonable ways out: - we don't use $(cc-option -foo) in a case like this, and instead require the user to have a matching toolchain. - we could make the 32/64 selection on x86 a 'choice' statement where each option depends on both the ARCH= variable and the $(cc-option, -m32)/ $(cc-option, -m64) output. Arnd