Build error gcc 10.x (SOLVED, PLS FIX ON REPO)

During building for my minimum requirements, an error worked which requires a patch.

Error syntax

usr/bin/ld: scripts/dtc/dtc-parser.tab.o:(.bss+0x50): multiple definition of 'yylloc'; scripts/dtc/dtc-lexer.lex.o:

Fast fix:

#include "srcpos.h"
#include "dtc-parser.tab.h"

extern YYLTYPE yylloc; // OLD CODE: YYLTYPE yylloc;
extern bool treesource_error;

/* CAUTION: this will stop working if we ever use yyless() or yyunput() */
#define	YY_USER_ACTION \

or patch:

diff --git a/scripts/dtc/dtc-lexer.l b/scripts/dtc/dtc-lexer.l
index 3b41bfc..9b9c29e 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-parser.tab.c_shipped b/scripts/dtc/dtc-parser.tab.c_shipped
index ee1d8c3..699c3e5 100644
--- a/scripts/dtc/dtc-parser.tab.c_shipped
+++ b/scripts/dtc/dtc-parser.tab.c_shipped
@@ -73,7 +73,7 @@
 #include "dtc.h"
 #include "srcpos.h"

-YYLTYPE yylloc;
+extern YYLTYPE yylloc;

 extern int yylex(void);
 extern void print_error(char const *fmt, ...);

please fix the build bugs so you can comfortably use the new gcc 10.x

2 Likes

hello how to do patch can you tell pls

@xootkama,
I wrote a solution to the patch problem. If explained in words, find lines

YYLTYPE yylloc; in /scripts/dtc/dtc-lexer.l
YYLTYPE yylloc; in /scripts/dtc/dtc-parser.tab.c_shipped

and replace to

extern YYLTYPE yylloc;

I have this problem but i can not find the /scripts/dtc/ folder

Where is , i found for everywhere the repo but never says where is in debian

where is dtc-lexer.l