head -r358966 on aarch64 fails to build base/gcc6: fatal error: bracket nesting level exceeded maximum of 256

Mark Millard marklmi at yahoo.com
Mon Mar 23 17:58:27 UTC 2020



On 2020-Mar-23, at 09:48, John Baldwin <jhb at freebsd.org> wrote:

> On 3/20/20 11:02 PM, Mark Millard wrote:
>> While trying to build base/gcc6 on aarch64 (implicitly targeting aarch64:
>> self hosted), it failed with:
>> 
>> . . .
>> c++: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated [-Wdeprecated]
>> /wrkdirs/usr/ports/base/gcc6/work/gcc-6.5.0/gcc/config/aarch64/aarch64.md:817:10873: fatal error: bracket nesting level exceeded maximum of 256
>> /wrkdirs/usr/ports/base/gcc6/work/gcc-6.5.0/gcc/config/aarch64/aarch64.md:817:10873: note: use -fbracket-depth=N to increase maximum nesting level
>> 116 warnings and 1 error generated.
>> gmake[2]: *** [Makefile:1086: insn-attrtab.o] Error 1
>> gmake[2]: *** Waiting for unfinished jobs....
>> . . .
>> 
>> amd64 (implicitly targeting amd64: self hosted) did not have the problem.
>> 
>> (These were just build-ability tests, no intent to install as stands.)
>> 
>> base/binutils did not have such problems. (Actually installed on 32-bit
>> powerpc so more ports can build.)
> 
> I think the devel/freebsd-gcc* ports have a workaround for this when being built
> on aarch64.  We probably need the same fix for base/gcc when the build host is
> aarch64.

Looks like in devel/freebsd-gcc* such code is
like:

.if ${TARGETARCH} == "armv6" || ${TARGETARCH} == "aarch64"
. if ${COMPILER_TYPE} == clang
MAKE_ARGS+=CXXFLAGS=-fbracket-depth=512
. endif
.endif

There is no armv6 flavor in FLAVORS, nor armv7. But
having armv6 above but not armv7 looks a little odd.
(When I later tried base/gcc6 on an armv7 it also had
the problem.)

Also, TARGETARCH seems to be the target, not the
host. All hosts using clang get the larger
bracket depth for handling the listed arm targets,
if I read the above right.


base/gcc6 does not use FLAVOR and has:

TARGETARCH=     ${ARCH:S/amd64/x86_64/}

So, again, it looks like explicitly covering "armv7"
would be appropriate for base/gcc* examples that
can handle armv7 reasonably. (Unsure for gcc6.)

===
Mark Millard
marklmi at yahoo.com
( dsl-only.net went
away in early 2018-Mar)



More information about the freebsd-toolchain mailing list