git: 670abe5a7d0a - main - Mk/Uses/cargo.mk: Strip features defined by CPUTYPE for aarch64 and armv7

From: Daniel Engberg <diizzy_at_FreeBSD.org>
Date: Sat, 06 May 2023 05:48:08 UTC
The branch main has been updated by diizzy:

URL: https://cgit.FreeBSD.org/ports/commit/?id=670abe5a7d0a49bdbd2fe7e536fda354a89dea3c

commit 670abe5a7d0a49bdbd2fe7e536fda354a89dea3c
Author:     Daniel Engberg <diizzy@FreeBSD.org>
AuthorDate: 2023-05-06 05:41:42 +0000
Commit:     Daniel Engberg <diizzy@FreeBSD.org>
CommitDate: 2023-05-06 05:47:44 +0000

    Mk/Uses/cargo.mk: Strip features defined by CPUTYPE for aarch64 and armv7
    
    Strip features from CPUTYPE set by make.conf as these are not supported
    by Rust compiler and causes build failures
    
    Approved by:    rust (pkubaj)
    Differential Revision:  https://reviews.freebsd.org/D39889
---
 Mk/Uses/cargo.mk | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Mk/Uses/cargo.mk b/Mk/Uses/cargo.mk
index 50146372fee1..b9c5e967755e 100644
--- a/Mk/Uses/cargo.mk
+++ b/Mk/Uses/cargo.mk
@@ -149,6 +149,8 @@ WITH_LTO=	yes
 RUSTFLAGS+=	${CFLAGS:M-march=*:S/-march=/-C target-cpu=/}
 .  elif ${ARCH:Mpowerpc*}
 RUSTFLAGS+=	${CFLAGS:M-mcpu=*:S/-mcpu=/-C target-cpu=/:S/power/pwr/}
+.  elif ${ARCH} == aarch64 || ${ARCH} == armv7
+RUSTFLAGS+=	-C target-cpu=${CPUTYPE:C/\+.+//g}
 .  else
 RUSTFLAGS+=	${CFLAGS:M-mcpu=*:S/-mcpu=/-C target-cpu=/}
 .  endif