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 5B131C433EF for ; Sun, 15 May 2022 18:53:14 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 34B7F83EB0; Sun, 15 May 2022 20:53:11 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.b="mzG4HHdl"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id E332583EB0; Sun, 15 May 2022 20:53:08 +0200 (CEST) Received: from mail-qk1-x72b.google.com (mail-qk1-x72b.google.com [IPv6:2607:f8b0:4864:20::72b]) (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 7925F8186D for ; Sun, 15 May 2022 20:53:05 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=ascull@google.com Received: by mail-qk1-x72b.google.com with SMTP id n8so10910389qke.11 for ; Sun, 15 May 2022 11:53:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=/8jb98jWQQAd2WhWg0NoFoZjOYd71pbmbRY8YErqfSM=; b=mzG4HHdlZdVlSZoOG+K44xxS7aD+irVwVFIRd9HHXStVfwpeatAqsyuMhgzmSxSvpK 5XPUpfXvK0BC+Vu72lWwDA0VGQj1Gc4YWEyZOB89Xkw7UIroKEhqyjC2R6zbF28oMpMT 0+UBc6vtntDjMfDDMPl4y7IufS2Q1j0wwQPVB1gzauYRmBYr2VfHn7kqvJFZMFPlwADV L+7hnYI8SKEaFwhGfiKtVcUSnFFaQdU8qiCaq4Q5jNkZ/IC0OjuTGkOvD5wO4mq4MOFk G3MOWfTY3HTJ+7SkAbfBnjjwLYAVUv56Js7fCtF2WGRfCh22nJOXrXT0RuvlCYnxsZJ0 upZA== 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=/8jb98jWQQAd2WhWg0NoFoZjOYd71pbmbRY8YErqfSM=; b=v8/mmkrbGfDi7hidmLfqIc/d54lVef94SPFpKdF7XyZ2Rlyw21cLrB/dKWIV/jHc+/ UqDhezwNa1XG7W9qJSXIa6Mh0hU4B8fuh/79V1Zb9swnwzPKlFABmM2TKEa0VVUy+l0o KilAMXKNHoV9NOEnG9t3nUttudJEVj3TBhZylnRqhEP5uUy9AhOpmWaeG52X3LKF/GzS QzjM/n9I5nk0pNf0I+oYcbDhZWXo9sOWNAhkBp6uOAAxajBqs5xhPeNy64XAxXsLfV7e zd/2oigofVVuD0fAEda+MXt+oL+mOGXxa7uQLUbs56U93StVTcpbkCMZ2JttrHxdmZFJ 15rA== X-Gm-Message-State: AOAM530OU/A1nyuzPHCVBO8lxSZLmfvKL69MNqAwiJ6WlrumhhwkjCod OtVz0+orlNt5u5IeOkyZgHbLXrfMvQSbqKLoSUD++A== X-Google-Smtp-Source: ABdhPJyLvu5EiYLx9kd8rxgkhsqOwWAgK86PMtwqlb0VhGOlLV230giqg4MIfg8bARwFmz6Fbe0ZkWiwfiWP25T4zxM= X-Received: by 2002:a05:620a:4244:b0:67e:86d7:757f with SMTP id w4-20020a05620a424400b0067e86d7757fmr10206380qko.779.1652640783906; Sun, 15 May 2022 11:53:03 -0700 (PDT) MIME-Version: 1.0 References: <20220327202622.3438333-1-sjg@chromium.org> <20220327202622.3438333-2-sjg@chromium.org> In-Reply-To: From: Andrew Scull Date: Sun, 15 May 2022 19:52:53 +0100 Message-ID: Subject: Re: [PATCH 01/10] Makefile: v2 Allow LTO to be disabled for a build To: Simon Glass Cc: U-Boot Mailing List , Heinrich Schuchardt , Sean Anderson , =?UTF-8?B?TWFyZWsgQmVow7pu?= , U-Boot Custodians , Tom Rini , Bin Meng , Ilias Apalodimas , Joel Peshkin , Masahiro Yamada , Patrick Delaunay , Ye Li Content-Type: text/plain; charset="UTF-8" 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 On Mon, 11 Apr 2022 at 22:46, Simon Glass wrote: > > Hi Andrew, > > On Thu, 31 Mar 2022 at 04:29, Andrew Scull wrote: > > > > On Sun, 27 Mar 2022 at 21:27, 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. > > > > This is something that has been bothering me too. I'd resorted to adding > > `# CONFIG_LTO is not set` to sandbox_defconfig because I couldn't work > > out how to stop .config being regenerated each build. But then the > > diff gets in the way and is difficult to manage. > > > > > Add a LTO_BUILD=n parameter to the build, so it can be disabled during > > > development if needed, for faster builds. > > > > If you go the build parameter route rather than config route to > > address this, could the flag be consistent e.g. with NO_SDL=1, which > > would mean NO_LTO=1? > > That seems OK to me. Would you like to do that and send a new version? > > Here is a better version of the patch to use as a starting point: > > https://source.denx.de/u-boot/custodians/u-boot-dm/-/commit/2d4ebfb0e8e86a1b347e6cbd4dbec9a4eb745bd5 I realised my make command was rebuilding the defconfig each time which, unsurprisingly, was regenerating the .config file. Now I can unset CONFIG_LTO in .config and have it persist for incremental builds, which is a pattern I've also used when working on Linux, and doesn't need an alternate toggle in the makefiles to achieve the same result. My preference is to use .config for the time being.