All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tom Rini <trini@konsulko.com>
To: Adam Ford <aford173@gmail.com>
Cc: "Marek Behún" <marek.behun@nic.cz>,
	"Patrick DELAUNAY" <patrick.delaunay@foss.st.com>,
	"U-Boot Mailing List" <u-boot@lists.denx.de>,
	"Simon Glass" <sjg@chromium.org>,
	"Patrice CHOTARD" <patrice.chotard@foss.st.com>,
	"Marek Vasut" <marex@denx.de>,
	"U-Boot STM32" <uboot-stm32@st-md-mailman.stormreply.com>
Subject: Re: Question: LTO and failing objcopy in "u-boot-initial-env" target
Date: Sat, 23 Oct 2021 13:25:54 -0400	[thread overview]
Message-ID: <20211023172554.GO3577824@bill-the-cat> (raw)
In-Reply-To: <CAHCN7xKB_QZU8=sNV4n_kyAX=LSjtqFM=1J-96Yom2NJJco0zA@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1408 bytes --]

On Fri, Oct 22, 2021 at 02:49:17PM -0500, Adam Ford wrote:
> On Fri, Oct 22, 2021 at 2:26 PM Marek Behún <marek.behun@nic.cz> wrote:
> >
> > On Fri, 22 Oct 2021 14:19:16 -0500
> > Adam Ford <aford173@gmail.com> 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 = GENENV  $@
> -cmd_genenv = $(OBJCOPY) --dump-section .rodata.default_environment=$@
> env/common.o; \
> +cmd_genenv = $(OBJCOPY) --dump-section `${OBJDUMP} env/common.o -t
> |grep -m1 default_environment |awk '{print $$4}'`=$@ 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.

I think LLVM is just not supportable without a different set of logic,
as env/common.o just isn't quite the same (with LTO it's an IR file,
without it's an object, but doesn't quite have that section?).

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

  reply	other threads:[~2021-10-23 17:26 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-22 15:16 Question: LTO and failing objcopy in "u-boot-initial-env" target Patrick DELAUNAY
2021-10-22 19:19 ` Adam Ford
2021-10-22 19:26   ` Marek Behún
2021-10-22 19:49     ` Adam Ford
2021-10-23 17:25       ` Tom Rini [this message]
2021-10-22 19:25 ` Marek Behún

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211023172554.GO3577824@bill-the-cat \
    --to=trini@konsulko.com \
    --cc=aford173@gmail.com \
    --cc=marek.behun@nic.cz \
    --cc=marex@denx.de \
    --cc=patrice.chotard@foss.st.com \
    --cc=patrick.delaunay@foss.st.com \
    --cc=sjg@chromium.org \
    --cc=u-boot@lists.denx.de \
    --cc=uboot-stm32@st-md-mailman.stormreply.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.