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 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DFF9DC433EF for ; Sun, 31 Oct 2021 23:46:15 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E105E60F70 for ; Sun, 31 Oct 2021 23:46:14 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org E105E60F70 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 0011882982; Mon, 1 Nov 2021 00:46:11 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="BBGtby9d"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 77D9883196; Mon, 1 Nov 2021 00:46:09 +0100 (CET) Received: from mail-vk1-xa34.google.com (mail-vk1-xa34.google.com [IPv6:2607:f8b0:4864:20::a34]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 22BE281F0B for ; Mon, 1 Nov 2021 00:46:05 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@google.com Received: by mail-vk1-xa34.google.com with SMTP id t127so7243869vke.13 for ; Sun, 31 Oct 2021 16:46:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=6Vt+RJ93DMhuVLHVpJPZOhnn4LeDsZAOdeMUOawWFbE=; b=BBGtby9dRtrrKYbk421Ah+NEHhzhaYvwlvPtB3KSo446er+7gFlCHFXQgqMgGg5J7C uFTkk6H8Ljiaz/LJTVqOUjT2/PnjbxSLhu1YgHdxGmY9HdrE5NQBjkgdnYXxeZViQaaG LAFww0w5GCA2RYZCOghFCEYJo6cNbTQCIqsdA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=6Vt+RJ93DMhuVLHVpJPZOhnn4LeDsZAOdeMUOawWFbE=; b=iZ43UXDoqC8k9UwIPT5cvVI85h0KWLKwVjakV51VQma0sMxg4JrWIeE+sEc9G926Wn E3lecFZANta8mhElwbxIRhGgwZbduhtM1dzWtF8y68Q088Qud788cnoOJqnQyUiVYeaN 0T6xi+J9KyNjAzRhBIXjfXERvmJri6oMEHZIYuDimz+WiY/l5FR8O02DgZ0BGcjwWhNs /DNKGk/z4IH2Pd3SItHpipFNz9wZwI7PglpwlgGrKFnfbz5JZNX/O4wP+634TJ35YMMu puNGfQ0b2o77xx5RJylPllbvBqYZUo55n2hix0wKM56TIBREH5pc+C7mclGII1kBNniy t5Wg== X-Gm-Message-State: AOAM532jddnjSqmV/bQvXrADs+8YL/7CA0eb11fmjhe9cWOpXKwQ9zhr gW2YuB85nXcOlA5L/XbuvuDXTGqtkA54A4qP/kO9gA== X-Google-Smtp-Source: ABdhPJwEEM3dDhu4YzXvfRJenpDPDovpBtkqRuaz5icuwqKjq87Ww2X+8d/45uZI8ikuDiOllYI0Z434NMmMa5L8Ok0= X-Received: by 2002:a1f:1904:: with SMTP id 4mr2252736vkz.9.1635723963448; Sun, 31 Oct 2021 16:46:03 -0700 (PDT) MIME-Version: 1.0 References: <20211023232635.9195-1-sjg@chromium.org> <20211023232635.9195-3-sjg@chromium.org> In-Reply-To: From: Simon Glass Date: Sun, 31 Oct 2021 17:45:51 -0600 Message-ID: Subject: Re: [PATCH v2 02/41] Makefile: Allow LTO to be disabled for a build To: Heinrich Schuchardt Cc: U-Boot Mailing List , Michal Simek , Tom Rini , Daniel Schwierzeck , Steffen Jaeckel , =?UTF-8?B?TWFyZWsgQmVow7pu?= , Lukas Auer , Dennis Gilmore , Masahiro Yamada , Ilias Apalodimas , Heinrich Schuchardt Content-Type: text/plain; charset="UTF-8" X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean Hi Heinrich, On Wed, 27 Oct 2021 at 06:21, Heinrich Schuchardt wrote: > > > > On 10/27/21 10:50, Ilias Apalodimas wrote: > > Hi Simon > > > > How does this patch related to the standard boot series? Shouldn't > > this be a completely separate patch? Probably, but I lose track of all the branches in progress, particularly when things sit for a while. > > > > Thanks > > /Ilias > > > > On Sun, 24 Oct 2021 at 02:26, Simon Glass wrote: > >> > >> LTO (Link-Time Optimisation) is an very useful feature which can > >> significantly reduce the size of U-Boot binaries. So far it has been > >> made available for selected ARM boards and sandbox. > >> > >> However, incremental builds are much slower when LTO is used. For example, > >> an incremental build of sandbox takes 2.1 seconds on my machine, but 6.7 > >> seconds with LTO enabled. > >> > >> Add a LTO_BUILD=n parameter to the build, so it can be disabled during > >> development if needed, for faster builds. > >> > >> Add some documentation about LTO while we are here. > >> > >> Signed-off-by: Simon Glass > >> --- > >> > >> (no changes since v1) > >> > >> Makefile | 18 +++++++++++++----- > >> arch/arm/config.mk | 4 ++-- > >> arch/arm/include/asm/global_data.h | 2 +- > >> doc/build/gcc.rst | 17 +++++++++++++++++ > >> 4 files changed, 33 insertions(+), 8 deletions(-) > >> > >> diff --git a/Makefile b/Makefile > >> index b79b2319ff6..7057723e046 100644 > >> --- a/Makefile > >> +++ b/Makefile > >> @@ -434,6 +434,9 @@ KBUILD_CFLAGS += -fshort-wchar -fno-strict-aliasing > >> KBUILD_AFLAGS := -D__ASSEMBLY__ > >> KBUILD_LDFLAGS := > >> > >> +# Set this to "n" use of LTO for this build, e.g. LTO_BUILD=n > >> +LTO_BUILD ?= y > > This does not allow LTO_BUILD=y to enable LTO for CONFIG_LTO=n. > > We should have something like > > LTO_CONFIG ?= $CONFIG_LTO The CONFIG indicates that LTO is supported, so if we want to do that, we could fix the problems with LTO for a board/arch and send a patch to enable it. I think we want it enabled by default. [..] Regards Simon