Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 583198

Summary: cross-arm*/gcc: nesting level exceeded when compiling cross compiler for arm with clang
Product: Gentoo/Alt Reporter: Michael Weiser <michael>
Component: Prefix SupportAssignee: Gentoo Prefix <prefix>
Status: RESOLVED INVALID    
Severity: normal    
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: OS X   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: Make gcc compile as cross compiler for arm using clang

Description Michael Weiser 2016-05-16 16:18:42 UTC
When compiling gcc as a cross compiler for target arm with clang, I hit bug https://llvm.org/bugs/show_bug.cgi?id=19650:

.../gcc/config/arm/neon.md:3486:10917: fatal error:
     bracket nesting level exceeded maximum of 256
.../gcc/config/arm/neon.md:3486:10917: note: use
     -fbracket-depth=N to increase maximum nesting level

As the linked llvm upsteam bug and gcc mailing list discussion linked from there show, there is some contention who's actually at fault. A quick upstream fix does not seem to be forthcoming. So I changed the ebuild as shown in the attached patch to work around it.

Reproducible: Always
Comment 1 Michael Weiser 2016-05-16 16:19:21 UTC
Created attachment 434438 [details, diff]
Make gcc compile as cross compiler for arm using clang
Comment 2 Michael Weiser 2016-05-16 16:21:01 UTC
Ah, BTW, I'm not checking for compiling a cross compiler because I expect the same thing to happen when compiling using clang *on* arm for arm.
Comment 3 Michael Weiser 2016-06-19 23:05:34 UTC
Please disregard. This does not work. CFLAGS are still reset by toolchain.eclass. You need to set CFLAGS_${CTARGET//-/_}, i.e. CFLAGS_armv7ve_hardfloat_linux_gnueabi="-fbracket-depth=1024", to get them around toolchain's flags cleanliness. I've worked around it using an env snippet now.