linux-samsung-a5y17lte : add patch to fix kernel compilation with gcc10 (MR 1578)

Patch makes yyloc declaration extern.
This commit is contained in:
dzmitry 2020-09-15 09:43:03 +03:00 committed by Bart Ribbers
parent 2cd8cd1d17
commit ccfdf8b2b7
No known key found for this signature in database
GPG key ID: 699D16185DAFAE61
3 changed files with 43 additions and 1 deletions

View file

@ -0,0 +1,39 @@
Based on https://lkml.org/lkml/2020/4/1/1206. In original patch, YYLOC declaration was removed.
However, using original patch, which removes yylloc declaration on 3.18.14 kernel version results in 'yylloc not declared' error.
See part of the original description below:
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",
diff --git a/scripts/dtc/dtc-lexer.l b/scripts/dtc/dtc-lexer.l
index 3b41bfca636..9b9c29e6f31 100644
--- a/scripts/dtc/dtc-lexer.l
+++ b/scripts/dtc/dtc-lexer.l
@@ -39,7 +39,7 @@ LINECOMMENT "//".*\n
#include "srcpos.h"
#include "dtc-parser.tab.h"
-YYLTYPE yylloc;
+extern YYLTYPE yylloc;
/* CAUTION: this will stop working if we ever use yyless() or yyunput() */
#define YY_USER_ACTION \
diff --git a/scripts/dtc/dtc-lexer.lex.c_shipped b/scripts/dtc/dtc-lexer.lex.c_shipped
index 2d30f41778b..d0eb405cb81 100644
--- a/scripts/dtc/dtc-lexer.lex.c_shipped
+++ b/scripts/dtc/dtc-lexer.lex.c_shipped
@@ -637,7 +637,7 @@ char *yytext;
#include "srcpos.h"
#include "dtc-parser.tab.h"
-YYLTYPE yylloc;
+extern YYLTYPE yylloc;
/* CAUTION: this will stop working if we ever use yyless() or yyunput() */
#define YY_USER_ACTION \

View file

@ -3,7 +3,7 @@
pkgname=linux-samsung-a5y17lte
pkgver=3.18.14
pkgrel=5
pkgrel=6
pkgdesc="Samsung Galaxy A5 (2017) kernel fork"
arch="aarch64"
_carch="arm64"
@ -25,6 +25,7 @@ source="
fix_firmware_path.patch
gcc7-give-up-on-ilog2-const-optimizations.patch
gcc8-fix-put-user.patch
gcc10-extern_YYLOC_global_declaration.patch
0007-usb_gadget-set-random-rndis-host-MAC-address-to-prev.patch
qcacld-2.0.config
disable_wlan_werror.qcapatch
@ -82,6 +83,7 @@ c9944df60530b58936064eb23152d0b3e67ca469213fd15ba2e641920cf73ec9e9aa54691a0c6b9f
9e2fb4b559936fdf77634ed7b3b85b2431b79ae9304f58c97172ba933bbfa365291650b20ddce41993526e39ca866049b765f730690f446ef047d86873a5f710 fix_firmware_path.patch
77eba606a71eafb36c32e9c5fe5e77f5e4746caac292440d9fb720763d766074a964db1c12bc76fe583c5d1a5c864219c59941f5e53adad182dbc70bf2bc14a7 gcc7-give-up-on-ilog2-const-optimizations.patch
197d40a214ada87fcb2dfc0ae4911704b9a93354b75179cd6b4aadbb627a37ec262cf516921c84a8b1806809b70a7b440cdc8310a4a55fca5d2c0baa988e3967 gcc8-fix-put-user.patch
2b48f1bf0e3f70703d2cdafc47d5e615cc7c56c70bec56b2e3297d3fa4a7a1321d649a8679614553dde8fe52ff1051dae38d5990e3744c9ca986d92187dcdbeb gcc10-extern_YYLOC_global_declaration.patch
b5f7aed0d4c78fcd9ea6f65e11606c4d33004b45eed39017baa8b0a78db801396aa04ba7cd3a4a669c23f878f5462ae1b5f753e0e26b65c9962fd1e98855e524 0007-usb_gadget-set-random-rndis-host-MAC-address-to-prev.patch
83a432ab7e3ee3cae47b0c751cf0a268f4291411789a1cf9187ef003a0f09b46316c0669e92bd91d3062b3d020005e67aea6fbf48b8ef87ba9b7f3a86a44612b qcacld-2.0.config
23278ca0660f17723506ca5befea757d736bd2cf4f01bccfaf4c154f94d42828fc2f49fd599f3295623a65f85b3b89bea18389a65c63f82f0496a92e8e6d8d72 disable_wlan_werror.qcapatch

View file

@ -0,0 +1 @@
../../.shared-patches/linux/gcc10-extern_YYLOC_global_declaration.patch