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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 6ABE8C433FE for ; Mon, 14 Mar 2022 19:45:39 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 7130B83531; Mon, 14 Mar 2022 20:45:36 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=konsulko.com 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=konsulko.com header.i=@konsulko.com header.b="EN/yZY1+"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id BE77B83A65; Mon, 14 Mar 2022 20:45:33 +0100 (CET) Received: from mail-qk1-x733.google.com (mail-qk1-x733.google.com [IPv6:2607:f8b0:4864:20::733]) (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 E95C583982 for ; Mon, 14 Mar 2022 20:45:27 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=trini@konsulko.com Received: by mail-qk1-x733.google.com with SMTP id g8so10184799qke.2 for ; Mon, 14 Mar 2022 12:45:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=JngmmfH3ZU+S+72J25JOiQ0WHAtUoCsdheA/gUL4O4s=; b=EN/yZY1+uHveppYU+XU9+ij4ljWCn3JtG827aaWBJfH5nZdwHnzoIg9lav28ikej4V V3D5Dh8/58dKozQv0QosF1OMW0sO6FA1FB+YW0tylgmxiLBeLikJHvDh65VnJw2J7FV1 +smB4ePp4k40tG1aIWVKzz373qpcuW3+Qib5o= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=JngmmfH3ZU+S+72J25JOiQ0WHAtUoCsdheA/gUL4O4s=; b=3h7p/KFd2Ej3jNb5ztT5k/RvzPw7Rrv6a2NNSpQ80TdO5cXkWLa0zLJHc2LXpzfD8w cWj1/LJ6S7ytnqQQaMK+A26NGFpnsNJV2CdAeN0svgLFmYBwGQd9Jv8+1HAxibFlYBmn Kjx5AhAjcfIG/pg8KV5X79mahP/+xzzrUoyxSBcxXHshxmSYu/ZL5XrhULt5lTbrECdV KvTI6MqCj0cQSom77y0HygbzqvoRdexoJh+o7pPQ5peVPY+LR3lQwAEqZaN3tqE6yklj Hks2uns8gjZZ+FDIdYbfiwglICKJXf77abi9YiP3FyY3MoteIUEbSWDYxX4n7t37NZth OGAw== X-Gm-Message-State: AOAM531myAQn+KKZInqU8uGXTNkJ0WEV1NVphaFgy1Okai3TChsNDvKP JkB05Mo3igrd554qDyHIe5wHhA== X-Google-Smtp-Source: ABdhPJxZjdBpu/8O5nt2ptWJGmvoGsTe+LlueaWTUbW0UJJBaViPx0euoyjnqPjHvJh6MkV+FLGd/Q== X-Received: by 2002:a37:a084:0:b0:67d:405b:60d0 with SMTP id j126-20020a37a084000000b0067d405b60d0mr16007040qke.83.1647287126746; Mon, 14 Mar 2022 12:45:26 -0700 (PDT) Received: from bill-the-cat (2603-6081-7b01-cbda-2ef0-5dff-fedb-a8ba.res6.spectrum.com. [2603:6081:7b01:cbda:2ef0:5dff:fedb:a8ba]) by smtp.gmail.com with ESMTPSA id c10-20020ac87dca000000b002e1db1b7b10sm1017972qte.25.2022.03.14.12.45.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Mar 2022 12:45:26 -0700 (PDT) Date: Mon, 14 Mar 2022 15:45:24 -0400 From: Tom Rini To: Simon Glass Cc: U-Boot Mailing List , Marek Vasut , Masahiro Yamada , AKASHI Takahiro , Marek =?iso-8859-1?Q?Beh=FAn?= , Heinrich Schuchardt Subject: Re: [PATCH v2 02/13] Makefile: Allow LTO to be disabled for a build Message-ID: <20220314194524.GP9986@bill-the-cat> References: <20220304154308.2547711-1-sjg@chromium.org> <20220304154308.2547711-3-sjg@chromium.org> <20220307143302.GA1209254@bill-the-cat> <20220314124950.GE9986@bill-the-cat> <20220314182954.GL9986@bill-the-cat> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="VTXmujg/U6ONPSfv" Content-Disposition: inline In-Reply-To: X-Clacks-Overhead: GNU Terry Pratchett X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.5 at phobos.denx.de X-Virus-Status: Clean --VTXmujg/U6ONPSfv Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Mar 14, 2022 at 01:21:02PM -0600, Simon Glass wrote: > Hi Tom, >=20 > On Mon, 14 Mar 2022 at 12:29, Tom Rini wrote: > > > > On Mon, Mar 14, 2022 at 12:24:42PM -0600, Simon Glass wrote: > > > Hi Tom, > > > > > > On Mon, 14 Mar 2022 at 06:49, Tom Rini wrote: > > > > > > > > On Sat, Mar 12, 2022 at 10:58:44AM -0700, Simon Glass wrote: > > > > > Hi Tom, > > > > > > > > > > On Mon, 7 Mar 2022 at 07:33, Tom Rini wrote: > > > > > > > > > > > > On Fri, Mar 04, 2022 at 08:42:57AM -0700, 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 h= as 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 machi= ne, but 6.7 > > > > > > > seconds with LTO enabled. > > > > > > > > > > > > > > Add a LTO_BUILD=3Dn parameter to the build, so it can be disa= bled during > > > > > > > development if needed, for faster builds. > > > > > > > > > > > > > > Add some documentation about LTO while we are here. > > > > > > > > > > > > > > Signed-off-by: Simon Glass > > > > > > > > > > > > We don't need this since you can do: > > > > > > make EXTRA_CFLAGS=3D"-fno-lto" EXTRA_LDFLAGS=3D"-fno-lto" > > > > > > to pass -fno-lto to compile/linking and disable lto and per > > > > > > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D46905 this has b= een working > > > > > > for some time. > > > > > > > > > > Thanks for that, it is a big pain point for me, picking up this p= atch > > > > > for every series I write. The incremental build time for sandbox = goes > > > > > from 3 seconds to 27 seconds on my laptop with LTO, which is > > > > > intolerable. > > > > > > > > Yeah, I noticed it's visible on my laptop, but not at all on my des= ktop > > > > (i7 vs Ryzen 7). > > > > > > > > > The EXTRA_CFLAGS says it is for 'Backward compatibility' and it s= till > > > > > does the various LTO things (i.e. it changes the build logic). It > > > > > > > > We're unlikely to move to newer Linux kernel kbuild logic so this i= sn't > > > > going away, and there's not much in the way of logic that's changed= for > > > > LTO that I see. > > > > > > > > > seems odd to me to enable the option and then disable it later in= the > > > > > command line. It is therefore not quite equivalent. But it seems = to > > > > > work well enough for me fom a small amount of testing. If you are > > > > > really set on not having a special option for it, I can live with= it > > > > > for now. I'm also not convinced that my patch entirely removes th= e LTO > > > > > stuff in a consistent way. > > > > > > > > Yeah, I really don't want to go down the path of overriding CONFIG > > > > options via make/environment logic. I'm also open to turning off L= TO on > > > > sandbox and on with qemu-* so it gets wider CI testing. > > > > > > Yes you did mention that, but the problem is that LTO is very handy > > > with sandbox, to test the strange things that happen. For example, I > > > found the bug where LTO was dropping a linker-list item, using > > > sandbox. We could perhaps make one of the sandbox builds not use LTO, > > > e.g. sandbox_flattree ? > > > > Well, the big issue with LTO+sandbox is that it slows down your > > workflow, so I would think you want the inverse, one platform does > > enable it? >=20 > It slows down all boards that use it, actually, so I normally don't > want it enabled for my IDE. This is not sandbox-specific. The degree of slowdown depends on what you're building on. I see several seconds of link time on my laptop and nothing on my desktop (which isn't that high end either, it's not an EPYC or anything) when LTO is/isn't enabled. --=20 Tom --VTXmujg/U6ONPSfv Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmIvm1QACgkQFHw5/5Y0 tyzW3Av+J+UcxB0rK1b7vKtZh+/mMwNr8PARrmnZ+G1Rj9HOnMM2K9ZGRlUllMLG ooj3UYJuvD09mcdvzt5ECQ7pE6+0uGOrfo4wuB6GkeelKlX3+6IcQqToPo/haqVg rEcPciCC08x25RogTT6ZnvDv1RUF/3xcIWnYqlloNfEkWnofZ0eE+t9T+Q9Aobj5 ejpj/3jnzrbdQ2NlMB6nKUoe159tA8l5VMfzo/3pQMQuJrSz2YZ6gwJPM6+qWFyT tZlcfv9OeVyVIMAIh3vphIxLQD3ebJ0Kfv0PzTfOq7mkk8F3FMvwnXZaUh2ttYH/ UvD3qZHKY0dPbL0v+sx2PRsSRiphPx3BGYBUMrF3S9kCH4Mak45a5WZdZH4hsCye GVisiFYMTFDOxKbCa2HMwhnNrHuYXoKUIVHwnYhsnqfZ10Kj07iIKHDrT2zaZVqc G4rhOU/Kj+tcaGBi/y3y4XjzJSiQ6zj82FdC2cx3LDNGiRJ+Nz3v0Q8gpCS5nqaX D2Q60VmZ =UYSG -----END PGP SIGNATURE----- --VTXmujg/U6ONPSfv--