Skip to contentSkip to conversation

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

PATCH Applied Giulio Benetti 3 participants 4 messages Nov 12, 2021 – Nov 17, 2021

lore
Share & tools
lore
#0 lore raw

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

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

---
 ...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
board/olimex/a64-olinuxino/patches/linux/0001-scripts-dtc-Remove-redundant-YYLOC-global-declaratio.patch new file +52 -0
new file mode 100644
index 0000000000..71ae991816
@@ -0,0 +1,52 @@
+From f9df4186c17d686f1ca38f973d7a3a49e8e37c01 Mon Sep 17 00:00:00 2001
+From: Dirk Mueller <[email protected]>
+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 <[email protected]>
+Signed-off-by: David Gibson <[email protected]>
+[robh: cherry-pick from upstream]
+Cc: [email protected]
+Signed-off-by: Rob Herring <[email protected]>
+Signed-off-by: Giulio Benetti <[email protected]>
+---
+ 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
+
board/olimex/a64-olinuxino/patches/uboot/0001-Remove-redundant-YYLOC-global-declaration.patch new file +28 -0
new file mode 100644
index 0000000000..ec60fc5825
@@ -0,0 +1,28 @@
+From 018921ee79d3f30893614b3b2b63b588d8544f73 Mon Sep 17 00:00:00 2001
+From: Peter Robinson <[email protected]>
+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 <[email protected]>
+Signed-off-by: Giulio Benetti <[email protected]>
+---
+ 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
+
configs/olimex_a64_olinuxino_defconfig +3 -0
index e35c6014bd..7df52dfbdc 100644
@@ -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
 
Signature · 6 lines
2.25.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw
Quoted 7 lines · On Fri, 12 Nov 2021 19:05:56 +0100 Giulio Benetti…

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

Quoted 8 lines
---
 ...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

Signature · 7 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#2 lore raw

Hello Thomas,

Quoted 21 lines

Il giorno 14 nov 2021, alle ore 15:24, Thomas Petazzoni <[email protected]> ha scritto:

On Fri, 12 Nov 2021 19:05:56 +0100

Quoted 7 lines · Giulio Benetti

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

Quoted 8 lines

---

...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

Quoted 3 lines

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

Quoted 8 lines

Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#3 lore raw
In reply to Giulio Benetti
Quoted 10 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Giulio" == Giulio Benetti <[email protected]> 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

Committed to 2021.02.x and 2021.08.x, thanks.

Signature · 5 lines
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot