diff --git a/device/testing/linux-xiaomi-scorpio/APKBUILD b/device/testing/linux-xiaomi-scorpio/APKBUILD
index cd85d97af4ea399f9a659d0800e470d46d6992c6..7d26c0721f07fef55abbd31c2396a86e06851621 100644
--- a/device/testing/linux-xiaomi-scorpio/APKBUILD
+++ b/device/testing/linux-xiaomi-scorpio/APKBUILD
@@ -13,7 +13,7 @@ license="GPL-2.0-only"
 options="!strip !check !tracedeps pmb:cross-native"
 makedepends="bash bc bison devicepkg-dev flex openssl-dev perl gcc6"
 
-# Compiler: GCC 6 (doesn't boot with newer versions)
+# Compiler: GCC 6 (doesn't boot when compiled with newer versions)
 if [ "${CC:0:5}" != "gcc6-" ]; then
 	CC="gcc6-$CC"
 	HOSTCC="gcc6-gcc"
@@ -27,7 +27,7 @@ _config="config-$_flavor.$arch"
 source="
 	$pkgname-$_commit.tar.gz::https://github.com/LineageOS/$_repository/archive/$_commit.tar.gz
 	$_config
-	remove-multiple-yylloc-definition.patch
+	gcc10-extern_YYLOC_global_declaration.patch
 	struct-rndis-incomplete-type.patch
 "
 builddir="$srcdir/$_repository-$_commit"
@@ -50,5 +50,5 @@ package() {
 
 sha512sums="97e9ef9f930923cee2351eeb22bc99c2df438701c17b88c221879fa336f84beb0328b772f0f19b2f39713a8d4f2d22139634f57ca6ade00f5190d7553db58002  linux-xiaomi-scorpio-8e27b438e8da6c6713b65da75f035438c45b05b9.tar.gz
 6062ed789e5da3491badbbbadc40b259524f688cea63f09502fa1e57c93a89ac397e29335375ccb80b71f55a0b021f6283a8c5f7b0c09ca64dbea08270c64935  config-xiaomi-scorpio.aarch64
-a24631b1dd20ac4dd3ee98ae9388459de2129e0e2d0280cbae734eefb403a75395d25a967b4234857e130b80c1e937077a192bfdbb9eaf1ad83613faeaa98ed6  remove-multiple-yylloc-definition.patch
+2b48f1bf0e3f70703d2cdafc47d5e615cc7c56c70bec56b2e3297d3fa4a7a1321d649a8679614553dde8fe52ff1051dae38d5990e3744c9ca986d92187dcdbeb  gcc10-extern_YYLOC_global_declaration.patch
 c64c63702c1638987640cf80dc8c36488ad0bc1c4ce6a875b9b98f3de1f1ae1435be7ff7f8b0b164f28ac79a22cf70f3d3fb6c28d8c162b7162ef8ac6f95e02d  struct-rndis-incomplete-type.patch"
diff --git a/device/testing/linux-xiaomi-scorpio/gcc10-extern_YYLOC_global_declaration.patch b/device/testing/linux-xiaomi-scorpio/gcc10-extern_YYLOC_global_declaration.patch
new file mode 120000
index 0000000000000000000000000000000000000000..fe99abf4d251a0c2a5596d67cc09a321bd5763f4
--- /dev/null
+++ b/device/testing/linux-xiaomi-scorpio/gcc10-extern_YYLOC_global_declaration.patch
@@ -0,0 +1 @@
+../../.shared-patches/linux/gcc10-extern_YYLOC_global_declaration.patch
\ No newline at end of file
diff --git a/device/testing/linux-xiaomi-scorpio/remove-multiple-yylloc-definition.patch b/device/testing/linux-xiaomi-scorpio/remove-multiple-yylloc-definition.patch
deleted file mode 100644
index a724cd49ead647619583ce53906d142d9993f1bc..0000000000000000000000000000000000000000
--- a/device/testing/linux-xiaomi-scorpio/remove-multiple-yylloc-definition.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-Remove a multiple definition of yylloc then add it as an extern in a shared header.
----
-diff --git a/scripts/dtc/dtc-lexer.l b/scripts/dtc/dtc-lexer.l
-index 3b41bfca636c..50fa3bda19bf 100644
---- a/scripts/dtc/dtc-lexer.l
-+++ b/scripts/dtc/dtc-lexer.l
-@@ -39,8 +39,6 @@ LINECOMMENT	"//".*\n
- #include "srcpos.h"
- #include "dtc-parser.tab.h"
- 
--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 2d30f41778b7..eb403e08a743 100644
---- a/scripts/dtc/dtc-lexer.lex.c_shipped
-+++ b/scripts/dtc/dtc-lexer.lex.c_shipped
-@@ -637,8 +637,6 @@ char *yytext;
- #include "srcpos.h"
- #include "dtc-parser.tab.h"
- 
--YYLTYPE yylloc;
--
- /* CAUTION: this will stop working if we ever use yyless() or yyunput() */
- #define	YY_USER_ACTION \
- 	{ \
-diff --git a/scripts/dtc/dtc-parser.tab.h_shipped b/scripts/dtc/dtc-parser.tab.h_shipped
-index b2e7a86cd85e..c24805ee6812 100644
---- a/scripts/dtc/dtc-parser.tab.h_shipped
-+++ b/scripts/dtc/dtc-parser.tab.h_shipped
-@@ -40,6 +40,8 @@
- extern int yydebug;
- #endif
- 
-+extern YYLTYPE yylloc;
-+
- /* Tokens.  */
- #ifndef YYTOKENTYPE
- # define YYTOKENTYPE
-