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
Created attachment 434438 [details, diff] Make gcc compile as cross compiler for arm using clang
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.
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.