Mon Apr 18 14:59:59 2022 UTC ()
rust: default to rust-llvm on NetBSD/sparc64.

(NetBSD)/sparc64 systems fail to build libunwind 13.0.1,
and libunwind is depended on here unless rust-llvm is turned
on.  The latter succeeds, though.  So default to using
rust-llvm on NetBSD/sparc64.
Ref. PR#56791


(he)
diff -r1.20 -r1.21 pkgsrc/lang/rust/options.mk

cvs diff -r1.20 -r1.21 pkgsrc/lang/rust/options.mk (expand / switch to unified diff)

--- pkgsrc/lang/rust/options.mk 2022/04/15 14:00:37 1.20
+++ pkgsrc/lang/rust/options.mk 2022/04/18 14:59:59 1.21
@@ -1,35 +1,44 @@ @@ -1,35 +1,44 @@
1# $NetBSD: options.mk,v 1.20 2022/04/15 14:00:37 he Exp $ 1# $NetBSD: options.mk,v 1.21 2022/04/18 14:59:59 he Exp $
2 2
3PKG_OPTIONS_VAR= PKG_OPTIONS.rust 3PKG_OPTIONS_VAR= PKG_OPTIONS.rust
4PKG_SUPPORTED_OPTIONS+= rust-cargo-static rust-docs 4PKG_SUPPORTED_OPTIONS+= rust-cargo-static rust-docs
5 5
6.include "../../mk/bsd.fast.prefs.mk" 6.include "../../mk/bsd.fast.prefs.mk"
7 7
8# The bundled LLVM current has issues building on SunOS. 8# The bundled LLVM current has issues building on SunOS.
9.if ${OPSYS} != "SunOS" 9.if ${OPSYS} != "SunOS"
10PKG_SUPPORTED_OPTIONS+= rust-llvm 10PKG_SUPPORTED_OPTIONS+= rust-llvm
11# There may be compatibility issues with base LLVM. 11# There may be compatibility issues with base LLVM.
12. if !empty(HAVE_LLVM) 12. if !empty(HAVE_LLVM)
13PKG_SUGGESTED_OPTIONS+= rust-llvm 13PKG_SUGGESTED_OPTIONS+= rust-llvm
14. endif 14. endif
15.endif 15.endif
16 16
17# Bundle OpenSSL and curl into the cargo binary when producing 17# Bundle OpenSSL and curl into the cargo binary when producing
18# bootstraps on NetBSD. 18# bootstraps on NetBSD.
19.if ${OPSYS} == "NetBSD" && ${BUILD_TARGET} == "dist" 19.if ${OPSYS} == "NetBSD" && ${BUILD_TARGET} == "dist"
20PKG_SUGGESTED_OPTIONS+= rust-cargo-static 20PKG_SUGGESTED_OPTIONS+= rust-cargo-static
21.endif 21.endif
22 22
 23# (NetBSD)/sparc64 systems fail to build libunwind 13.0.1,
 24# and libunwind is depended on here unless rust-llvm is turned
 25# on. The latter succeeds, though. So default to using
 26# rust-llvm on NetBSD/sparc64.
 27# Ref. PR#56791
 28.if !empty(MACHINE_PLATFORM:MNetBSD-*-sparc64)
 29PKG_SUGGESTED_OPTIONS+= rust-llvm
 30.endif
 31
23.include "../../mk/bsd.options.mk" 32.include "../../mk/bsd.options.mk"
24 33
25# 34#
26# Use the internal copy of LLVM or the external one? 35# Use the internal copy of LLVM or the external one?
27# The internal one contains some extra optimizations. 36# The internal one contains some extra optimizations.
28# 37#
29.if empty(PKG_OPTIONS:Mrust-llvm) 38.if empty(PKG_OPTIONS:Mrust-llvm)
30BUILDLINK_API_DEPENDS.llvm+= llvm>=12.0.0 39BUILDLINK_API_DEPENDS.llvm+= llvm>=12.0.0
31.include "../../lang/libunwind/buildlink3.mk" 40.include "../../lang/libunwind/buildlink3.mk"
32.include "../../lang/llvm/buildlink3.mk" 41.include "../../lang/llvm/buildlink3.mk"
33CONFIGURE_ARGS+= --enable-llvm-link-shared 42CONFIGURE_ARGS+= --enable-llvm-link-shared
34#CONFIGURE_ARGS+= --llvm-libunwind=system 43#CONFIGURE_ARGS+= --llvm-libunwind=system
35CONFIGURE_ARGS+= --llvm-root=${BUILDLINK_PREFIX.llvm} 44CONFIGURE_ARGS+= --llvm-root=${BUILDLINK_PREFIX.llvm}