From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,FSL_HELO_FAKE, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 38239C43461 for ; Tue, 8 Sep 2020 17:12:38 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id CC75F20732 for ; Tue, 8 Sep 2020 17:12:37 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="yBnaJfVy"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=google.com header.i=@google.com header.b="EDOnxu3/" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CC75F20732 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=gUxLYO5jS8Yu6/5SlvsK6/H1HAnx7vCx/nHlpuGta1c=; b=yBnaJfVyC5aeERl+3WO7tVe0R COlv2dNYXwWzCjDB0Jhpi9QCQZoGB6Tr/iP7EsMT+ERnMBnbyl9HImINyY5Ew/A8U9LV8evsTP/Oh QDwvRWoXcHaCWxXibP+6jfR0oUMNPLZjFkjdeQkxEACsEdMbQ47ZWOZXjiO0WSiI701tHWITcd4N2 lOx6wYwGnFocKelfZUg7BtY6o2YJHtipVy6PS2fCxft10fVg0CWEvKH5Mz6W5owlbw9FEYvZMdp47 itSmHw2BeR6i20uvMzpk6PZS7/GVoAMpEPtESdRWD8ImaP5sd/S7xWYcTYVsegiwCROI2Y/rMSKm0 F59qyBUbQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kFh95-0002xo-Qr; Tue, 08 Sep 2020 17:11:03 +0000 Received: from mail-pg1-x543.google.com ([2607:f8b0:4864:20::543]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kFh93-0002wN-8J for linux-arm-kernel@lists.infradead.org; Tue, 08 Sep 2020 17:11:02 +0000 Received: by mail-pg1-x543.google.com with SMTP id l191so4094pgd.5 for ; Tue, 08 Sep 2020 10:11:00 -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=+LDeT2lt9SUcFTCT7BGDtz2er/OFG3MBH42fF3G6h68=; b=EDOnxu3/tWXDEbO6aDonCpKCXjFECgrh/c5YRnWtoQ+SHvbswr+J9cGbiv4XUvNfrd Em65A52BYE3J8f195qPDI06udLHV8qdKzyftN/XsuICT3JOpkkrJjXA8SwRBW6SJFwIJ EzxA2KlhnfS8sc+kRLjxSmT8aJqg9Kgl+vhsMjNmF1fUU2hFGI+XhHju5+YlFt8CwMyV icqzwB0Hg81zggur22jiAbr8aGH6mP0aCauFgvoMG6dJURct0IpkkJdXcpVm7v0ecqQb mRk0w7ZSMxbIICPrnpndkBSn/Os7FI8G732QR5xMmeo6/XrIMdRBOK6LfscZl2uqp309 p9Ng== 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=+LDeT2lt9SUcFTCT7BGDtz2er/OFG3MBH42fF3G6h68=; b=DM/FmJFzGEWMnka2w+7u46CZ53kS5GI/1iO7pyGMaj7OzUepbniPNQ6OfKDYlATuSo EUeJw0ILv0SrhdTfEF+E4tIFTpTO5RoQOoxdfhmMtifkfM20ktOb2Y8RWCHsU+FHLeol Z1osyXqIzRIW/HoRWVfwgf790STf5YMKyHX17w35kU5GEE+H7F2HgihbH/WDB4CAycl8 gKiPqKtkn5+2D+ygVwRQmNNdrCldxvVCcHqC+seLTvtE/dsvRGW3l0naSk1HR2dntNK5 V9XIo93gYFRHn5RkWrbASY9D4RAWJ21w3HPd1hSE2i7aCpcwTl10cFh8zNRIQ36SM5U+ tvYQ== X-Gm-Message-State: AOAM532Xj/w2BNhvZ+/wqe4AsWKnsf71cnywKp0rYURsUEpad25aega2 pqIUyaaXn6UcziY1wB86kEw9YQ== X-Google-Smtp-Source: ABdhPJzypUk2kaMSsozZWu2eOHXNN4ZkXvherqbpQHodcqeZRg4Fd5ulTMlytF6eoxCVBPUWtIX41g== X-Received: by 2002:a62:3812:0:b029:13e:d13d:a062 with SMTP id f18-20020a6238120000b029013ed13da062mr30916pfa.40.1599585058742; Tue, 08 Sep 2020 10:10:58 -0700 (PDT) Received: from google.com ([2620:15c:201:2:f693:9fff:fef4:1b6d]) by smtp.gmail.com with ESMTPSA id l141sm25676pfd.47.2020.09.08.10.10.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Sep 2020 10:10:57 -0700 (PDT) Date: Tue, 8 Sep 2020 10:10:52 -0700 From: Sami Tolvanen To: Masahiro Yamada Subject: Re: [PATCH v2 09/28] kbuild: add support for Clang LTO Message-ID: <20200908171052.GB2743468@google.com> References: <20200624203200.78870-1-samitolvanen@google.com> <20200903203053.3411268-1-samitolvanen@google.com> <20200903203053.3411268-10-samitolvanen@google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200908_131101_333967_7A7884C4 X-CRM114-Status: GOOD ( 28.25 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arch , X86 ML , Kees Cook , "Paul E. McKenney" , Kernel Hardening , Peter Zijlstra , Greg Kroah-Hartman , Linux Kbuild mailing list , Nick Desaulniers , Linux Kernel Mailing List , Steven Rostedt , clang-built-linux , linux-pci@vger.kernel.org, Will Deacon , linux-arm-kernel Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Sun, Sep 06, 2020 at 04:36:32AM +0900, Masahiro Yamada wrote: > On Fri, Sep 4, 2020 at 5:31 AM Sami Tolvanen wrote: > > > > This change adds build system support for Clang's Link Time > > Optimization (LTO). With -flto, instead of ELF object files, Clang > > produces LLVM bitcode, which is compiled into native code at link > > time, allowing the final binary to be optimized globally. For more > > details, see: > > > > https://llvm.org/docs/LinkTimeOptimization.html > > > > The Kconfig option CONFIG_LTO_CLANG is implemented as a choice, > > which defaults to LTO being disabled. > > What is the reason for doing this in a choice? > To turn off LTO_CLANG for compile-testing? > > I would rather want to give LTO_CLANG more chances > to be enabled/tested. It's a choice to prevent LTO from being enabled by default with allyesconfig and allmodconfig. It would take hours to build these even on a fast computer, and probably days on older hardware. > > +ifdef CONFIG_LTO_CLANG > > +ifdef CONFIG_THINLTO > > +CC_FLAGS_LTO_CLANG := -flto=thin -fsplit-lto-unit > > +KBUILD_LDFLAGS += --thinlto-cache-dir=.thinlto-cache > > > I think this would break external module builds > because it would create cache files in the > kernel source tree. > > External module builds should never ever touch > the kernel tree, which is usually located under > the read-only /usr/src/ in distros. > > > .thinlto-cache should be created in the module tree > when it is built with M=. Thanks for pointing this out, I'll fix the path in v3. > > # Directories & files removed with 'make distclean' > > -DISTCLEAN_FILES += tags TAGS cscope* GPATH GTAGS GRTAGS GSYMS > > +DISTCLEAN_FILES += tags TAGS cscope* GPATH GTAGS GRTAGS GSYMS .thinlto-cache > > > > This was suggested in v1, but I could not understand > why doing this in distclean was appropriate. > > Is keeping cache files of kernel objects > useful for external module builds? No, the cache only speeds up incremental kernel builds. > Also, please clean up .thinlto-cache for external module builds. Ack. Sami _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel