From: Peter Seiderer <ps.report@gmx.net>
To: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>, buildroot@buildroot.org
Subject: Re: [Buildroot] [PATCH 2/2 v2] linux: fix build with host-gcc 10+
Date: Mon, 31 Jan 2022 23:10:43 +0100 [thread overview]
Message-ID: <20220131231043.615b992b@gmx.net> (raw)
In-Reply-To: <c9dcef5830fdb5a83a625962702dccc093bb9a6c.1643665029.git.yann.morin.1998@free.fr>
Hello Yann,
one nitpick...
On Mon, 31 Jan 2022 22:38:09 +0100, "Yann E. MORIN" <yann.morin.1998@free.fr> wrote:
> Some older versions of linux, 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
>
> 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.
s/U-Boot/Linux kernel/
Regards,
Peter
>
> Upstream just dropped that line altogether:
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=e33a814e772cdc36436c8c188d8c42d019fda639
>
> 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>
>
> ---
> Changes v1 -> v2:
> - don't fail if no file to fix: use 'grep -Z |xargs -0 -r' (Arnout)
> ---
> linux/linux.mk | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/linux/linux.mk b/linux/linux.mk
> index dd2eebd446..410b714360 100644
> --- a/linux/linux.mk
> +++ b/linux/linux.mk
> @@ -268,6 +268,13 @@ endef
>
> LINUX_POST_PATCH_HOOKS += LINUX_APPLY_LOCAL_PATCHES
>
> +# Older versions break on gcc 10+ because of redefined symbols
> +define LINUX_DROP_YYLLOC
> + $(Q)grep -Z -l -r -E '^YYLTYPE yylloc;$$' $(@D) \
> + |xargs -0 -r $(SED) '/^YYLTYPE yylloc;$$/d'
> +endef
> +LINUX_POST_PATCH_HOOKS += LINUX_DROP_YYLLOC
> +
> # Older linux kernels use deprecated perl constructs in timeconst.pl
> # that were removed for perl 5.22+ so it breaks on newer distributions
> # Try a dry-run patch to see if this applies, if it does go ahead
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
next prev parent reply other threads:[~2022-01-31 22:11 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-31 21:38 [Buildroot] [PATCH 0/2 v2] linux|uboot: fix build with host-gcc 10+ for older versions (branch yem/yylloc) Yann E. MORIN
2022-01-31 21:38 ` [Buildroot] [PATCH 1/2 v2] boot/uboot: fix build with host-gcc 10+ Yann E. MORIN
2022-02-04 10:40 ` Giulio Benetti
2022-02-27 19:24 ` Peter Korsgaard
2022-01-31 21:38 ` [Buildroot] [PATCH 2/2 v2] linux: " Yann E. MORIN
2022-01-31 22:10 ` Peter Seiderer [this message]
2022-02-04 10:41 ` Giulio Benetti
2022-02-27 19:24 ` Peter Korsgaard
2022-02-12 20:38 ` [Buildroot] [PATCH 0/2 v2] linux|uboot: fix build with host-gcc 10+ for older versions (branch yem/yylloc) Arnout Vandecappelle
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=20220131231043.615b992b@gmx.net \
--to=ps.report@gmx.net \
--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.