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 A9C24C433F5 for ; Mon, 14 Mar 2022 18:30:08 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 47A5583C05; Mon, 14 Mar 2022 19:30:06 +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="gpxOmAT+"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id C7F5B83C27; Mon, 14 Mar 2022 19:30:03 +0100 (CET) Received: from mail-qt1-x82f.google.com (mail-qt1-x82f.google.com [IPv6:2607:f8b0:4864:20::82f]) (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 4F10283BFA for ; Mon, 14 Mar 2022 19:29:58 +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-qt1-x82f.google.com with SMTP id n11so8273767qtk.4 for ; Mon, 14 Mar 2022 11:29:58 -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=tZTAV6LEn5NGVjTWL25/KVS9FSWgc+til8oynrMcp/U=; b=gpxOmAT+sXyvTz5V5Q/D2YY4eH2Of7eSMOeqbwt8Jl4cooMmeO+ESLJjj0p3lIltx2 K4UvKSfs/dPcWyxzYA6suZfCaxVl8zsG0Shr5k285A+5e5b5hblNGkGN8z490XZ8ITNz yK6Vni/x5bn8LHDVl5Tf5pvEHiWwAM2LHerGc= 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=tZTAV6LEn5NGVjTWL25/KVS9FSWgc+til8oynrMcp/U=; b=PsvuFVlJvq4UkoT2j/YNhUlM3Wksu2yLe/67TAQAMmyEm610FA6m2B0NW41pUnngLm Ic8HcyURkRO5ip3+epQkaBmWXgR4H++j31a+tdflyMbfMEX9k7C7MNclvwUuE5EqAqE6 yLaRX9DT0TgtJcnyWVPm/8j7cWmktn/dTn/C5mFlleaOlUxelrOULCGTAuH4FZGZrPC4 3HFbgf2wTAoJqVRfQnFGcZ4jei90OSM6alUmqMxh9h/CnD371sRPvnOumyvTyLfR/9I5 ed4/2tYR+rwbDXMxzfTQKiv5QZ04YdittcMf4XEqL56NvUticT01ljP59eloL9tKbRE7 71bA== X-Gm-Message-State: AOAM530aSr0a0rxZQDhQGdyqwA2/0BrmOfLuMw1KUYTeu0Oh+APS3fhC REr2ao/7gq1Klzjfjpy14hVFCi9Bx9aWhErD X-Google-Smtp-Source: ABdhPJwb+g8mZHrSoz6QM0kMJLk0EM5TsAFZUjnZLsm1H+6/kyPCXQEkArLI4r6D+FR9IgcHoRJV9Q== X-Received: by 2002:ac8:5a4f:0:b0:2e1:a7be:2d13 with SMTP id o15-20020ac85a4f000000b002e1a7be2d13mr19477877qta.598.1647282596998; Mon, 14 Mar 2022 11:29:56 -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 m6-20020a05622a054600b002e1de0fd952sm630861qtx.5.2022.03.14.11.29.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Mar 2022 11:29:55 -0700 (PDT) Date: Mon, 14 Mar 2022 14:29:54 -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: <20220314182954.GL9986@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> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="UkokfXldvRlmz8/+" 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 --UkokfXldvRlmz8/+ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Mar 14, 2022 at 12:24:42PM -0600, Simon Glass wrote: > Hi Tom, >=20 > 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 has b= een > > > > > 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=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 has been = working > > > > for some time. > > > > > > Thanks for that, it is a big pain point for me, picking up this patch > > > 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 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). It > > > > We're unlikely to move to newer Linux kernel kbuild logic so this isn'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 the 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 LTO on > > sandbox and on with qemu-* so it gets wider CI testing. >=20 > 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 Tom --UkokfXldvRlmz8/+ Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmIviaEACgkQFHw5/5Y0 tyysewv/dYLW+oYFGocg++LDMJdG0yaxfH4LEr+C/awlhG34SV0Kp3Da9AW3vftq +scEcMYPJnDblzfH4j3rqkz0MzVUOL2OgHoYYIhMgNUrzMlgTRKEhKmIFdXSZox9 u6kqh/GVABbZTeSU3ACJg532fzCUYa64f3ntFwv9zaV+tUU6Im4Wwdvox4XX5A5G e5mRtFrPFKAfCIzlevW3FlwJmaElwmBIHJ8exVd+yfgcC+2gadFKMs80Ozbu6QG5 GDlqDULY5Q0D4n9IKzHNlQToTairLFR4dRsDTKQvDeHdb1+I+s2LerJeyc38Hhof gte4eKgS/Y1+95RTfvsOxTAilkrZvm+TrcJkAdi1L97XGbd8eOYWDeFiCLfnZh36 RAE0x08jCQCKdrCnLrp7mpzL/Gv65CABV+EcWQGlDaKViwjgJcClrSyp92B788US fR/vL3y9dVnisUOfowfB31vlcfs2fGalhJ+GZVjtxg0sNmk9s2RiIVwJvAxTxBgM mv5J9qjc =Nv7G -----END PGP SIGNATURE----- --UkokfXldvRlmz8/+--