rust: Add ugly fix for incorrect flags on macOS/arm64.

I've dug through the source code and removed loads of '-arch ' invocations but
still can't find the one that is incorrectly adding '-arch x86_64', so for now
we're just brute-force transforming it.
This commit is contained in:
jperkin 2022-07-15 07:03:30 +00:00
parent b00c611b66
commit bdd80f88b1

View file

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.262 2022/07/07 16:26:37 jperkin Exp $
# $NetBSD: Makefile,v 1.263 2022/07/15 07:03:30 jperkin Exp $
DISTNAME= rustc-1.60.0-src
PKGNAME= ${DISTNAME:S/rustc/rust/:S/-src//}
@ -162,6 +162,15 @@ MAKE_JOBS_SAFE?= no
#
BUILDLINK_TRANSFORM.NetBSD+= rm:-Wl,--enable-new-dtags
#
# Somewhere in the LLVM build "-arch x86_64" is passed on macOS/arm64 which
# breaks linking, see https://github.com/rust-lang/rust/issues/81790. Until
# this can be located (proving difficult!) we just force it.
#
.if !empty(MACHINE_PLATFORM:MDarwin-*-aarch64)
BUILDLINK_TRANSFORM+= opt:x86_64:arm64
.endif
.PHONY: pre-build-fix
#
# Rust unfortunately requires itself to build. On platforms which aren't