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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8E6C1C433EF for ; Fri, 22 Oct 2021 19:49:37 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id AC013604AC for ; Fri, 22 Oct 2021 19:49:36 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org AC013604AC Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id A3BCE8319C; Fri, 22 Oct 2021 21:49:34 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.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=gmail.com header.i=@gmail.com header.b="DI5oP/pR"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 619108319C; Fri, 22 Oct 2021 21:49:32 +0200 (CEST) Received: from mail-ed1-x52e.google.com (mail-ed1-x52e.google.com [IPv6:2a00:1450:4864:20::52e]) (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 00B1B83178 for ; Fri, 22 Oct 2021 21:49:28 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=aford173@gmail.com Received: by mail-ed1-x52e.google.com with SMTP id a26so296616edy.11 for ; Fri, 22 Oct 2021 12:49:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=cRPL0xIXUZHIgzbzPwgqZsjQgs4oRM+WXHh/8lGZuB8=; b=DI5oP/pRoOu1y6nzlCLQ5p+lWqP5IMb77q6zFr2ufqaXVLLiacPMf62peqv6PxVRrC /F/S/saofoy+a0y6uMQtY9aF2ls7NLsBaXjFGlkvY7Q+v8+x4Rz3hMLmqxqp3XVPI/v9 gf/eg7V7XxAhl23PePJxEQE6R4RshPpf+51ELkq4P+whTO+rBD8PGWNcnplvwvREjqgI jwadevHAxldzYpzQAf8DQ1fE5olUWOLY9Mt4Wst/D8P970P8KyPH6YX+LKisRvPQyu94 hjITC+aG94Tkmps6n25oA8r+X4/3fi0rxF+5it43hef5dOACJTF3H75ex1Ia/mHhO6AM p68A== 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:content-transfer-encoding; bh=cRPL0xIXUZHIgzbzPwgqZsjQgs4oRM+WXHh/8lGZuB8=; b=mZ6sRM9CMUhithjVQxD59ODg7pBem4gSleyv3g9wPYNMQGy3ma2IW+wSl+hmia6bAF tqZtVUAlKmfZzK++mitFH4W6KdMBB/+etiduWQ/31VZMLf7/Li4wDsCxCY6PIq4Rwwt9 XHqZumd0PvijsBu957FA0I2AWl7XXBU3/dMWgOvGdKyYdqUP7VetsaueFYjqUroeJk0U 4y+n3F6sw7fjd8jHZo7D8FxwONrMPB/zfw3oyX15eCPjMvQX5QahOO9FZLQdynPSy/JA Y43iiv+6zrWgtAIQg9yFaFMtUCHSKxwPeZu1q0/4SCPscdFP5kit78ycJCAN6vX+82fV 437w== X-Gm-Message-State: AOAM533i2nTvwXyZrDDFmuOEOrDMoLtIXDTgGACGh70cim6XqBTVslZT 5i0rl00tOoDJpGagml0AD+jj9kNuQIvdn/jhjnc= X-Google-Smtp-Source: ABdhPJzmh92q+5v44BFYSROQSBTL2YdCBub8Xg7XGKCr7Vbt/CqTCxUoUuCtPOuFjLUcdO7uL5IFoEBaR6Aaqz79Txc= X-Received: by 2002:a17:906:48ce:: with SMTP id d14mr1977201ejt.336.1634932168461; Fri, 22 Oct 2021 12:49:28 -0700 (PDT) MIME-Version: 1.0 References: <927b122e-1f62-e790-f5ca-30bae4332c77@foss.st.com> <20211022212605.6ff8998a@thinkpad> In-Reply-To: <20211022212605.6ff8998a@thinkpad> From: Adam Ford Date: Fri, 22 Oct 2021 14:49:17 -0500 Message-ID: Subject: Re: Question: LTO and failing objcopy in "u-boot-initial-env" target To: =?UTF-8?B?TWFyZWsgQmVow7pu?= Cc: Patrick DELAUNAY , U-Boot Mailing List , Tom Rini , Simon Glass , Patrice CHOTARD , Marek Vasut , U-Boot STM32 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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.2 at phobos.denx.de X-Virus-Status: Clean On Fri, Oct 22, 2021 at 2:26 PM Marek Beh=C3=BAn wrote= : > > On Fri, 22 Oct 2021 14:19:16 -0500 > Adam Ford wrote: > > > I am not sure it's the right solution, but it appears to work for me > > on a board that uses LTO. I didn't try it with a board that doesn't > > use LTO. > > Need to be tested with GCC as well as Clang. Agreed. I turned off LTO, and got an error, so I updated the diff to: diff --git a/Makefile b/Makefile index 5194e4dc78..386180e935 100644 --- a/Makefile +++ b/Makefile @@ -2303,7 +2303,7 @@ endif $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost quiet_cmd_genenv =3D GENENV $@ -cmd_genenv =3D $(OBJCOPY) --dump-section .rodata.default_environment=3D$@ env/common.o; \ +cmd_genenv =3D $(OBJCOPY) --dump-section `${OBJDUMP} env/common.o -t |grep -m1 default_environment |awk '{print $$4}'`=3D$@ env/common.o; \ sed --in-place -e 's/\x00/\x0A/g' $@ u-boot-initial-env: u-boot.bin It now appears to build without error with LTO enabled and disabled. > > Marek