Build error gcc 10.x (SOLVED, PLS FIX ON REPO) multiple definition of 'yylloc'

常见错误:YYLTYPE yylloc;

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 

我受够了百度这辣鸡玩意了,最近用 manjaro gcc10 编译 rk 系列芯片经常出现这个问题,主要还是因为 gcc 太新了。

原文地址:https://www.cnblogs.com/juwan/p/14350954.html