Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp928612ybt; Wed, 24 Jun 2020 15:05:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxcrm0Wwl/hHUkzPHQ+6b1v/Gv+zLR3gmuyRBzahgtMTdEO0M4dY0aCaRGVAu0jC5TKuZQT X-Received: by 2002:a50:e14e:: with SMTP id i14mr27735014edl.279.1593036356443; Wed, 24 Jun 2020 15:05:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593036356; cv=none; d=google.com; s=arc-20160816; b=AO6emhZ6iCFLIAEqSNq83s2a3P81P+JmOJ2HzytSFhxqEHmTHShdL40hCqvrSqXNjx JdRV443sQZ9P4TYJfbLr8fx20/MLZ9jBDtkafyeESmInYMr5nF11BhrGTzIOuPyfbDyw XipBJOnrZpgUjw/yRHDozOP8htdUhCejgzf+DIkrODkBtpWzDA6u8mgVDbxeIcKHhMn8 PjfWiOQLBNC2HgD1WXosowfzZxxuWyFzgEmMlagW0Sv2O9wB3AFbK7BQbASSSeIB7TQ3 bANuS3O/ZxFm1NBsr6LlFy8OfBZMgj6UB7m0uowXmBx4iWJNWIWUi7UOd4lai2curXdT oZvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=8S7wdQVFSvGinNDpzeGeM5bOvAIHO3+dn7qtS4xKvV8=; b=i4YzwofPQxxMlbD40twRXTeZWxsIXxI+PLdUomOj/nbkuZkP6VQEW3Hl4cJBx4kevc P6gG0q+myljyzQxGrcjoug75EICbnGy/7l+ow0u57HbbBPuMCiDhATvX0ogZT5wv+2wk IWbfY9QL2CDQuRsauqYqoEzPdWukpVTo/iU2tUGR4GzxkqdzGPTR/yI4lvJMFw6TwPq/ T0kwBXwvbs3V6sAsm4V1ssXz1zyrtlNiwVHfpagdnywyvP7FTZjENSPk76J238HUG9vT +pgOrX3YadDY3c9jVD1UdudrMZKfRfCgnEvqi1ZOC1DqxeIIoVqgDsVAscHOVzEKk2z0 1bvg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=QSb2yx30; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ca9si8922686edb.324.2020.06.24.15.05.33; Wed, 24 Jun 2020 15:05:56 -0700 (PDT) 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=@google.com header.s=20161025 header.b=QSb2yx30; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2403878AbgFXV3L (ORCPT + 99 others); Wed, 24 Jun 2020 17:29:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59306 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2403865AbgFXV3K (ORCPT ); Wed, 24 Jun 2020 17:29:10 -0400 Received: from mail-pg1-x543.google.com (mail-pg1-x543.google.com [IPv6:2607:f8b0:4864:20::543]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B956AC061796 for ; Wed, 24 Jun 2020 14:29:09 -0700 (PDT) Received: by mail-pg1-x543.google.com with SMTP id e18so2083462pgn.7 for ; Wed, 24 Jun 2020 14:29:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=8S7wdQVFSvGinNDpzeGeM5bOvAIHO3+dn7qtS4xKvV8=; b=QSb2yx30HozPwbE3cmDUoYnn/m54tkj1kAjJCdgJUPE9p9hcmMPBKaVPQ8nq6Bc1WJ qB9goQOthKh59QOfHEOB0pjBNCmP4PYV/LKAx2CJEjeYgcYLuigmtDK1rd0z3GBirbjf QT7+7vbSd+q2ZOzjXvTocpYNfGsOGa/P0watDoU+3ObHezue05cXmufnhVEm5Q3ZZmTa XCjrJbaX5IO0+0GeI80gfIvjmkaMIwYTVrZh2tjnwzLuU1tncROVGCLiilpUzqVPfzKM RIHYMVRhw56vrkubCQ6vuKEMInx200lTXE2eT3cyIagXjOxlrxuHoW9NFhenw6ZcgEPv QI4g== 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=8S7wdQVFSvGinNDpzeGeM5bOvAIHO3+dn7qtS4xKvV8=; b=XJ4tkVcDdaOuBJoeqOsnGT0b1W7YqYEF94QzSw8JoTQUlWYWaMTNxh5XFmUZ8GAXcQ I0f/SO6mMFRkIKWd652kpdTYkYGtHfv1ZTyS6YTD2IC3DmyuaEreWyIQKDcirTtjLAhZ tXAPCPfW2bU+gl0Ekdcn46Bhjlb6b/HuzHBCneb4ANUpPDNzvledd1hXcFOt2xKPFkfp D9tiHs67xxIv2AsuG3cydhEzCgis+OnrJ9mUe0GBkGSXbIv3UsjVDVD+VpKFdybdauCg urceKkmCVqln7zRS7VFaEbB8C983pQefjzjpS/Yo5umXEpjhqj2g3hm19bumt0dXjFrT l0Ng== X-Gm-Message-State: AOAM532s4TBj/reNHkNDh0DIue26W8ZosgNGSUNzE1qHs6kYWB2hCHH5 6fPH82LScU18rZKi2rcP0eMydw== X-Received: by 2002:a63:79c2:: with SMTP id u185mr6299836pgc.84.1593034148817; Wed, 24 Jun 2020 14:29:08 -0700 (PDT) Received: from google.com ([2620:15c:201:2:ce90:ab18:83b0:619]) by smtp.gmail.com with ESMTPSA id q1sm22211040pfk.132.2020.06.24.14.29.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Jun 2020 14:29:08 -0700 (PDT) Date: Wed, 24 Jun 2020 14:29:02 -0700 From: Sami Tolvanen To: Nick Desaulniers Cc: Masahiro Yamada , Will Deacon , Greg Kroah-Hartman , "Paul E. McKenney" , Kees Cook , clang-built-linux , Kernel Hardening , linux-arch , Linux ARM , Linux Kbuild mailing list , LKML , linux-pci@vger.kernel.org, "maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" Subject: Re: [PATCH 02/22] kbuild: add support for Clang LTO Message-ID: <20200624212902.GA26253@google.com> References: <20200624203200.78870-1-samitolvanen@google.com> <20200624203200.78870-3-samitolvanen@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 24, 2020 at 01:53:52PM -0700, Nick Desaulniers wrote: > On Wed, Jun 24, 2020 at 1:32 PM Sami Tolvanen wrote: > > > > diff --git a/Makefile b/Makefile > > index ac2c61c37a73..0c7fe6fb2143 100644 > > --- a/Makefile > > +++ b/Makefile > > @@ -886,6 +886,22 @@ KBUILD_CFLAGS += $(CC_FLAGS_SCS) > > export CC_FLAGS_SCS > > endif > > > > +ifdef CONFIG_LTO_CLANG > > +ifdef CONFIG_THINLTO > > +CC_FLAGS_LTO_CLANG := -flto=thin $(call cc-option, -fsplit-lto-unit) > > The kconfig change gates this on clang-11; do we still need the > cc-option check here, or can we hardcode the use of -fsplit-lto-unit? > Playing with the flag in godbolt, it looks like clang-8 had support > for this flag. True, we don't need cc-option here anymore. I'll remove it, thanks. > > +KBUILD_LDFLAGS += --thinlto-cache-dir=.thinlto-cache > > It might be nice to have `make distclean` or even `make clean` scrub > the .thinlto-cache? Also, I verified that the `.gitignore` rule for > `.*` properly ignores this dir. Sure, distclean sounds appropriate to me. Sami