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 63683C433F5 for ; Mon, 14 Mar 2022 20:23:46 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 9BC9B83970; Mon, 14 Mar 2022 21:23:42 +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="gOm4uwxh"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B0DB88380F; Mon, 14 Mar 2022 21:23:40 +0100 (CET) Received: from mail-qv1-xf31.google.com (mail-qv1-xf31.google.com [IPv6:2607:f8b0:4864:20::f31]) (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 AE51483986 for ; Mon, 14 Mar 2022 21:23:34 +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-qv1-xf31.google.com with SMTP id jx8so12991026qvb.2 for ; Mon, 14 Mar 2022 13:23:34 -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=TTaiu3YaudO0gtvUyuMC5Is+ESZRF8iUr8CxOcBBd0Y=; b=gOm4uwxh2CJJTHF9xqNPvMQod7mcztICKyNByIFKOP48FnZqroiT1/32qAVYpeNYMC ZXRxl1P396Cy+D4i8U3VyN/RTIqw3ar25kPrPS/q4R+RWn3lFM3v9ON3bHiq6TVjfRzK u38PzOmTXdTOp5itfUPF7c12Jh/C7TAbwTUZQ= 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=TTaiu3YaudO0gtvUyuMC5Is+ESZRF8iUr8CxOcBBd0Y=; b=ZYyg3t3eeJPVbt4U5pVOt6/j0CxmHvcfI3DrmgA409pp/ch6XYVebc/XCXH8mbnoLq ZaeAXA/vnTLadL05ALw0JM4SqFeE9hsOeWfmul0O61GIW/alarAVPdYnfj9INahCTJk7 Tmli388IZY4KQTokob9Af2xoRipXbVGY2So7HggC1LgxX8eYRmc211T9BsqTUrSVHggs vOiFNsJ5AgDGdbkrQgaSk4uePktFqgvKwoL1jmoZlFNPDCtlgkVAugniZDqzO1rQzJjD fIvcAr8uN7/UKMf8XejpNKPIhzVokIAFYT4gVJIG4Gr89WnTCtJtdi8UshrZy5k0mtek CA7w== X-Gm-Message-State: AOAM531wd9jL5Hxm8yttCf748cZtsaFk+cuYXVYCwxE3FTxwZbgi4dUP jgXAXipm2LQPRVdN9Uh2bjmhQA== X-Google-Smtp-Source: ABdhPJzULuahb28T7q79wUZzPUxZAkwMtqq+AIDZiQnqEQEY7/p9ff8OG+MeIytQfVAkmfz1Ebx/kQ== X-Received: by 2002:ad4:5746:0:b0:435:6393:3b61 with SMTP id q6-20020ad45746000000b0043563933b61mr18856460qvx.95.1647289413349; Mon, 14 Mar 2022 13:23:33 -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 75-20020a37044e000000b0067d47fb5aa4sm7735176qke.63.2022.03.14.13.23.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Mar 2022 13:23:32 -0700 (PDT) Date: Mon, 14 Mar 2022 16:23:30 -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: <20220314202330.GR9986@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> <20220314194524.GP9986@bill-the-cat> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="qDmf+FkDYU/jKsh2" 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 --qDmf+FkDYU/jKsh2 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Mar 14, 2022 at 02:18:14PM -0600, Simon Glass wrote: > Hi Tom, >=20 > On Mon, 14 Mar 2022 at 13:45, Tom Rini wrote: > > > > On Mon, Mar 14, 2022 at 01:21:02PM -0600, Simon Glass wrote: > > > Hi Tom, > > > > > > 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 wr= ote: > > > > > > > > > > > > > > > > On Fri, Mar 04, 2022 at 08:42:57AM -0700, Simon Glass wrote: > > > > > > > > > > > > > > > > > LTO (Link-Time Optimisation) is an very useful feature wh= ich 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 u= sed. For example, > > > > > > > > > an incremental build of sandbox takes 2.1 seconds on my m= achine, but 6.7 > > > > > > > > > seconds with LTO enabled. > > > > > > > > > > > > > > > > > > Add a LTO_BUILD=3Dn 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 > > > > > > > > > > > > > > > > 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 h= as been working > > > > > > > > for some time. > > > > > > > > > > > > > > Thanks for that, it is a big pain point for me, picking up th= is patch > > > > > > > for every series I write. The incremental build time for sand= box 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= desktop > > > > > > (i7 vs Ryzen 7). > > > > > > > > > > > > > The EXTRA_CFLAGS says it is for 'Backward compatibility' and = it still > > > > > > > does the various LTO things (i.e. it changes the build logic)= =2E It > > > > > > > > > > > > We're unlikely to move to newer Linux kernel kbuild logic so th= is isn't > > > > > > going away, and there's not much in the way of logic that's cha= nged for > > > > > > LTO that I see. > > > > > > > > > > > > > seems odd to me to enable the option and then disable it late= r in the > > > > > > > command line. It is therefore not quite equivalent. But it se= ems 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 remove= s the LTO > > > > > > > stuff in a consistent way. > > > > > > > > > > > > Yeah, I really don't want to go down the path of overriding CON= FIG > > > > > > options via make/environment logic. I'm also open to turning o= ff LTO 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 han= dy > > > > > 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? > > > > > > 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 > For me, on 16-core AMD desktop, incremental build >=20 > LTO: real 0m7.744s > No LTO: real 0m3.172s >=20 > On 4-core laptop: >=20 > No LTO: real 0m2.429s > LTO: real 0m15.650s >=20 > Perhaps the disconnect here is that you just don't see any difference? > What times are you seeing? My 16 core desktop is 14 seconds without, 15 seconds with (full build, not just the link time) and I don't recall what my laptop was but since it's longer than the desktop I'm always just ssh'd in there anyhow. --=20 Tom --qDmf+FkDYU/jKsh2 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmIvpD8ACgkQFHw5/5Y0 tyxnzwv+LEUIPi1XnOB8BCcZOcaK7QA87FZtgQe3epUyYx44PtUf1Fr69LAxhXqz HhDFZe30yml1sINUtbGlCsG0wZWg/zzeGw53F7E16VpfpdXfpcIctOggIE7wT0Nq KsVw6VlFjgnMmzjE+Vl7mmIP5JY2fLGMfJbMJrQHGM5Mt7ckjVp0VbmrnPa9wYe6 iqZpZbcpby2mPDjriI49i1L7PwspCAswf5+pXSJlO4pSrZqag0qvxWScBVFHSjvo WD9KZYxKWvvJIEWV7COobCGhR2NwRQoBrNaUx1IJ0Api+aqlf6xqHc75qOX83Y3e pSIc9cig57xuC9Lnmv3VLIRUw77I4nQ2QzM0MB+awdq9/ukEcgtPeiClSX4O5qqL 8kZniKUr85TYycEJ8PIrvk0hn5hhoF64PTbMPP+0tQvv1Pb8z/r7vk7w5rqrWuoy rIGW8pphL/fg/IuWOBWLpehXzn1h7+4bbVyK9zvyBysZFN28VKGxGk566lVefyQ1 MAVZ69x+ =az7p -----END PGP SIGNATURE----- --qDmf+FkDYU/jKsh2--