snapos icon indicating copy to clipboard operation
snapos copied to clipboard

Compilation Error: Multiple Definition of `yylloc`

Open KennyStier opened this issue 4 years ago • 1 comments

Build Environment OS: Ubuntu 21.04 GCC: 10.3.0 (Ubuntu 10.3.0-1ubuntu1)

I tried following the buildroot instructions, but the build would fail in error:

  HOSTCC  scripts/dtc/dtc-lexer.lex.o
  HOSTCC  scripts/extract-cert
  HOSTCC  scripts/dtc/dtc-parser.tab.o
  HOSTLD  scripts/dtc/dtc
/usr/bin/ld: scripts/dtc/dtc-parser.tab.o:(.bss+0x10): 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:99: scripts/dtc/dtc] Error 1
make[3]: *** [scripts/Makefile.build:544: scripts/dtc] Error 2
make[3]: *** Waiting for unfinished jobs....
make[2]: *** [Makefile:1067: scripts] Error 2
make[1]: *** [package/pkg-generic.mk:294: /home/kenny/Downloads/SnapOS-build/buildroot/output/build/linux-custom/.stamp_built] Error 2

Should I be compiling this with an older version of gcc?

KennyStier avatar Sep 29 '21 02:09 KennyStier

What I do every time I encounter such an error: remove the offending definition. Probably this is due to bison's parsing changes in 3.0?

JDuchniewicz avatar Mar 17 '22 17:03 JDuchniewicz