pkgsrc-WIP-changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
rust191: reduce diffs to lang/rust
Module Name: pkgsrc-wip
Committed By: Thomas Klausner <wiz%NetBSD.org@localhost>
Pushed By: wiz
Date: Fri Nov 7 12:28:59 2025 +0100
Changeset: f2913210c00dc8cb2daa115bf3b8f732f15e2cba
Modified Files:
rust191/Makefile
rust191/buildlink3.mk
rust191/cross.mk
rust191/files/gcc-wrap
rust191/options.mk
rust191/platform.mk
Log Message:
rust191: reduce diffs to lang/rust
To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=f2913210c00dc8cb2daa115bf3b8f732f15e2cba
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
diffstat:
rust191/Makefile | 6 +++---
rust191/buildlink3.mk | 8 ++++++--
rust191/cross.mk | 8 ++++----
rust191/files/gcc-wrap | 2 +-
rust191/options.mk | 15 ++++++++++++++-
rust191/platform.mk | 10 ++++++++--
6 files changed, 36 insertions(+), 13 deletions(-)
diffs:
diff --git a/rust191/Makefile b/rust191/Makefile
index e777f857cb..f9c7eb4e68 100644
--- a/rust191/Makefile
+++ b/rust191/Makefile
@@ -647,7 +647,7 @@ do-install:
# Turn off Address space layout randomization
# so that we can build firefox natively:
post-install:
- paxctl +a ${DESTDIR}/${PREFIX}/bin/rustc
+ paxctl +a ${DESTDIR}${PREFIX}/bin/rustc
.endif
SUBST_CLASSES+= destdir
@@ -708,8 +708,8 @@ stage0-bootstrap: install
)
.endif
.if ${OS_VARIANT} == "SmartOS"
- ${CP} -R ${DESTDIR}/${PREFIX}/bin ${BOOTSTRAP_TMPDIR}/
- ${CP} -R ${DESTDIR}/${PREFIX}/lib ${BOOTSTRAP_TMPDIR}/
+ ${CP} -R ${DESTDIR}${PREFIX}/bin ${BOOTSTRAP_TMPDIR}/
+ ${CP} -R ${DESTDIR}${PREFIX}/lib ${BOOTSTRAP_TMPDIR}/
${MKDIR} ${BOOTSTRAP_TMPDIR}/lib/pkgsrc
set -e; \
for lib in libgcc_s.so.1 libstdc++.so.6; do \
diff --git a/rust191/buildlink3.mk b/rust191/buildlink3.mk
index b8cd208042..d932a4d4fe 100644
--- a/rust191/buildlink3.mk
+++ b/rust191/buildlink3.mk
@@ -1,4 +1,4 @@
-# $NetBSD: buildlink3.mk,v 1.17 2025/03/31 16:38:43 jakllsch Exp $
+# $NetBSD: buildlink3.mk,v 1.18 2025/07/24 10:33:38 jperkin Exp $
BUILDLINK_TREE+= rust
@@ -13,9 +13,13 @@ BUILDLINK_API_DEPENDS.rust+= rust>=1.56.1
BUILDLINK_PKGSRCDIR.rust?= ../../wip/rust
BUILDLINK_PASSTHRU_DIRS+= ${PREFIX}/lib/rustlib
+.include "../../mk/bsd.fast.prefs.mk"
+
pkgbase:= rust
.include "../../mk/pkg-build-options.mk"
-.if empty(PKG_BUILD_OPTIONS.rust:Mrust-internal-llvm)
+# XXX: unclear why this is necessary, but is actively harmful on Darwin, and
+# likely broken for most uses anyway as rust defaults to DEPMETHOD=build.
+.if empty(PKG_BUILD_OPTIONS.rust:Mrust-internal-llvm) && ${OPSYS} != "Darwin"
. include "../../lang/libunwind/buildlink3.mk"
.endif
diff --git a/rust191/cross.mk b/rust191/cross.mk
index a9a53164f1..26d79473fb 100644
--- a/rust191/cross.mk
+++ b/rust191/cross.mk
@@ -1,4 +1,4 @@
-# $NetBSD: cross.mk,v 1.11 2023/07/10 12:01:24 he Exp $
+# $NetBSD: cross.mk,v 1.15 2025/08/25 17:51:11 wiz Exp $
# These settings may be used to cross-build rust.
#
@@ -20,8 +20,8 @@
#CROSS_ROOT= /u/evbarm64
#CROSS_ROOT= /u/evbarm64eb
#CROSS_ROOT= /u/i386
-#CROSS_ROOT= /u/riscv64
#CROSS_ROOT= /u/mipsel
+#CROSS_ROOT= /u/riscv64
#CROSS_ROOT= /
#MAKE_ENV+= CROSS_ROOT=${CROSS_ROOT}
@@ -33,8 +33,8 @@
#GNU_CROSS_TARGET= aarch64--netbsd
#GNU_CROSS_TARGET= aarch64_be--netbsd
#GNU_CROSS_TARGET= i486--netbsdelf
-#GNU_CROSS_TARGET= riscv64--netbsd
#GNU_CROSS_TARGET= mipsel--netbsd
+#GNU_CROSS_TARGET= riscv64--netbsd
#MAKE_ENV+= GNU_CROSS_TARGET=${GNU_CROSS_TARGET}
# To cross-build rust, you need to specify
@@ -49,8 +49,8 @@
#TARGET= aarch64_be-unknown-netbsd
#TARGET= i686-unknown-netbsd
#TARGET= i586-unknown-netbsd
-#TARGET= riscv64gc-unknown-netbsd
#TARGET= mipsel-unknown-netbsd
+#TARGET= riscv64gc-unknown-netbsd
#
#SCRIPTS= ${WRKDIR}/scripts
#CONFIGURE_ARGS+= --host=${TARGET}
diff --git a/rust191/files/gcc-wrap b/rust191/files/gcc-wrap
index 842e1bd266..b76d061236 100644
--- a/rust191/files/gcc-wrap
+++ b/rust191/files/gcc-wrap
@@ -203,5 +203,5 @@ else
fi
# Cannot echo to stdout, messes up e.g. "gcc -print-prog-name=ld" output...
-echo $cmd >> /tmp/gcc-wrap.log
+#echo $cmd >> /tmp/gcc-wrap.log
exec $cmd
diff --git a/rust191/options.mk b/rust191/options.mk
index 999196b96b..925667938a 100644
--- a/rust191/options.mk
+++ b/rust191/options.mk
@@ -1,4 +1,4 @@
-# $NetBSD: options.mk,v 1.26 2022/07/11 20:13:50 jperkin Exp $
+# $NetBSD: options.mk,v 1.49 2025/08/25 17:51:11 wiz Exp $
PKG_OPTIONS_VAR= PKG_OPTIONS.rust
PKG_SUPPORTED_OPTIONS+= rust-cargo-static rust-docs
@@ -40,6 +40,19 @@ GCC_REQD+= 12
. endif
.endif
+# Apparently, using pkgsrc LLVM 19.x does not work on
+# NetBSD/x86_64 9.x and NetBSD/i386 9.x unless rust is built
+# with a newer gcc than the platform-included 7.5.0. Ref.
+# https://gnats.netbsd.org/59435 and
+# https://mail-index.netbsd.org/pkgsrc-users/2025/05/20/msg041603.html
+# and following discussion.
+.if empty(PKG_OPTIONS:Mrust-internal-llvm)
+. if ${MACHINE_PLATFORM:MNetBSD-9.*-x86_64} || \
+ ${MACHINE_PLATFORM:MNetBSD-9.*-i386}
+GCC_REQD+= 10
+. endif
+.endif
+
# Fix for problem seen during rust-installer run w/rust 1.84.1 on macppc,
# "of course" experienced near the end of the build process:
# assertion "memcmp(mf_ptr(mf) - 1, mf_ptr(mf) - matches[i].dist - 2, matches[i].len) == 0" failed: file "xz-5.2/src/liblzma/lz/lz_encoder_mf.c", line 40, function "lzma_mf_find"
diff --git a/rust191/platform.mk b/rust191/platform.mk
index d3ef0fd1d6..ef0d07388c 100644
--- a/rust191/platform.mk
+++ b/rust191/platform.mk
@@ -1,4 +1,4 @@
-# $NetBSD: platform.mk,v 1.27 2024/08/01 15:24:39 tnn Exp $
+# $NetBSD: platform.mk,v 1.34 2025/10/02 16:59:50 nia Exp $
# This file encodes whether a given platform has support for rust.
@@ -16,11 +16,17 @@ RUST_PLATFORMS+= ${rust_os}-*-${rust_arch}
. endfor
.endfor
+# rust does not build in the VA space available on earm.
+# \todo Consider extension to other platforms.
+.if ${NATIVE_MACHINE_PLATFORM:M*-*-earm*}
+RUST_TYPE?= bin
+.endif
+
RUST_DIR?= ../../lang/rust
.for rust_platform in ${RUST_PLATFORMS}
. if !empty(MACHINE_PLATFORM:M${rust_platform})
-PLATFORM_SUPPORTS_RUST= yes
+PLATFORM_SUPPORTS_RUST?= yes
. endif
.endfor
PLATFORM_SUPPORTS_RUST?= no
Home |
Main Index |
Thread Index |
Old Index