Skip to contentSkip to conversation

New: Can't compile linux 5.4.8 (with gcc 10 on host)

Buildroot bugzilla at busybox.net 1 participant 2 messages Oct 5, 2020

lore
Share & tools
lore
#0 lore raw

https://bugs.busybox.net/show_bug.cgi?id=13236

Bug ID: 13236
Summary: Can't compile linux 5.4.8 (with gcc 10 on host)
Product: buildroot
Version: unspecified
Hardware: All
OS: Linux
Status: NEW
Severity: normal
Priority: P5
Component: Other
Assignee: unassigned at buildroot.uclibc.org
Reporter: cedric.chepied at gmail.com
CC: buildroot at uclibc.org
Target Milestone: ---

I'm trying to build an image for olimex olinuxino maxi board.

Linux 5.4.8 build fails with this error:

/usr/bin/ld?: scripts/dtc/dtc-parser.tab.o:(.bss+0x20)?: multiple definitions of ??yylloc??;

It looks very similar to this problem which seems to be solved for dtc package:

https://git.busybox.net/buildroot/commit/?id=198db470a73c14191915f8374362bc2a8b08c2bf

I solved it by applying this modification in linux build directory:
https://git.kernel.org/pub/scm/utils/dtc/dtc.git/commit/?id=0e9225eb0dfec51def612b928d2f1836b092bc7e

I don't know if this is a Linux bug or if it is fixed and you just have to pick a new version.

Signature · 2 lines
You are receiving this mail because:
You are on the CC list for the bug.
#1 lore raw

[Buildroot] [Bug 13236] Can't compile linux 5.4.8 (with gcc 10 on host)

https://bugs.busybox.net/show_bug.cgi?id=13236

Peter Korsgaard <[email protected]> changed:

What |Removed |Added
----------------------------------------------------------------------------

             Status|NEW                         |RESOLVED
         Resolution|---                         |INVALID

--- Comment #1 from Peter Korsgaard <[email protected]> --- This is indeed a Linux kernel bug and not really something we can do about (unless this is one of out defconfigs?) as you can specify a custom Linux kernel version.

The issue has been fixed in the upstream 5.4.x kernel since commit 35b34d264cb3479 (5.4.29):

commit 35b34d264cb347909ec89d9fa895900035d5438c

Author: Dirk Mueller <[email protected]>
Date:   Tue Jan 14 18:53:41 2020 +0100

scripts/dtc: Remove redundant YYLOC global declaration

commit e33a814e772cdc36436c8c188d8c42d019fda639 upstream.

gcc 10 will default to -fno-common, which causes this error at link time:

(.text+0x0): multiple definition of `yylloc'; dtc-lexer.lex.o (symbol
from plugin):(.text+0x0): first defined here

This is because both dtc-lexer as well as dtc-parser define the same global symbol yyloc. Before with -fcommon those were merged into one defintion. The proper solution would be to to mark this as "extern", however that leads to:

dtc-lexer.l:26:16: error: redundant redeclaration of 'yylloc'
[-Werror=redundant-decls]
26 | extern YYLTYPE yylloc;
| ^~~~~~
In file included from dtc-lexer.l:24:
dtc-parser.tab.h:127:16: note: previous declaration of 'yylloc' was here
127 | extern YYLTYPE yylloc;
| ^~~~~~
cc1: all warnings being treated as errors

which means the declaration is completely redundant and can just be dropped.

[robh: cherry-pick from upstream]
Cc stable at vger.kernel.org
Signature · 2 lines
You are receiving this mail because:
You are on the CC list for the bug.