Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp2190141pxb; Sat, 21 Nov 2020 12:14:19 -0800 (PST) X-Google-Smtp-Source: ABdhPJwtg6k/LyNtwcTE+c0CbSCcr3IabitwhnZa+x9BAg0fI0AM8I7wo5iDO1zsG+m5g5Bofik5 X-Received: by 2002:a17:906:13d2:: with SMTP id g18mr19419336ejc.76.1605989659658; Sat, 21 Nov 2020 12:14:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605989659; cv=none; d=google.com; s=arc-20160816; b=JjP8LUrWYHxQ4PYIYamS+NoBWZJr7+JHSKo1dihWtlOE8wadac/r40GZ4QKtXZ8KAq pSd31j0putJaUeh9OVnxARBlHwpGLVotkH+TsZWNf9ggLn1wyagt3+MEFFAmmyeth082 EoPmX8QuBzza5SHlPeB28Ms8ovJMTyr6YspCXfBGWgKYC854SDicF+1QKmu8YcmrIfWs EsKSHIp9R0b+y+pr4CWeywxLtAeU9Uh9MrNWAo1/ApscppYUbaXa95NV7bujyKjM/fUs Dlwa3E/B28UMG1FRHdiisYnFMTUHN33UzwOs1TmaWqBINsvrTlqjYBGetdhkxLyp09uD O+Hg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=2E/G1+BC++eqc5/VVuVWg3zAaLSLEIJOC7i/xjg7VSs=; b=gw2A+Z+uqpLvnb7AM5dUOs4VpnLwYE+OjrxvO027Am5T4I5bl0uohc2gSNaRrShaLz WeFGvpyO1BYZkarCvhDVk6K8ZEylYiBD6/i9s8ES+IwRm966WJi6zi4Hz49XZ7chfM21 eLa3kBcqG8ow6KFoesQEVxRPpwd0aJTmHin5ATBsYGwmYVB6Hf4xpjKujjv211Ql2U5R bf2Yl5T9kEV4m26Ix2963I+taKSkQgPCJCCtUgzjrTkD+bobgd3Omvbof25pj3Zd0YGo Z/Gxvp7oRXYJy5idGczupBY2L/rcMB9JCeNtTwb2N50ZZIcRwcAuGP9tRxvYRok9Cz5J zitA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=d6GrwcPv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r26si4407329ejb.597.2020.11.21.12.13.56; Sat, 21 Nov 2020 12:14:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=d6GrwcPv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728456AbgKUUL3 (ORCPT + 99 others); Sat, 21 Nov 2020 15:11:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52296 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728441AbgKUUL2 (ORCPT ); Sat, 21 Nov 2020 15:11:28 -0500 Received: from mail-pg1-x541.google.com (mail-pg1-x541.google.com [IPv6:2607:f8b0:4864:20::541]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2953FC061A4B for ; Sat, 21 Nov 2020 12:11:28 -0800 (PST) Received: by mail-pg1-x541.google.com with SMTP id t21so10499584pgl.3 for ; Sat, 21 Nov 2020 12:11:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=2E/G1+BC++eqc5/VVuVWg3zAaLSLEIJOC7i/xjg7VSs=; b=d6GrwcPvUVOPqv9gOqNrM/bSP2HBSSL4qRmWjJIA4m3hlxWzzEj5T+lfuVhxoorPwR NB2BxSopAcepiomrLE56aIQhqr6iGtiFG6DXeV6iIvBvUM0uetc94YKKaGPVURg9KuKK wPaVmZ+dITTlnTfMDAnpXhgP+pbbnBqLxnBaU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=2E/G1+BC++eqc5/VVuVWg3zAaLSLEIJOC7i/xjg7VSs=; b=bp+LFRODz43kAz1aTZJvq9NzZGYyetJf1q6sOxpQ9kLOhOFAAH3uWkSITuthrWoSR9 zM+CQY5o6n+mAaNs0fnJDHtFX3Kw5f+Ebgtl36F/RdxwDAXTPPp/SrTTl22JMTmqJmSt N17TilkWK5mSlQF9owYaKpMLg+Igl95WMRKKbelrCKjJkBrry2Xq8ITVVlFoZusAhSC3 OmVi13MVfmg1fxk+e81HpeXMyDnXQ8122njizxDYsPuicfF01XWHEc7UpHzdhRRjno07 P7SHMI2/3NBivcI5Qbg7iPUpVGY8YsBtVHqa+VLIA18neqNZKRTCBV2AVqYKFM++AumY hBVA== X-Gm-Message-State: AOAM5333NYdRJeH3db5cm225uSviFQPngLOOpfpQMKFZy5vyeS2rz4eQ B7Z0X5iXV7LpAsnZ4C2HMj0xyw== X-Received: by 2002:a17:90a:f406:: with SMTP id ch6mr15105294pjb.134.1605989487549; Sat, 21 Nov 2020 12:11:27 -0800 (PST) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id y10sm8724624pjm.34.2020.11.21.12.11.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 21 Nov 2020 12:11:26 -0800 (PST) Date: Sat, 21 Nov 2020 12:11:25 -0800 From: Kees Cook To: Sami Tolvanen Cc: Nathan Chancellor , Nick Desaulniers , Masahiro Yamada , Steven Rostedt , Will Deacon , Josh Poimboeuf , Peter Zijlstra , Greg Kroah-Hartman , "Paul E. McKenney" , clang-built-linux , Kernel Hardening , linux-arch , Linux ARM , Linux Kbuild mailing list , LKML , linux-pci@vger.kernel.org Subject: Re: [PATCH v7 02/17] kbuild: add support for Clang LTO Message-ID: <202011211204.211E2B12@keescook> References: <20201118220731.925424-1-samitolvanen@google.com> <20201118220731.925424-3-samitolvanen@google.com> <202011201144.3F2BB70C@keescook> <20201120202935.GA1220359@ubuntu-m3-large-x86> <202011201241.B159562D7@keescook> <202011201556.3B910EF@keescook> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Nov 20, 2020 at 05:46:44PM -0800, Sami Tolvanen wrote: > Sure, this looks good to me, I'll use this in v8. The only minor > concern I have is that ThinLTO cannot be set as the default LTO mode, > but I assume anyone who selects LTO is also capable of deciding which > mode is better for them. It could be re-arranged similar to what you had before, but like: config LTO bool "..." depends on HAS_LTO help ... choice prompt "LTO mode" if LTO default LTO_GCC if HAS_LTO_GCC default LTO_CLANG_THIN if HAS_LTO_CLANG default LTO_CLANG_FULL help ... config LTO_CLANG_THIN ... config LTO_CLANG_FULL endchoice Then the LTO is top-level yes/no, but depends on detected capabilities, and the mode is visible if LTO is chosen, etc. I'm not really sure which is better... > > +config LTO_CLANG_THIN > > + bool "Clang ThinLTO (EXPERIMENTAL)" > > + depends on ARCH_SUPPORTS_LTO_CLANG_THIN > > + select LTO_CLANG > > + help > > + This option enables Clang's ThinLTO, which allows for parallel > > + optimization and faster incremental compiles compared to the > > + CONFIG_LTO_CLANG_FULL option. More information can be found > > + from Clang's documentation: > > + > > + https://clang.llvm.org/docs/ThinLTO.html > > + > > + If unsure, say Y. > > endchoice > > The two LTO_CLANG_* options need to depend on HAS_LTO_CLANG, of course. Whoops, yes. Thanks for catching that. :) -- Kees Cook