Skip to contentSkip to conversation

arm-bsp/linux-linaro-arm: Fix multiple definition of `yylloc'

PATCH In review Khasim Mohammed 2 participants 2 messages Aug 19, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arm-bsp/linux-linaro-arm: Fix multiple definition of `yylloc'

Patch https://git.yoctoproject.org/cgit/cgit.cgi/linux-yocto/commit/scripts/dtc/dtc-lexer.l?h=v5.4.56&id=35b34d264cb347909ec89d9fa895900035d5438c
is applied to fix kernel build failure due to multiple definition of 'yyloc'.

Refer to the bug report https://bugzilla.yoctoproject.org/show_bug.cgi?id=14014 for more details.

Change-Id I801c6c40dc67ceea74993ccf26b077ba66ae58d8
---
 .../scripts-dtc-remove-redundant-YYLOC.patch  | 59 +++++++++++++++++++
 .../linux/linux-linaro-arm_5.4.bbappend       |  1 +
 2 files changed, 60 insertions(+)
 create mode 100644 meta-arm-bsp/recipes-kernel/linux/linux-linaro-arm-5.4/n1sdp/scripts-dtc-remove-redundant-YYLOC.patch
meta-arm-bsp/recipes-kernel/linux/linux-linaro-arm-5.4/n1sdp/scripts-dtc-remove-redundant-YYLOC.patch new file +59 -0
new file mode 100644
index 0000000..f3ae5e5
@@ -0,0 +1,59 @@
+Upstream-Status: Backport https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/log/scripts/dtc/dtc-lexer.l?h=v5.8
+Signed-off-by: Khasim Syed Mohammed <[email protected]>
+
+From 35b34d264cb347909ec89d9fa895900035d5438c Mon Sep 17 00:00:00 2001
+From: Dirk Mueller <[email protected]>
+Date: Tue, 14 Jan 2020 18:53:41 +0100
+Subject: scripts/dtc: Remove redundant YYLOC global declaration
+
+commit e33a814e772cdc36436c8c188d8c42d019fda639 upstream.
+
+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: Greg Kroah-Hartman <[email protected]>
+---
+ scripts/dtc/dtc-lexer.l | 1 -
+ 1 file changed, 1 deletion(-)
+
+(limited to 'scripts/dtc/dtc-lexer.l')
+
+diff --git a/scripts/dtc/dtc-lexer.l b/scripts/dtc/dtc-lexer.l
+index 5c6c3fd557d7..b3b7270300de 100644
+--- a/scripts/dtc/dtc-lexer.l
++++ b/scripts/dtc/dtc-lexer.l
+@@ -23,7 +23,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() */
+-- 
+cgit v1.2.2-1-g5e49
+
meta-arm-bsp/recipes-kernel/linux/linux-linaro-arm_5.4.bbappend +1 -0
index e2640e0..c83d258 100644
@@ -12,6 +12,7 @@ SRC_URI_append_n1sdp = " \
     file://0003-pcie-Add-quirk-for-the-Arm-Neoverse-N1SDP-platform.patch \
     file://0004-n1sdp-update-n1sdp-pci-quirk-for-SR-IOV-support.patch \
     file://enable-realtek-R8169.cfg \
+    file://scripts-dtc-remove-redundant-YYLOC.patch \
     "
 
 # Referring to commit TAG N1SDP-2020.03.26
Signature · 1 line
2.17.1
#1 lore raw
Quoted 8 lines · Khasim Mohammed

Patch https://git.yoctoproject.org/cgit/cgit.cgi/linux-yocto/commit/scripts/dtc/dtc-lexer.l?h=v5.4.56&id=35b34d264cb347909ec89d9fa895900035d5438c
is applied to fix kernel build failure due to multiple definition of 'yyloc'.

Refer to the bug report https://bugzilla.yoctoproject.org/show_bug.cgi?id=14014 for more details.

Change-Id I801c6c40dc67ceea74993ccf26b077ba66ae58d8

Pulled into master.

Thanks,
Jon

Quoted 88 lines
---
 .../scripts-dtc-remove-redundant-YYLOC.patch  | 59 +++++++++++++++++++
 .../linux/linux-linaro-arm_5.4.bbappend       |  1 +
 2 files changed, 60 insertions(+)
 create mode 100644 meta-arm-bsp/recipes-kernel/linux/linux-linaro-arm-5.4/n1sdp/scripts-dtc-remove-redundant-YYLOC.patch
meta-arm-bsp/recipes-kernel/linux/linux-linaro-arm-5.4/n1sdp/scripts-dtc-remove-redundant-YYLOC.patch new file +59 -0
new file mode 100644
index 0000000..f3ae5e5
@@ -0,0 +1,59 @@
+Upstream-Status: Backport https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/log/scripts/dtc/dtc-lexer.l?h=v5.8
+Signed-off-by: Khasim Syed Mohammed <[email protected]>
+
+From 35b34d264cb347909ec89d9fa895900035d5438c Mon Sep 17 00:00:00 2001
+From: Dirk Mueller <[email protected]>
+Date: Tue, 14 Jan 2020 18:53:41 +0100
+Subject: scripts/dtc: Remove redundant YYLOC global declaration
+
+commit e33a814e772cdc36436c8c188d8c42d019fda639 upstream.
+
+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: Greg Kroah-Hartman <[email protected]>
+---
+ scripts/dtc/dtc-lexer.l | 1 -
+ 1 file changed, 1 deletion(-)
+
+(limited to 'scripts/dtc/dtc-lexer.l')
+
+diff --git a/scripts/dtc/dtc-lexer.l b/scripts/dtc/dtc-lexer.l
+index 5c6c3fd557d7..b3b7270300de 100644
+--- a/scripts/dtc/dtc-lexer.l
++++ b/scripts/dtc/dtc-lexer.l
+@@ -23,7 +23,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() */
+-- 
+cgit v1.2.2-1-g5e49
+
meta-arm-bsp/recipes-kernel/linux/linux-linaro-arm_5.4.bbappend +1 -0
index e2640e0..c83d258 100644
@@ -12,6 +12,7 @@ SRC_URI_append_n1sdp = " \
     file://0003-pcie-Add-quirk-for-the-Arm-Neoverse-N1SDP-platform.patch \
     file://0004-n1sdp-update-n1sdp-pci-quirk-for-SR-IOV-support.patch \
     file://enable-realtek-R8169.cfg \
+    file://scripts-dtc-remove-redundant-YYLOC.patch \
     "
 
 # Referring to commit TAG N1SDP-2020.03.26
Signature · 1 line
2.17.1