From: Arnout Vandecappelle <arnout@mind.be>
To: "Yann E. MORIN" <yann.morin.1998@free.fr>, buildroot@buildroot.org
Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Subject: Re: [Buildroot] [PATCH 1/2] boot/uboot: fix build with host-gcc 10+
Date: Mon, 31 Jan 2022 08:42:52 +0100 [thread overview]
Message-ID: <45a93a2b-2172-2cd2-8ccb-77f251e55dbc@mind.be> (raw)
In-Reply-To: <cb658b0784b6174058f01eb1db7ffb44885952f1.1643577025.git.yann.morin.1998@free.fr>
On 30/01/2022 22:10, Yann E. MORIN wrote:
> Some older versions of U-Boot, or custom versions (like forks for some
> boards), fail to build with host-gcc 10+, because of redefined symbols:
>
> HOSTLD scripts/dtc/dtc
> /usr/bin/ld: scripts/dtc/dtc-parser.tab.o:(.bss+0x10): multiple definition
> of `yylloc'; scripts/dtc/dtc-lexer.lex.o:(.bss+0x0): first defined here
> collect2: error: ld returned 1 exit status
> make[4]: *** [scripts/Makefile.host:106: scripts/dtc/dtc] E
>
> Since this has been fixed in recent-ish versions, we can't use an
> unconditionaly patch, so we must have a conditional patch. However, a
> patch may not always apply to arbitrary U-Boot versions or forks.
>
> Upstream just dropped that line altogether:
> https://source.denx.de/u-boot/u-boot/-/commit/018921ee79d3f30893614b3b2b63b588d8544f73
>
> So, we use a little sed-grep combo to do the exact same change.
>
> Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
> Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
> Cc: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
> ---
> boot/uboot/uboot.mk | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/boot/uboot/uboot.mk b/boot/uboot/uboot.mk
> index 574fc7089a..9415c4722a 100644
> --- a/boot/uboot/uboot.mk
> +++ b/boot/uboot/uboot.mk
> @@ -244,6 +244,12 @@ endef
> UBOOT_POST_EXTRACT_HOOKS += UBOOT_COPY_OLD_LICENSE_FILE
> UBOOT_POST_RSYNC_HOOKS += UBOOT_COPY_OLD_LICENSE_FILE
>
> +# Older versions break on gcc 10+ because of redefined symbols
> +define UBOOT_DROP_YYLLOC
> + $(SED) '/^YYLTYPE yylloc;$$/d' `grep -l -r -E '^YYLTYPE yylloc;$$' $(@D)`
Why not use
grep ... | xargs --no-run-if-empty $(SED) ...
which also avoids the "no input files" problem.
Also:
- Isn't it enough to search in $(@D)/scripts?
- I guess we should use -Z to make is 0-separated. I'm not a 100% sure, but I
vaguely remember encountering a U-Boot or Linux vendor fork which had file names
with spaces in them.
Regards,
Arnout
> +endef
> +UBOOT_POST_PATCH_HOOKS += UBOOT_DROP_YYLLOC
> +
> ifneq ($(ARCH_XTENSA_OVERLAY_FILE),)
> define UBOOT_XTENSA_OVERLAY_EXTRACT
> $(call arch-xtensa-overlay-extract,$(@D),u-boot)
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
next prev parent reply other threads:[~2022-01-31 7:43 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-30 21:10 [Buildroot] [PATCH 0/2] linux|uboot: fix build with host-gcc 10+ for older versions (branch yem/yylloc) Yann E. MORIN
2022-01-30 21:10 ` [Buildroot] [PATCH 1/2] boot/uboot: fix build with host-gcc 10+ Yann E. MORIN
2022-01-31 7:42 ` Arnout Vandecappelle [this message]
2022-01-31 17:13 ` Yann E. MORIN
2022-01-30 21:10 ` [Buildroot] [PATCH 2/2] linux: " Yann E. MORIN
2022-01-31 6:34 ` [Buildroot] [PATCH 0/2] linux|uboot: fix build with host-gcc 10+ for older versions (branch yem/yylloc) Yann E. MORIN
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=45a93a2b-2172-2cd2-8ccb-77f251e55dbc@mind.be \
--to=arnout@mind.be \
--cc=buildroot@buildroot.org \
--cc=thomas.petazzoni@bootlin.com \
--cc=yann.morin.1998@free.fr \
/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.