Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 23 Mar 2020 10:58:17 -0700
From:      Mark Millard <marklmi@yahoo.com>
To:        John Baldwin <jhb@freebsd.org>
Cc:        FreeBSD Toolchain <freebsd-toolchain@freebsd.org>, freebsd-arm <freebsd-arm@freebsd.org>
Subject:   Re: head -r358966 on aarch64 fails to build base/gcc6: fatal error: bracket nesting level exceeded maximum of 256
Message-ID:  <1FFE6B7C-ED7D-4BA6-B276-F401E0913BAF@yahoo.com>
In-Reply-To: <e479539b-6ad9-d154-e384-9536a2158e26@FreeBSD.org>
References:  <879B19CB-5EBB-4114-8C13-199E1C2E491D.ref@yahoo.com> <879B19CB-5EBB-4114-8C13-199E1C2E491D@yahoo.com> <e479539b-6ad9-d154-e384-9536a2158e26@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help


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:
>>=20
>> . . .
>> 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=3DN 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....
>> . . .
>>=20
>> amd64 (implicitly targeting amd64: self hosted) did not have the =
problem.
>>=20
>> (These were just build-ability tests, no intent to install as =
stands.)
>>=20
>> base/binutils did not have such problems. (Actually installed on =
32-bit
>> powerpc so more ports can build.)
>=20
> 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} =3D=3D "armv6" || ${TARGETARCH} =3D=3D "aarch64"
. if ${COMPILER_TYPE} =3D=3D clang
MAKE_ARGS+=3DCXXFLAGS=3D-fbracket-depth=3D512
. 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=3D     ${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.)

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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1FFE6B7C-ED7D-4BA6-B276-F401E0913BAF>