diff mbox series

configs/olimex_a64_olinuxino_defconfig: backport gcc >= 10 u-boot and linux patch

Message ID 20211112180556.2124148-1-giulio.benetti@benettiengineering.com
State Accepted
Headers show
Series configs/olimex_a64_olinuxino_defconfig: backport gcc >= 10 u-boot and linux patch | expand

Commit Message

Giulio Benetti Nov. 12, 2021, 6:05 p.m. UTC
The old U-Boot version used does not build with hostcc >= 10. Backport a
patch fixing that issue. Same goes for Linux so let's backport a patch for
it too.

Fixes:
https://gitlab.com/buildroot.org/buildroot/-/jobs/1758966188

Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
---
 ...ve-redundant-YYLOC-global-declaratio.patch | 52 +++++++++++++++++++
 ...e-redundant-YYLOC-global-declaration.patch | 28 ++++++++++
 configs/olimex_a64_olinuxino_defconfig        |  3 ++
 3 files changed, 83 insertions(+)
 create mode 100644 board/olimex/a64-olinuxino/patches/linux/0001-scripts-dtc-Remove-redundant-YYLOC-global-declaratio.patch
 create mode 100644 board/olimex/a64-olinuxino/patches/uboot/0001-Remove-redundant-YYLOC-global-declaration.patch

Comments

Thomas Petazzoni Nov. 14, 2021, 2:24 p.m. UTC | #1
On Fri, 12 Nov 2021 19:05:56 +0100
Giulio Benetti <giulio.benetti@benettiengineering.com> wrote:

> The old U-Boot version used does not build with hostcc >= 10. Backport a
> patch fixing that issue. Same goes for Linux so let's backport a patch for
> it too.
> 
> Fixes:
> https://gitlab.com/buildroot.org/buildroot/-/jobs/1758966188
> 
> Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
> ---
>  ...ve-redundant-YYLOC-global-declaratio.patch | 52 +++++++++++++++++++
>  ...e-redundant-YYLOC-global-declaration.patch | 28 ++++++++++
>  configs/olimex_a64_olinuxino_defconfig        |  3 ++
>  3 files changed, 83 insertions(+)
>  create mode 100644 board/olimex/a64-olinuxino/patches/linux/0001-scripts-dtc-Remove-redundant-YYLOC-global-declaratio.patch
>  create mode 100644 board/olimex/a64-olinuxino/patches/uboot/0001-Remove-redundant-YYLOC-global-declaration.patch

Applied to master, thanks. However, it would be great (if you have the
hardware) to update to newer U-Boot/Linux versions, so we no longer
need those backported patches.

Thanks!

Thomas
Giulio Benetti Nov. 14, 2021, 3:22 p.m. UTC | #2
Hello Thomas,

> Il giorno 14 nov 2021, alle ore 15:24, Thomas Petazzoni <thomas.petazzoni@bootlin.com> ha scritto:
> 
> On Fri, 12 Nov 2021 19:05:56 +0100
> Giulio Benetti <giulio.benetti@benettiengineering.com> wrote:
> 
>> The old U-Boot version used does not build with hostcc >= 10. Backport a
>> patch fixing that issue. Same goes for Linux so let's backport a patch for
>> it too.
>> 
>> Fixes:
>> https://gitlab.com/buildroot.org/buildroot/-/jobs/1758966188
>> 
>> Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
>> ---
>> ...ve-redundant-YYLOC-global-declaratio.patch | 52 +++++++++++++++++++
>> ...e-redundant-YYLOC-global-declaration.patch | 28 ++++++++++
>> configs/olimex_a64_olinuxino_defconfig        |  3 ++
>> 3 files changed, 83 insertions(+)
>> create mode 100644 board/olimex/a64-olinuxino/patches/linux/0001-scripts-dtc-Remove-redundant-YYLOC-global-declaratio.patch
>> create mode 100644 board/olimex/a64-olinuxino/patches/uboot/0001-Remove-redundant-YYLOC-global-declaration.patch
> 
> Applied to master, thanks. However, it would be great (if you have the
> hardware) to update to newer U-Boot/Linux versions, so we no longer
> need those backported patches.

Yes, I had a patch ready with latest uboot/Linux and mainstream ATF. But my board is broken and I can’t test and there are too many changes.
Also, due to shortage of components(I think) I can’t buy an olinuxino a64 anywhere :-/
So I’m waiting to have it before resending. So I went for the smoother and safe approach.

Kind regards
Giulio

> 
> Thanks!
> 
> Thomas
> -- 
> Thomas Petazzoni, CTO, Bootlin
> Embedded Linux and Kernel engineering
> https://bootlin.com
Peter Korsgaard Nov. 17, 2021, 10:30 p.m. UTC | #3
>>>>> "Giulio" == Giulio Benetti <giulio.benetti@benettiengineering.com> writes:

 > The old U-Boot version used does not build with hostcc >= 10. Backport a
 > patch fixing that issue. Same goes for Linux so let's backport a patch for
 > it too.

 > Fixes:
 > https://gitlab.com/buildroot.org/buildroot/-/jobs/1758966188

 > Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>

Committed to 2021.02.x and 2021.08.x, thanks.
diff mbox series

Patch

diff --git a/board/olimex/a64-olinuxino/patches/linux/0001-scripts-dtc-Remove-redundant-YYLOC-global-declaratio.patch b/board/olimex/a64-olinuxino/patches/linux/0001-scripts-dtc-Remove-redundant-YYLOC-global-declaratio.patch
new file mode 100644
index 0000000000..71ae991816
--- /dev/null
+++ b/board/olimex/a64-olinuxino/patches/linux/0001-scripts-dtc-Remove-redundant-YYLOC-global-declaratio.patch
@@ -0,0 +1,52 @@ 
+From f9df4186c17d686f1ca38f973d7a3a49e8e37c01 Mon Sep 17 00:00:00 2001
+From: Dirk Mueller <dmueller@suse.com>
+Date: Tue, 14 Jan 2020 18:53:41 +0100
+Subject: [PATCH] scripts/dtc: Remove redundant YYLOC global declaration
+
+gcc 10 will default to -fno-common, which causes this error at link
+time:
+
+  (.text+0x0): multiple definition of `yylloc'; dtc-lexer.lex.o (symbol from plugin):(.text+0x0): first defined here
+
+This is because both dtc-lexer as well as dtc-parser define the same
+global symbol yyloc. Before with -fcommon those were merged into one
+defintion. The proper solution would be to to mark this as "extern",
+however that leads to:
+
+  dtc-lexer.l:26:16: error: redundant redeclaration of 'yylloc' [-Werror=redundant-decls]
+   26 | extern YYLTYPE yylloc;
+      |                ^~~~~~
+In file included from dtc-lexer.l:24:
+dtc-parser.tab.h:127:16: note: previous declaration of 'yylloc' was here
+  127 | extern YYLTYPE yylloc;
+      |                ^~~~~~
+cc1: all warnings being treated as errors
+
+which means the declaration is completely redundant and can just be
+dropped.
+
+Signed-off-by: Dirk Mueller <dmueller@suse.com>
+Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
+[robh: cherry-pick from upstream]
+Cc: stable@vger.kernel.org
+Signed-off-by: Rob Herring <robh@kernel.org>
+Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
+---
+ scripts/dtc/dtc-lexer.l | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/scripts/dtc/dtc-lexer.l b/scripts/dtc/dtc-lexer.l
+index 06c040902444..d1b3810156c7 100644
+--- a/scripts/dtc/dtc-lexer.l
++++ b/scripts/dtc/dtc-lexer.l
+@@ -38,7 +38,6 @@ LINECOMMENT	"//".*\n
+ #include "srcpos.h"
+ #include "dtc-parser.tab.h"
+ 
+-YYLTYPE yylloc;
+ extern bool treesource_error;
+ 
+ /* CAUTION: this will stop working if we ever use yyless() or yyunput() */
+-- 
+2.25.1
+
diff --git a/board/olimex/a64-olinuxino/patches/uboot/0001-Remove-redundant-YYLOC-global-declaration.patch b/board/olimex/a64-olinuxino/patches/uboot/0001-Remove-redundant-YYLOC-global-declaration.patch
new file mode 100644
index 0000000000..ec60fc5825
--- /dev/null
+++ b/board/olimex/a64-olinuxino/patches/uboot/0001-Remove-redundant-YYLOC-global-declaration.patch
@@ -0,0 +1,28 @@ 
+From 018921ee79d3f30893614b3b2b63b588d8544f73 Mon Sep 17 00:00:00 2001
+From: Peter Robinson <pbrobinson@gmail.com>
+Date: Thu, 30 Jan 2020 09:37:15 +0000
+Subject: [PATCH] Remove redundant YYLOC global declaration
+
+Same as the upstream fix for building dtc with gcc 10.
+
+Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
+Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
+---
+ scripts/dtc/dtc-lexer.l | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/scripts/dtc/dtc-lexer.l b/scripts/dtc/dtc-lexer.l
+index fd825ebba6..24af549977 100644
+--- a/scripts/dtc/dtc-lexer.l
++++ b/scripts/dtc/dtc-lexer.l
+@@ -38,7 +38,6 @@ LINECOMMENT	"//".*\n
+ #include "srcpos.h"
+ #include "dtc-parser.tab.h"
+ 
+-YYLTYPE yylloc;
+ extern bool treesource_error;
+ 
+ /* CAUTION: this will stop working if we ever use yyless() or yyunput() */
+-- 
+2.20.1
+
diff --git a/configs/olimex_a64_olinuxino_defconfig b/configs/olimex_a64_olinuxino_defconfig
index e35c6014bd..7df52dfbdc 100644
--- a/configs/olimex_a64_olinuxino_defconfig
+++ b/configs/olimex_a64_olinuxino_defconfig
@@ -2,6 +2,9 @@  BR2_aarch64=y
 BR2_cortex_a53=y
 BR2_ARM_FPU_VFPV4=y
 
+# System
+BR2_GLOBAL_PATCH_DIR="board/olimex/a64-olinuxino/patches"
+
 # Linux headers same as kernel, a 5.0 series
 BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_0=y