From 0a0307fab227bcce15e33c7bde94a9d7e60061e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Steinbei=C3=9Fer?= <33968289+gothicVI@users.noreply.github.com> Date: Thu, 25 Feb 2021 21:19:10 +0100 Subject: [PATCH] Remove redundant YYLOC global declaration Following https://github.com/Tomoms/android_kernel_oppo_msm8974/commit/11647f99b4de6bc460e106e876f72fc7af3e54a6 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 definition. Marking the symbol as extern seems sufficient in contrast to the above-linked commit message. Removing it breaks as described there breaks the build. --- scripts/dtc/dtc-lexer.lex.c_shipped | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/dtc/dtc-lexer.lex.c_shipped b/scripts/dtc/dtc-lexer.lex.c_shipped index 2d30f41778b7..d0eb405cb811 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 \