Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 20 Nov 2023 15:27:14 +0000
From:      "John F Carr" <jfc@mit.edu>
To:        FreeBSD ARM List <freebsd-arm@freebsd.org>
Subject:   Re: Setting CPUFLAGS breaks aarch64 13.2 -> 14.0 cross compile due to invalid -mcpu=
Message-ID:  <FB8E3163-315A-4067-9636-8B3AD290C4C8@mit.edu>
In-Reply-To: <CD745ECD-9550-4541-91B9-C9A611514611@mit.edu>
References:  <CD745ECD-9550-4541-91B9-C9A611514611@mit.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
On Nov 19, 2023, at 13:59, John F Carr <jfc@mit.edu> wrote:
>=20
> I have been building 13.2 with the following line in /etc/make.conf:
>=20
> CPUTYPE?=3Darmv8a+aes+crc+sha2
>=20
> This matches my processor (Ampere eMAG), which llvm does not
> know by name.
>=20
> Now I want to upgrade to 14.0.  I can't build from source on 13.2.
> Compiling 32 bit objects fails because $CPUTYPE is not valid
> for armv7.  Setting CPUTYPE_32?=3Darmv7 does not work either.
> That generates an invalid compiler option -mcpu=3Darmv7.
> Setting CPUTYPE=3Darmv7 needs to generate only -march=3Darmv7
> and not -mcpu=3Darmv7.  The make infrastructure generates both.
>=20
> Using an empty string for CPUTYPE_32 did not work either.
>=20
> According to /usr/share/examples/etc/make.conf, I should be
> able to use CPUTYPE=3Darmv7.
>=20
> Is this supposed to work?  Is there a /etc/make.conf variable that
> sets -march=3D but not -mcpu=3D?
>=20

The patch below fixes my problem and I have now upgraded to 14.0
without further difficulty.

commit 9c92d91a3a617f262c9c6907038f34805e1b8ecd (marmota)
Author: John F. Carr <jfc@mit.edu>
Date:   Mon Nov 20 10:07:30 2023 -0500

    Allow CPUFLAGS_32=3Darmv7

diff --git a/share/mk/bsd.compat.mk b/share/mk/bsd.compat.mk
index 0c387bcb020c..85f6c6d5932d 100644
--- a/share/mk/bsd.compat.mk
+++ b/share/mk/bsd.compat.mk
@@ -65,7 +65,7 @@ LIB32WMAKEFLAGS=3D      \
   .elif ${COMPAT_ARCH} =3D=3D "aarch64"
 HAS_COMPAT+=3D   32
-.if empty(LIB32CPUTYPE)
+.if empty(${LIB32CPUTYPE:Narmv7*})
 LIB32CPUFLAGS=3D -march=3Darmv7
 .else
 LIB32CPUFLAGS=3D -mcpu=3D${LIB32CPUTYPE}




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?FB8E3163-315A-4067-9636-8B3AD290C4C8>