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

Submitted by Khasim Mohammed on Aug. 19, 2020, 1:01 p.m. | Patch ID: 175454

Details

Message ID 20200819130110.25145-1-khasim.mohammed@arm.com
State New
Headers show

Commit Message

Khasim Mohammed Aug. 19, 2020, 1:01 p.m.
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
Signed-off-by: Khasim Syed Mohammed <khasim.mohammed@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
---
 .../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

Patch hide | download patch | download mbox

diff --git a/meta-arm-bsp/recipes-kernel/linux/linux-linaro-arm-5.4/n1sdp/scripts-dtc-remove-redundant-YYLOC.patch b/meta-arm-bsp/recipes-kernel/linux/linux-linaro-arm-5.4/n1sdp/scripts-dtc-remove-redundant-YYLOC.patch
new file mode 100644
index 0000000..f3ae5e5
--- /dev/null
+++ b/meta-arm-bsp/recipes-kernel/linux/linux-linaro-arm-5.4/n1sdp/scripts-dtc-remove-redundant-YYLOC.patch
@@ -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 <khasim.mohammed@arm.com>
+
+From 35b34d264cb347909ec89d9fa895900035d5438c Mon Sep 17 00:00:00 2001
+From: Dirk Mueller <dmueller@suse.com>
+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 <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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ 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
+
diff --git a/meta-arm-bsp/recipes-kernel/linux/linux-linaro-arm_5.4.bbappend b/meta-arm-bsp/recipes-kernel/linux/linux-linaro-arm_5.4.bbappend
index e2640e0..c83d258 100644
--- a/meta-arm-bsp/recipes-kernel/linux/linux-linaro-arm_5.4.bbappend
+++ b/meta-arm-bsp/recipes-kernel/linux/linux-linaro-arm_5.4.bbappend
@@ -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

Comments

Jon Mason Aug. 19, 2020, 7:02 p.m.
On Wed, Aug 19, 2020 at 06:31:10PM +0530, Khasim Mohammed wrote:
> 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
> Signed-off-by: Khasim Syed Mohammed <khasim.mohammed@arm.com>
> Signed-off-by: Jon Mason <jon.mason@arm.com>

Pulled into master.

Thanks,
Jon

> ---
>  .../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
> 
> diff --git a/meta-arm-bsp/recipes-kernel/linux/linux-linaro-arm-5.4/n1sdp/scripts-dtc-remove-redundant-YYLOC.patch b/meta-arm-bsp/recipes-kernel/linux/linux-linaro-arm-5.4/n1sdp/scripts-dtc-remove-redundant-YYLOC.patch
> new file mode 100644
> index 0000000..f3ae5e5
> --- /dev/null
> +++ b/meta-arm-bsp/recipes-kernel/linux/linux-linaro-arm-5.4/n1sdp/scripts-dtc-remove-redundant-YYLOC.patch
> @@ -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 <khasim.mohammed@arm.com>
> +
> +From 35b34d264cb347909ec89d9fa895900035d5438c Mon Sep 17 00:00:00 2001
> +From: Dirk Mueller <dmueller@suse.com>
> +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 <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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> +---
> + 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
> +
> diff --git a/meta-arm-bsp/recipes-kernel/linux/linux-linaro-arm_5.4.bbappend b/meta-arm-bsp/recipes-kernel/linux/linux-linaro-arm_5.4.bbappend
> index e2640e0..c83d258 100644
> --- a/meta-arm-bsp/recipes-kernel/linux/linux-linaro-arm_5.4.bbappend
> +++ b/meta-arm-bsp/recipes-kernel/linux/linux-linaro-arm_5.4.bbappend
> @@ -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
> -- 
> 2.17.1
> 

>
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#1055): https://lists.yoctoproject.org/g/meta-arm/message/1055
Mute This Topic: https://lists.yoctoproject.org/mt/76285645/3617530
Group Owner: meta-arm+owner@lists.yoctoproject.org
Unsubscribe: https://lists.yoctoproject.org/g/meta-arm/unsub  [oe-patchwork@oe-patch.openembedded.org]
-=-=-=-=-=-=-=-=-=-=-=-