Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp1565569pxb; Fri, 20 Nov 2020 12:45:00 -0800 (PST) X-Google-Smtp-Source: ABdhPJyNNfbVu5tjHYP5mIJ8UOxW9yo7bDxj3cakv0I7tltV05VdxLMgukTWE+F0ADlZBzEYDWLT X-Received: by 2002:a17:906:1b09:: with SMTP id o9mr36098746ejg.79.1605905099948; Fri, 20 Nov 2020 12:44:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605905099; cv=none; d=google.com; s=arc-20160816; b=e/Uojx7X1o2hjKmR4XsQrVVWFo5uTk8iQ4CulW1V4LLjJmI0NQB0zICLhP4+S0lQ16 kpoHXgqVyLZy1YwWYRt0NkEGR1AzcYMar8IrGR9C87jSuMWMrfDlcM37evxKTU1WfwIl X/j+CZLw6L4mdkpyDUUrgLj3ZE315y8xyNb803GpCOYFJeoa9jyp1bMg9Dp3j3KaVmdj DCcvVjtqL2Il8TGhcepzoYdFYjapHLgzmjPkMgZvMqgC70obpf/IDQZRdF86LD2hto/R rZEgPqX54WcqobL/KM79GcWbZRsWMKQlLNtRsiuaac7gafdCM6tO/3/TYA67yyZMP6MC 122w== 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=i55oAU3/0ChRWnSy8Vy2lsf5/3oQQZ1SpwWH7R5fDAQ=; b=AwBMVcEJkcBdzl37IaqBUAGjeW9T5F544x7IM75ShuBr4vcmhF8/I8xSgtCsxOBnSz xQ+ENSzK/8m7NDjEjeh4DijTGKYen56mHPnWodj4uocDbByo1q7C42JP5WV9u1b9oGg7 +R89HNFlCtJ5GioxAqFZ4FHP6N1+IXHjJJEQ3l+XFvADbvj4zI2I6IvKF/JyIfyUEuhG A5CDKU3WIqUIK1P5c1i7oSgohP/u0WcyvDa/cUzkfRSl9LXHL5V7X5XlWZDtEhwTgQpO 0RvDKMY6qSmGGikZ8a3E59Bt3cbyC4qjdoV5sdZcTFbrtRO7QP3vQi/tUnGOJ/YBmCP0 f+7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=GpFB8JoF; 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 i11si3203496edb.323.2020.11.20.12.44.37; Fri, 20 Nov 2020 12:44:59 -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=GpFB8JoF; 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 S1728923AbgKTUnS (ORCPT + 99 others); Fri, 20 Nov 2020 15:43:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34056 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728928AbgKTUnR (ORCPT ); Fri, 20 Nov 2020 15:43:17 -0500 Received: from mail-pg1-x544.google.com (mail-pg1-x544.google.com [IPv6:2607:f8b0:4864:20::544]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0EEA6C0613CF for ; Fri, 20 Nov 2020 12:43:17 -0800 (PST) Received: by mail-pg1-x544.google.com with SMTP id 62so8296481pgg.12 for ; Fri, 20 Nov 2020 12:43:17 -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=i55oAU3/0ChRWnSy8Vy2lsf5/3oQQZ1SpwWH7R5fDAQ=; b=GpFB8JoFYlzs5IPt1A4zHefiujfDAb4Aupd2Gt8XWPGlHwTgyLSPZ69lnmpG8AcDUI P5TQWbT45S+7ZLN8NYpqb8spc1x7xM2RTsvR4yoBcsZ8FoV3W56Xp36fdQTbZm5G+EPS 8sdwQfqqqLt9BxwKajipmRGH3q24bpLwIUoOI= 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=i55oAU3/0ChRWnSy8Vy2lsf5/3oQQZ1SpwWH7R5fDAQ=; b=Fao8tXakWPvk6n01Uu0P38d+88AaOwkmpKw5+YNZY6gWyCJ32/OtNNvPOWkZ8tcZVG JqdbJMI37+4M0KC5PKi4lJ88M0tbC/dl+le87xcLvqyph02KljIR51OY/izqltuqqPgv 7cXMWzUBO+qe0qpDLngrL0AQVmGfCjzMGbPEKGWaL5R9Nr4JaJfnr8k50LJ+DaRae+vO RhCKGtNXdK0y21oOj4vgxZDjpQym3WFUzFt1MuD1dEQxC7yKnvymo2wIR5gaWNiSGVPl C7vRc/dyyjnjvyiHq59DQ9C7aEVb77kLc0VH5uUNTb2jOULb6fMdPjy0cmSaE10zSk+m 1Vzw== X-Gm-Message-State: AOAM532acTSMa+HcaHPlXG40nQ2jW7jmsWmRywbkAn/S8SW1zoYVGOF9 SzXj5mEGyLF2VRoPtwVf9sQh2g== X-Received: by 2002:a17:90b:e08:: with SMTP id ge8mr12659157pjb.29.1605904996598; Fri, 20 Nov 2020 12:43:16 -0800 (PST) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id l133sm4882417pfd.112.2020.11.20.12.43.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Nov 2020 12:43:15 -0800 (PST) Date: Fri, 20 Nov 2020 12:43:14 -0800 From: Kees Cook To: Nathan Chancellor Cc: Sami Tolvanen , 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: <202011201241.B159562D7@keescook> References: <20201118220731.925424-1-samitolvanen@google.com> <20201118220731.925424-3-samitolvanen@google.com> <202011201144.3F2BB70C@keescook> <20201120202935.GA1220359@ubuntu-m3-large-x86> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201120202935.GA1220359@ubuntu-m3-large-x86> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Nov 20, 2020 at 01:29:35PM -0700, Nathan Chancellor wrote: > On Fri, Nov 20, 2020 at 11:47:21AM -0800, Kees Cook wrote: > > On Fri, Nov 20, 2020 at 08:23:11AM -0800, Sami Tolvanen wrote: > > > Changing the ThinLTO config to a choice and moving it after the main > > > LTO config sounds like a good idea to me. I'll see if I can change > > > this in v8. Thanks! > > > > Originally, I thought this might be a bit ugly once GCC LTO is added, > > but this could be just a choice like we're done for the stack > > initialization. Something like an "LTO" choice of NONE, CLANG_FULL, > > CLANG_THIN, and in the future GCC, etc. > > Having two separate choices might be a little bit cleaner though? One > for the compiler (LTO_CLANG versus LTO_GCC) and one for the type > (THINLTO versus FULLLTO). The type one could just have a "depends on > CC_IS_CLANG" to ensure it only showed up when needed. Right, that's how the stack init choice works. Kconfigs that aren't supported by the compiler won't be shown. I.e. after Sami's future patch, the only choice for GCC will be CONFIG_LTO_NONE. But building under Clang, it would offer CONFIG_LTO_NONE, CONFIG_LTO_CLANG_FULL, CONFIG_LTO_CLANG_THIN, or something. (and I assume CONFIG_LTO would be def_bool y, depends on !LTO_NONE) -- Kees Cook