Skip to content

Commit

Permalink
scripts/dtc: Export YYLOC global declaration
Browse files Browse the repository at this point in the history
Building with GCC 10 gives this error:

 /usr/bin/ld: scripts/dtc/dtc-parser.tab.o:(.bss+0x50): \
   multiple definition of `yylloc'; scripts/dtc/dtc-lexer.lex.o:(.bss+0x0): first defined here
   collect2: error: ld returned 1 exit status
   make[4]: *** [scripts/Makefile.host:100: scripts/dtc/dtc] Error 1

commit e33a814e772c ("scripts/dtc: Remove redundant YYLOC global
declaration") fixes this in Mainline by removing the symbol
altogether.  However, this causes other 'not defined' issues in
android-3.18.

The original commit does mention that "the proper solution would be to
to mark this [symbol] as extern", which does not work in Mainline, but
does seem to satisfy android-3.18.

Signed-off-by: Lee Jones <[email protected]>
Change-Id: I4b5e7c8ae477c4eb6470472aad51ebddb128d7be
  • Loading branch information
Lee Jones authored and Simon1511 committed Feb 16, 2021
1 parent 9d33733 commit 5cbd527
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion scripts/dtc/dtc-lexer.l
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
2 changes: 1 addition & 1 deletion scripts/dtc/dtc-lexer.lex.c_shipped
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down

0 comments on commit 5cbd527

Please sign in to comment.