From 75b337d909e191b20fcac4f1e4dad9737cb47e7e Mon Sep 17 00:00:00 2001 From: Khasim Mohammed Date: Wed, 19 Aug 2020 18:31:10 +0530 Subject: [PATCH] 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 Signed-off-by: Khasim Syed Mohammed Signed-off-by: Jon Mason --- .../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 00000000..f3ae5e5a --- /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 + +From 35b34d264cb347909ec89d9fa895900035d5438c Mon Sep 17 00:00:00 2001 +From: Dirk Mueller +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 +Signed-off-by: David Gibson +[robh: cherry-pick from upstream] +Cc: stable@vger.kernel.org +Signed-off-by: Rob Herring +Signed-off-by: Greg Kroah-Hartman +--- + 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 e2640e0c..c83d2589 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