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 太新了。

posted @ 2021-01-30 22:57  Juwan  阅读(1152)  评论(0编辑  收藏  举报