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 CD236C433F5 for ; Mon, 14 Mar 2022 12:50:18 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 9484E83BDF; Mon, 14 Mar 2022 13:50:16 +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="T6FHvupC"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id D3AA383B90; Mon, 14 Mar 2022 13:50:03 +0100 (CET) Received: from mail-qk1-x72d.google.com (mail-qk1-x72d.google.com [IPv6:2607:f8b0:4864:20::72d]) (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 D8981839A7 for ; Mon, 14 Mar 2022 13:49:54 +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-x72d.google.com with SMTP id v15so12581241qkg.8 for ; Mon, 14 Mar 2022 05:49:54 -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=KyjjggpF4aq/pEOi4Sm+tE777M1P4L4ptD3vubDrWjA=; b=T6FHvupCNv8jTPd5JyVLxv4Ed7li04Zf/tTsxKal3fsPHixKyBEJh2+wI1vvZR6nz+ MV7zDEPPui/tpLBuISYrqHlImkUkD83n17SdqlaGyLfkHwmXWrOxV3lFlAzdmpJP8Cqo jCDWQcuelHPHz27eV3XQIpnVRhYRo1WxBFBvc= 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=KyjjggpF4aq/pEOi4Sm+tE777M1P4L4ptD3vubDrWjA=; b=Ove8lcSELJoGpbdvpg0mVKdIzCh2ZEjor0t8ZxkKDZpAm/avfHGwTOAgJZyAjjreCa +3bV8/sjVed/uK4cgyebUnGTqvbgxWCxnLLadJN4NwRJUNdpHUso7svt+xjrJpUIXqOy EYSHyvndcfFapCA5ME7DOI+ioPMro4nA8KhIZ+1BMC2g2hZiv1jFschqmNfpDqSVOfW9 IYYgjficMNZzmNIsNpDa48A+V6PxztTDZdI4/JaTR9Y62Zl72QlXvyUneR9p5HR2353F YGba2sBDr/rDH553hEyaFy1acu5tv82QoBW12E2L8wTpCCHxKV4QxEzudKBtDVYwY+q/ F+cQ== X-Gm-Message-State: AOAM532JhCUDAdt6ivkSayJIE71xiC9kWzDETnOVwhcQj/tiHp0zJJ9E 8/F+KSxrNLUxNCS3ebhWTK2IDg== X-Google-Smtp-Source: ABdhPJzhg4M21rjF8dxQ7j2CgiKIhP3nHnfom06fK/Ujo9scGuAteE4FjimvayVAb5/dJWpNDrNvog== X-Received: by 2002:a05:620a:4512:b0:67d:19c0:badb with SMTP id t18-20020a05620a451200b0067d19c0badbmr14124042qkp.34.1647262193489; Mon, 14 Mar 2022 05:49:53 -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 x12-20020a05620a12ac00b0067d4bfffc59sm6679597qki.118.2022.03.14.05.49.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Mar 2022 05:49:52 -0700 (PDT) Date: Mon, 14 Mar 2022 08:49:50 -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: <20220314124950.GE9986@bill-the-cat> References: <20220304154308.2547711-1-sjg@chromium.org> <20220304154308.2547711-3-sjg@chromium.org> <20220307143302.GA1209254@bill-the-cat> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="hxkXGo8AKqTJ+9QI" 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 --hxkXGo8AKqTJ+9QI Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Mar 12, 2022 at 10:58:44AM -0700, Simon Glass wrote: > Hi Tom, >=20 > 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 been > > > made available for selected ARM boards and sandbox. > > > > > > However, incremental builds are much slower when LTO is used. For exa= mple, > > > 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 dur= ing > > > 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 work= ing > > for some time. >=20 > 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 Tom --hxkXGo8AKqTJ+9QI Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmIvOe4ACgkQFHw5/5Y0 tyxNkgv/SDHV1VqM9ZQ8qu2E1YiVwPuu6IGBkiB9EwXI6pWav08N3q4azmy1TJV7 aM5LyYctEYcs+mPl/S6HggNhZ4yNEsPP+zMTZKf0IiGKwZwovNZmFUoOq3+Pf1F2 Ad9jLhkafJ8NkwMpj4aLsaJsvqtiNXtfJ+5ORN69G14XCcJp2NFx/Rr+HXH690vA eErx/4UKSguUMjJxVXbjAgqYypc1TZqlw2e8EFeBrEtqhXgebWRGGte2eyTAK2dc 9Bf5gtuuySMOq882GfkJswm7rh9j3+sUk97wVjoqCsRKJfJXRRBnXTU4Inn+Ilyl 9ZLVOF9CP+WYu3KgU1iWYxJOoYArY1in+9FinCdvLDzCFGaVhGJyOMiVixJruoe3 a1j5sXV96KIsrDFwPDMoWKP1BDMdI0v47FFZpOHglz5JONR0noY0DXHbUH+pZ/Nt g+QO5j1C06WGtaTcnEJTqGJur4DLiSIGK+JT2r+2TWpilKa72cFoyxTD7WmMaT7m BOzLcJZe =QLgV -----END PGP SIGNATURE----- --hxkXGo8AKqTJ+9QI--