pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

rust: checkpoint not-yet-finished support for mipsel-unknown-netbsd.



Module Name:	pkgsrc-wip
Committed By:	Havard Eidnes <he%NetBSD.org@localhost>
Pushed By:	he
Date:		Tue Nov 8 20:53:26 2022 +0000
Changeset:	c38518e4656abf02a17e7046db49a77e22a9832c

Modified Files:
	rust/Makefile
	rust/cross.mk
	rust/distinfo
	rust/do-cross.mk
	rust/patches/patch-compiler_rustc__target_src_spec_mod.rs
	rust/patches/patch-vendor_libc_src_unix_bsd_netbsdlike_netbsd_mod.rs
	rust/patches/patch-vendor_openssl-src_src_lib.rs
Added Files:
	rust/patches/patch-compiler_rustc__target_src_spec_mipsel__unknown__netbsd.rs
	rust/patches/patch-vendor_crossbea_no__atomic.rs
	rust/patches/patch-vendor_crossbeam-epch-0.9.6_no__atomic.rs
	rust/patches/patch-vendor_crossbeam-epoch-0.9.8_no__atomic.rs
	rust/patches/patch-vendor_crossbeam-epoch_no__atomic.rs
	rust/patches/patch-vendor_crossbeam-queue_no__atomic.rs
	rust/patches/patch-vendor_crossbeam-utils-0.8.0_no__atomic.rs
	rust/patches/patch-vendor_crossbeam-utils_no__atomic.rs
	rust/patches/patch-vendor_libc_src_unix_bsd_netbsdlike_netbsd_mips.rs
	rust/patches/patch-vendor_valuable_no__atomic.rs

Log Message:
rust: checkpoint not-yet-finished support for mipsel-unknown-netbsd.

For some yet-inexplicable reason, LLVM detects that it needs
to use -latomic for 64-bit atomics, but when it comes to linking
the mipsel target executables, that knowledge appears to be gone
(or wasn't transferred to the rust build itself) and we end up with

          threads_pthread.c:(.text.CRYPTO_atomic_add+0x10): undefined reference to `__atomic_is_lock_free'

which is during linking of

work/rustc-1.64.0-src/build/x86_64-unknown-netbsd/stage1-tools/mipsel-unknown-netbsd/release/deps/cargo-e77c167e2db88b27

The above symbol is present in -latomic, but if the gcc wrapper
invocation doesn't mention the library, the above is the result.
Assistance / hints appreciated.

The target root in /u/mipsel/dest is a "plain" 9.3 mipsel tree,
but with the libatomic package installed using "pkg_add -m mipsel
-P /u/mipsel/dest ...", and the binary can be had from

ftp://ftp.netbsd.org//pub/NetBSD/misc/he/libatomic-mipsel-9.3-12.2.0.tgz

The 9.3 mipsel tools should be placed in /u/mipsel/tools, all ref.
the cross.mk Makefile fragment.

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=c38518e4656abf02a17e7046db49a77e22a9832c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 rust/Makefile                                      | 55 ++++++++++++++++++++--
 rust/cross.mk                                      |  3 ++
 rust/distinfo                                      | 16 +++++--
 rust/do-cross.mk                                   |  4 ++
 ...stc__target_src_spec_mipsel__unknown__netbsd.rs | 26 ++++++++++
 .../patch-compiler_rustc__target_src_spec_mod.rs   |  5 +-
 rust/patches/patch-vendor_crossbea_no__atomic.rs   | 15 ++++++
 ...patch-vendor_crossbeam-epch-0.9.6_no__atomic.rs | 15 ++++++
 ...atch-vendor_crossbeam-epoch-0.9.8_no__atomic.rs | 15 ++++++
 .../patch-vendor_crossbeam-epoch_no__atomic.rs     | 15 ++++++
 .../patch-vendor_crossbeam-queue_no__atomic.rs     | 15 ++++++
 ...atch-vendor_crossbeam-utils-0.8.0_no__atomic.rs | 15 ++++++
 .../patch-vendor_crossbeam-utils_no__atomic.rs     | 15 ++++++
 ...dor_libc_src_unix_bsd_netbsdlike_netbsd_mips.rs | 29 ++++++++++++
 ...ndor_libc_src_unix_bsd_netbsdlike_netbsd_mod.rs | 15 +++++-
 rust/patches/patch-vendor_openssl-src_src_lib.rs   |  7 ++-
 rust/patches/patch-vendor_valuable_no__atomic.rs   | 12 +++++
 17 files changed, 265 insertions(+), 12 deletions(-)

diffs:
diff --git a/rust/Makefile b/rust/Makefile
index 56a7c94b17..7d9984de09 100644
--- a/rust/Makefile
+++ b/rust/Makefile
@@ -103,7 +103,9 @@ BUILD_TARGET?=		build
 
 .if !empty(MACHINE_PLATFORM:MNetBSD-*-powerpc) || \
     !empty(MACHINE_PLATFORM:MNetBSD-*-earmv[67]hf) || \
-    !empty(TARGET:Marmv[67]-unknown-netbsd-eabihf)
+    !empty(MACHINE_PLATFORM:MNetBSD-*-mipsel) || \
+    !empty(TARGET:Marmv[67]-unknown-netbsd-eabihf) || \
+    !empty(TARGET:Mmipsel-unknown-netbsd)
 # Bootstrapping on NetBSD/powerpc requires no debug-info from rustc
 # (both for amd64->powerpc built and powerpc->powerpc built bootstrap bits)
 # Also try to downsize the armv[67] build.
@@ -126,6 +128,13 @@ CONFIGURE_ARGS+=	--set llvm.targets="ARM"
 .if !empty(TARGET:Marmv[67]-unknown-netbsd-eabihf)
 CONFIGURE_ARGS+=	--set llvm.targets="ARM;X86"
 .endif
+# Same for mips:
+.if !empty(MACHINE_PLATFORM:MNetBSD-*-mipsel)
+CONFIGURE_ARGS+=	--set llvm.targets="Mips"
+.endif
+.if !empty(TARGET:Mmipsel-unknown-netbsd)
+CONFIGURE_ARGS+=	--set llvm.targets="Mips;X86"
+.endif
 
 .if ${OPSYS} == "NetBSD"
 # This block contains information about known trouble on NetBSD and workarounds.
@@ -354,6 +363,15 @@ DISTFILES:=			${DISTFILES} ${RUST_STAGE0} ${RUST_STD_STAGE0}
 SITES.${RUST_STAGE0}=		${MASTER_SITE_LOCAL:=rust/}
 SITES.${RUST_STD_STAGE0}=	${MASTER_SITE_LOCAL:=rust/}
 .endif
+.if !empty(MACHINE_PLATFORM:MNetBSD-*-mipsel) || make(distinfo) || make (makesum) || make(mdi)
+RUST_ARCH=			mipsel-unknown-netbsd
+RUST_STAGE0_VER=		1.63.0
+RUST_STAGE0:=			rust-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.xz
+RUST_STD_STAGE0:=		rust-std-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.xz
+DISTFILES:=			${DISTFILES} ${RUST_STAGE0} ${RUST_STD_STAGE0}
+SITES.${RUST_STAGE0}=		${MASTER_SITE_LOCAL:=rust/}
+SITES.${RUST_STD_STAGE0}=	${MASTER_SITE_LOCAL:=rust/}
+.endif
 
 # You may override RUST_BOOTSTRAP_PATH and RUST_ARCH in mk.conf
 # if you have a local bootstrap compiler.
@@ -392,11 +410,11 @@ CKSUMS+=	1a5dd77a916141a3398372a99278e05cfa9ec9ff56c99325afca6a6b7375c300
 
 CKSUM_CRATES+=	vendor/libc
 CKSUMS+=	cb1560bf8ffcc7b2726a27b433efac90e726292960626f3064bd2c6b7f861a55
-CKSUMS+=	683f56837b31b9f0f5bace3080c5242b86f57f71d1126e352be24af9874ab531
+CKSUMS+=	cea54f3eb0929a12fa9c2c07e647343f28fbb6d5394ef0f8e7331959fb540fd3
 CKSUMS+=	976b07a13e195840b67c166a62318abfa9ffc8d5ebbb0358f199dd213ec98d1b
 CKSUMS+=	ee760c856bb491d885e9458fb723c53db7988ba775e59ab5b9ee8be438e69cf4
 CKSUMS+=	cb1560bf8ffcc7b2726a27b433efac90e726292960626f3064bd2c6b7f861a55
-CKSUMS+=	683f56837b31b9f0f5bace3080c5242b86f57f71d1126e352be24af9874ab531
+CKSUMS+=	b4d5e82df95afc69a931db296be1ef6f40350af60029219587f64ca600f5f53d
 
 CKSUM_CRATES+=	vendor/lzma-sys
 CKSUMS+=	6fd5e9245db34c6f557b8bfcaf03db82fc88c3b06dbfbb5f03b2bcd138983ef9
@@ -414,6 +432,34 @@ CKSUM_CRATES+=	vendor/kqueue
 CKSUMS+=	900a966152b8fdccc4e953df94fa27024cb473f57f49df06cd8f2acaac869787
 CKSUMS+=	9bf215b1d26d7f12def8cbc3cdc2f89eabe9249f040911c4a44792fb417cc0fd
 
+CKSUM_CRATES+=	vendor/crossbeam-utils-0.8.8
+CKSUMS+=	71b5f78fd701ce604aa766dd3d825fa5bed774282aae4d6c31d7acb01b1b242f
+CKSUMS+=	8fe3bafee993fe92ef421e066b4ed3b75c52efd5f8676b8950d1b868f3a7abba
+
+CKSUM_CRATES+=	vendor/crossbeam
+CKSUMS+=	a2621c1b029c614fb0ab8e3f5cda2e839df88d90d26133181c1b901965f7eec4
+CKSUMS+=	1ca104253f186211d88627c66086278adf6cd8e17eaaa243b822106d5e95d637
+
+CKSUM_CRATES+=	vendor/crossbeam-utils
+CKSUMS+=	916ed15218bb7b75a4e0d432430e7134efd27ca43ca8a8766e0c90e89febb602
+CKSUMS+=	9203c99b493cf333be37410484eb3a1d7f9fccf5049aa5fd6fc9b89b20f946ed
+
+CKSUM_CRATES+=	vendor/crossbeam-epoch
+CKSUMS+=	916ed15218bb7b75a4e0d432430e7134efd27ca43ca8a8766e0c90e89febb602
+CKSUMS+=	9203c99b493cf333be37410484eb3a1d7f9fccf5049aa5fd6fc9b89b20f946ed
+
+CKSUM_CRATES+=	vendor/crossbeam-queue
+CKSUMS+=	71b5f78fd701ce604aa766dd3d825fa5bed774282aae4d6c31d7acb01b1b242f
+CKSUMS+=	8fe3bafee993fe92ef421e066b4ed3b75c52efd5f8676b8950d1b868f3a7abba
+
+CKSUM_CRATES+=	vendor/crossbeam-epoch-0.9.6
+CKSUMS+=	3529c0833bcd1e09a352d3bd1696d3666850c9b09fe2111bf1a783ec16a5f467
+CKSUMS+=	67fd5293c2f8d25fd2eaa4694198178c44e46e4db589fbf6f33459b200419e34
+
+CKSUM_CRATES+=	vendor/openssl-src
+CKSUMS+=	40cd1069246b552b04fcdfd13eb77b3a89194192f18c426b77377a78abbfd72f
+CKSUMS+=	0762dfc33f22810157225d9a78415ac3df6a89d589d1937cc58f75a6611e7fc9
+
 SUBST_CLASSES+=		cksum
 SUBST_STAGE.cksum=	pre-configure
 .for crate in ${CKSUM_CRATES}
@@ -614,7 +660,8 @@ BUILD_DEPENDS+=	compat80>=0:../../emulators/compat80
 .include "../../mk/atomic64.mk"
 # This is for when we build natively:
 .if !empty(MACHINE_PLATFORM:MNetBSD-*-powerpc) || \
-    !empty(MACHINE_PLATFORM:MNetBSD-*-i386)
+    !empty(MACHINE_PLATFORM:MNetBSD-*-i386) || \
+    !empty(MACHINE_PLATFORM:MNetBSD-*-mipsel)
 # Make libatomic library available via a unique directory:
 DEPENDS+=	libatomic-links>=0:../../devel/libatomic-links
 .endif
diff --git a/rust/cross.mk b/rust/cross.mk
index c6fecf3dc6..b50db435dd 100644
--- a/rust/cross.mk
+++ b/rust/cross.mk
@@ -20,6 +20,7 @@
 #CROSS_ROOT=		/u/evbarm64
 #CROSS_ROOT=		/u/evbarm64eb
 #CROSS_ROOT=		/u/i386
+#CROSS_ROOT=		/u/mipsel
 #CROSS_ROOT=		/
 #MAKE_ENV+=		CROSS_ROOT=${CROSS_ROOT}
 
@@ -31,6 +32,7 @@
 #GNU_CROSS_TARGET=	aarch64--netbsd
 #GNU_CROSS_TARGET=	aarch64_be--netbsd
 #GNU_CROSS_TARGET=	i486--netbsdelf
+#GNU_CROSS_TARGET=	mipsel--netbsd
 #MAKE_ENV+=		GNU_CROSS_TARGET=${GNU_CROSS_TARGET}
 
 # To cross-build rust, you need to specify
@@ -45,6 +47,7 @@
 #TARGET=		aarch64_be-unknown-netbsd
 #TARGET=		i686-unknown-netbsd
 #TARGET=		i586-unknown-netbsd
+#TARGET=		mipsel-unknown-netbsd
 #
 #SCRIPTS=		${WRKDIR}/scripts
 #CONFIGURE_ARGS+=	--host=${TARGET}
diff --git a/rust/distinfo b/rust/distinfo
index f6dcc909bb..c674b5ad6a 100644
--- a/rust/distinfo
+++ b/rust/distinfo
@@ -112,7 +112,8 @@ SHA1 (patch-compiler_rustc__codegen__ssa_src_back_linker.rs) = bfa0196fa53ac0fc9
 SHA1 (patch-compiler_rustc__llvm_build.rs) = 73f8225f6dea809da9381d78a8099d13c7c151c0
 SHA1 (patch-compiler_rustc__target_src_spec_aarch64__be__unknown__netbsd.rs) = c81d0d288699056ae45569f8d0a1c9bb08153ec4
 SHA1 (patch-compiler_rustc__target_src_spec_i586__unknown__netbsd.rs) = 71b5736952023931c94c6996e73cdcfc66b429fe
-SHA1 (patch-compiler_rustc__target_src_spec_mod.rs) = 8f1b5ced49fa66a646327a19f9eb0501fa2b01c7
+SHA1 (patch-compiler_rustc__target_src_spec_mipsel__unknown__netbsd.rs) = 41a6d29fca1419f8a89f9d0be0c190481c349d0e
+SHA1 (patch-compiler_rustc__target_src_spec_mod.rs) = 275120b9e07863a19c821064d9010c6fbb537044
 SHA1 (patch-compiler_rustc__target_src_spec_netbsd__base.rs) = 57b26a7eb55a4a8e9ec8c4fb8b3b318a25d5a78b
 SHA1 (patch-library_backtrace_src_symbolize_gimli.rs) = 32ab8ea3809cd4f6fee9fc0df5db47d76ccbd9d2
 SHA1 (patch-library_backtrace_src_symbolize_gimli_elf.rs) = 56621c10310914672a851cf5dfbf343a9ff4e1be
@@ -137,11 +138,20 @@ SHA1 (patch-vendor_backtrace_src_symbolize_gimli.rs) = b93148ff72a60a17c6a444f26
 SHA1 (patch-vendor_backtrace_src_symbolize_gimli_elf.rs) = 308538090d9ce11d206d6eef0e675581a1fc6e80
 SHA1 (patch-vendor_cc-1.0.69_src_lib.rs) = b5c0f795624b928b8b02fe01174e6a24e770adea
 SHA1 (patch-vendor_cc_src_lib.rs) = 2f6b0ad800b31cd33334f194651981491ecf7641
+SHA1 (patch-vendor_crossbea_no__atomic.rs) = 6054fa9cb00b9cc7d9125354702945ac22ad6aeb
+SHA1 (patch-vendor_crossbeam-epch-0.9.6_no__atomic.rs) = 96334fb4ceee3332b5f1c7750c93664485b01365
+SHA1 (patch-vendor_crossbeam-epoch-0.9.8_no__atomic.rs) = fce16287a86bfa54f4b138f0c4a6c477f2d2e217
+SHA1 (patch-vendor_crossbeam-epoch_no__atomic.rs) = ee6294d0cef62e843aa7d4e693cc72b1347ff6e1
+SHA1 (patch-vendor_crossbeam-queue_no__atomic.rs) = aaa732788e97803eb7e219614f5e7ff1d9dc1d0f
+SHA1 (patch-vendor_crossbeam-utils-0.8.0_no__atomic.rs) = 7f31d6c45ef843eb2595df58e46b0e44dded0cc9
+SHA1 (patch-vendor_crossbeam-utils_no__atomic.rs) = 4ada02a26490ca6fcd87af999bbb8cef48078060
 SHA1 (patch-vendor_kqueue_src_time.rs) = 21950e7d79fb88257bdb11b988f2a3ae0084ba3d
-SHA1 (patch-vendor_libc_src_unix_bsd_netbsdlike_netbsd_mod.rs) = 351e213fc07b0dc7c35d70d6a0c2ecc6b5b9056e
+SHA1 (patch-vendor_libc_src_unix_bsd_netbsdlike_netbsd_mips.rs) = 09326b70d7821b1742285c464c70b347400191d7
+SHA1 (patch-vendor_libc_src_unix_bsd_netbsdlike_netbsd_mod.rs) = cd974123dbefc1149abce884f91d9727e82bb8b6
 SHA1 (patch-vendor_libc_src_unix_solarish_mod.rs) = 8364e19ea09203d32494c37ff3db19fe3d6b9d8a
 SHA1 (patch-vendor_lzma-sys_config.h) = b654c7e129fa02697734bc87173f89b3056a5437
-SHA1 (patch-vendor_openssl-src_src_lib.rs) = af3827ec7398a2f78e0748e3ebb7497a26d4dbea
+SHA1 (patch-vendor_openssl-src_src_lib.rs) = 393b5dd0b5bd32c41cd60fec787ffb8a2dc3cd20
 SHA1 (patch-vendor_rustc-ap-rustc__target_src_spec_aarch64__be__unknown__netbsd.rs) = 4e86aec4c89db9a331950a12f8ec7b8aaa50eed7
 SHA1 (patch-vendor_stacker_src_lib.rs) = e00a1e95eb16540ff182715db778bf97ebd07a5e
 SHA1 (patch-vendor_target-lexicon_src_targets.rs) = e0c67288516ff8d379d6d1e7b05d4ab86f9ac0a7
+SHA1 (patch-vendor_valuable_no__atomic.rs) = 4c3415e08569c6330f238ff47b25ef229ab7b68f
diff --git a/rust/do-cross.mk b/rust/do-cross.mk
index 66f699b2b4..0325443928 100644
--- a/rust/do-cross.mk
+++ b/rust/do-cross.mk
@@ -13,6 +13,7 @@ SHORT_TARGETS+=	powerpc90
 SHORT_TARGETS+=	arm64
 SHORT_TARGETS+=	arm64_be
 SHORT_TARGETS+=	i386
+#SHORT_TARGETS+=	mipsel
 
 # Conditional local overrides of ROOT.* variables:
 .sinclude "local-roots.mk"
@@ -27,6 +28,7 @@ ROOT.powerpc90?=	/u/9.0-macppc
 ROOT.arm64?=		/u/evbarm64
 ROOT.arm64_be?=		/u/evbarm64eb
 ROOT.i386?=		/u/i386
+ROOT.mipsel?=		/u/mipsel
 
 # Mapping to GNU triple
 G_TGT.armv7=		armv7--netbsdelf-eabihf
@@ -37,6 +39,7 @@ G_TGT.powerpc90=	powerpc--netbsd
 G_TGT.arm64=		aarch64--netbsd
 G_TGT.arm64_be=		aarch64_be--netbsd
 G_TGT.i386=		i486--netbsdelf
+G_TGT.mipsel=		mipsel--netbsd
 
 # Mapping to rust's TARGET specification
 TGT.armv7=		armv7-unknown-netbsd-eabihf
@@ -47,6 +50,7 @@ TGT.powerpc90=		powerpc-unknown-netbsd
 TGT.arm64=		aarch64-unknown-netbsd
 TGT.arm64_be=		aarch64_be-unknown-netbsd
 TGT.i386=		i586-unknown-netbsd
+TGT.mipsel=		mipsel-unknown-netbsd
 
 # Optional target tweak for bootstrap files
 TT.powerpc90=		powerpc-unknown-netbsd90
diff --git a/rust/patches/patch-compiler_rustc__target_src_spec_mipsel__unknown__netbsd.rs b/rust/patches/patch-compiler_rustc__target_src_spec_mipsel__unknown__netbsd.rs
new file mode 100644
index 0000000000..225e3a7472
--- /dev/null
+++ b/rust/patches/patch-compiler_rustc__target_src_spec_mipsel__unknown__netbsd.rs
@@ -0,0 +1,26 @@
+$NetBSD$
+
+Add target spec for NetBSD/mipsel.
+
+--- compiler/rustc_target/src/spec/mipsel_unknown_netbsd.rs.orig	2022-11-06 18:16:59.750850353 +0000
++++ compiler/rustc_target/src/spec/mipsel_unknown_netbsd.rs	2022-11-06 18:14:10.846209169 +0000
+@@ -0,0 +1,19 @@
++use crate::abi::Endian;
++use crate::spec::{Target, TargetOptions};
++
++pub fn target() -> Target {
++    let mut base = super::netbsd_base::opts();
++    base.max_atomic_width = Some(32);
++
++    Target {
++	llvm_target: "mipsel-unknown-netbsd".into(),
++	pointer_width: 32,
++	data_layout: "e-m:m-p:32:32-i8:8:32-i16:16:32-i64:64-n32-S64".into(),
++	arch: "mips".into(),
++	options: TargetOptions {
++	    mcount: "__mcount".into(),
++	    endian: Endian::Little,
++	    ..base
++	},
++    }
++}
diff --git a/rust/patches/patch-compiler_rustc__target_src_spec_mod.rs b/rust/patches/patch-compiler_rustc__target_src_spec_mod.rs
index 5f107edb65..15922e087f 100644
--- a/rust/patches/patch-compiler_rustc__target_src_spec_mod.rs
+++ b/rust/patches/patch-compiler_rustc__target_src_spec_mod.rs
@@ -1,10 +1,10 @@
 $NetBSD$
 
-Add i586(pentium) and aarch64_be targets.
+Add i586(pentium), aarch64_be and mips NetBSD targets.
 
 --- compiler/rustc_target/src/spec/mod.rs.orig	2021-03-23 16:15:10.000000000 +0000
 +++ compiler/rustc_target/src/spec/mod.rs
-@@ -816,9 +816,11 @@ supported_targets! {
+@@ -898,9 +898,12 @@ supported_targets! {
      ("powerpc-unknown-openbsd", powerpc_unknown_openbsd),
  
      ("aarch64-unknown-netbsd", aarch64_unknown_netbsd),
@@ -13,6 +13,7 @@ Add i586(pentium) and aarch64_be targets.
      ("armv7-unknown-netbsd-eabihf", armv7_unknown_netbsd_eabihf),
      ("i686-unknown-netbsd", i686_unknown_netbsd),
 +    ("i586-unknown-netbsd", i586_unknown_netbsd),
++    ("mipsel-unknown-netbsd", mipsel_unknown_netbsd),
      ("powerpc-unknown-netbsd", powerpc_unknown_netbsd),
      ("sparc64-unknown-netbsd", sparc64_unknown_netbsd),
      ("x86_64-unknown-netbsd", x86_64_unknown_netbsd),
diff --git a/rust/patches/patch-vendor_crossbea_no__atomic.rs b/rust/patches/patch-vendor_crossbea_no__atomic.rs
new file mode 100644
index 0000000000..d6e95453b3
--- /dev/null
+++ b/rust/patches/patch-vendor_crossbea_no__atomic.rs
@@ -0,0 +1,15 @@
+$NetBSD$
+
+Add "mipsel-unknown-netbsd" to the list who don't have
+native 64-bit atomic ops.
+
+--- vendor/crossbeam/no_atomic.rs.orig	2022-09-19 15:35:01.000000000 +0000
++++ vendor/crossbeam/no_atomic.rs
+@@ -28,6 +28,7 @@ const NO_ATOMIC_64: &[&str] = &[
+     "mipsel-unknown-linux-musl",
+     "mipsel-unknown-linux-uclibc",
+     "mipsel-unknown-none",
++    "mipsel-unknown-netbsd",
+     "mipsisa32r6-unknown-linux-gnu",
+     "mipsisa32r6el-unknown-linux-gnu",
+     "powerpc-unknown-linux-gnu",
diff --git a/rust/patches/patch-vendor_crossbeam-epch-0.9.6_no__atomic.rs b/rust/patches/patch-vendor_crossbeam-epch-0.9.6_no__atomic.rs
new file mode 100644
index 0000000000..2b024e978b
--- /dev/null
+++ b/rust/patches/patch-vendor_crossbeam-epch-0.9.6_no__atomic.rs
@@ -0,0 +1,15 @@
+$NetBSD$
+
+Add "mipsel-unknown-netbsd" to the list who don't have 
+native 64-bit atomic ops.
+
+--- vendor/crossbeam-epoch-0.9.6/no_atomic.rs.orig	2022-09-19 15:35:01.000000000 +0000
++++ vendor/crossbeam-epoch-0.9.6/no_atomic.rs
+@@ -31,6 +31,7 @@ const NO_ATOMIC_64: &[&str] = &[
+     "mipsel-unknown-linux-musl",
+     "mipsel-unknown-linux-uclibc",
+     "mipsel-unknown-none",
++    "mipsel-unknown-netbsd",
+     "mipsisa32r6-unknown-linux-gnu",
+     "mipsisa32r6el-unknown-linux-gnu",
+     "powerpc-unknown-freebsd",
diff --git a/rust/patches/patch-vendor_crossbeam-epoch-0.9.8_no__atomic.rs b/rust/patches/patch-vendor_crossbeam-epoch-0.9.8_no__atomic.rs
new file mode 100644
index 0000000000..e430790bd0
--- /dev/null
+++ b/rust/patches/patch-vendor_crossbeam-epoch-0.9.8_no__atomic.rs
@@ -0,0 +1,15 @@
+$NetBSD$
+
+Add "mipsel-unknown-netbsd" to the list who don't have 
+native 64-bit atomic ops.
+
+--- vendor/crossbeam-epoch-0.9.8/no_atomic.rs.orig	2022-09-19 15:35:01.000000000 +0000
++++ vendor/crossbeam-epoch-0.9.8/no_atomic.rs
+@@ -36,6 +36,7 @@ const NO_ATOMIC_64: &[&str] = &[
+     "mipsel-unknown-linux-musl",
+     "mipsel-unknown-linux-uclibc",
+     "mipsel-unknown-none",
++    "mipsel-unknown-netbsd",
+     "mipsisa32r6-unknown-linux-gnu",
+     "mipsisa32r6el-unknown-linux-gnu",
+     "msp430-none-elf",
diff --git a/rust/patches/patch-vendor_crossbeam-epoch_no__atomic.rs b/rust/patches/patch-vendor_crossbeam-epoch_no__atomic.rs
new file mode 100644
index 0000000000..f5716f7dd7
--- /dev/null
+++ b/rust/patches/patch-vendor_crossbeam-epoch_no__atomic.rs
@@ -0,0 +1,15 @@
+$NetBSD$
+
+Add "mipsel-unknown-netbsd" to the list who don't have 
+native 64-bit atomic ops.
+
+--- vendor/crossbeam-epoch/no_atomic.rs.orig	2022-09-19 15:35:01.000000000 +0000
++++ vendor/crossbeam-epoch/no_atomic.rs
+@@ -36,6 +36,7 @@ const NO_ATOMIC_64: &[&str] = &[
+     "mipsel-unknown-linux-musl",
+     "mipsel-unknown-linux-uclibc",
+     "mipsel-unknown-none",
++    "mipsel-unknown-netbsd",
+     "mipsisa32r6-unknown-linux-gnu",
+     "mipsisa32r6el-unknown-linux-gnu",
+     "msp430-none-elf",
diff --git a/rust/patches/patch-vendor_crossbeam-queue_no__atomic.rs b/rust/patches/patch-vendor_crossbeam-queue_no__atomic.rs
new file mode 100644
index 0000000000..93a7def9f1
--- /dev/null
+++ b/rust/patches/patch-vendor_crossbeam-queue_no__atomic.rs
@@ -0,0 +1,15 @@
+$NetBSD$
+
+Add "mipsel-unknown-netbsd" to the list who don't have 
+native 64-bit atomic ops.
+
+--- vendor/crossbeam-queue/no_atomic.rs.orig	2022-09-19 15:35:01.000000000 +0000
++++ vendor/crossbeam-queue/no_atomic.rs
+@@ -36,6 +36,7 @@ const NO_ATOMIC_64: &[&str] = &[
+     "mipsel-unknown-linux-musl",
+     "mipsel-unknown-linux-uclibc",
+     "mipsel-unknown-none",
++    "mipsel-unknown-netbsd",
+     "mipsisa32r6-unknown-linux-gnu",
+     "mipsisa32r6el-unknown-linux-gnu",
+     "msp430-none-elf",
diff --git a/rust/patches/patch-vendor_crossbeam-utils-0.8.0_no__atomic.rs b/rust/patches/patch-vendor_crossbeam-utils-0.8.0_no__atomic.rs
new file mode 100644
index 0000000000..6757627c15
--- /dev/null
+++ b/rust/patches/patch-vendor_crossbeam-utils-0.8.0_no__atomic.rs
@@ -0,0 +1,15 @@
+$NetBSD$
+
+Add "mipsel-unknown-netbsd" to the list who don't have 
+native 64-bit atomic ops.
+
+--- vendor/crossbeam-utils-0.8.8/no_atomic.rs.orig	2022-09-19 15:35:01.000000000 +0000
++++ vendor/crossbeam-utils-0.8.8/no_atomic.rs
+@@ -36,6 +36,7 @@ const NO_ATOMIC_64: &[&str] = &[
+     "mipsel-unknown-linux-musl",
+     "mipsel-unknown-linux-uclibc",
+     "mipsel-unknown-none",
++    "mipsel-unknown-netbsd",
+     "mipsisa32r6-unknown-linux-gnu",
+     "mipsisa32r6el-unknown-linux-gnu",
+     "msp430-none-elf",
diff --git a/rust/patches/patch-vendor_crossbeam-utils_no__atomic.rs b/rust/patches/patch-vendor_crossbeam-utils_no__atomic.rs
new file mode 100644
index 0000000000..795173cd0a
--- /dev/null
+++ b/rust/patches/patch-vendor_crossbeam-utils_no__atomic.rs
@@ -0,0 +1,15 @@
+$NetBSD$
+
+Add "mipsel-unknown-netbsd" to the list who don't have 
+native 64-bit atomic ops.
+
+--- vendor/crossbeam-utils/no_atomic.rs.orig	2022-09-19 15:35:01.000000000 +0000
++++ vendor/crossbeam-utils/no_atomic.rs
+@@ -36,6 +36,7 @@ const NO_ATOMIC_64: &[&str] = &[
+     "mipsel-unknown-linux-musl",
+     "mipsel-unknown-linux-uclibc",
+     "mipsel-unknown-none",
++    "mipsel-unknown-netbsd",
+     "mipsisa32r6-unknown-linux-gnu",
+     "mipsisa32r6el-unknown-linux-gnu",
+     "msp430-none-elf",
diff --git a/rust/patches/patch-vendor_libc_src_unix_bsd_netbsdlike_netbsd_mips.rs b/rust/patches/patch-vendor_libc_src_unix_bsd_netbsdlike_netbsd_mips.rs
new file mode 100644
index 0000000000..695fe830a5
--- /dev/null
+++ b/rust/patches/patch-vendor_libc_src_unix_bsd_netbsdlike_netbsd_mips.rs
@@ -0,0 +1,29 @@
+# $NetBSD$
+
+Add mips support.
+
+--- vendor/libc/src/unix/bsd/netbsdlike/netbsd/mips.rs.orig	2022-11-06 22:14:03.866753983 +0000
++++ vendor/libc/src/unix/bsd/netbsdlike/netbsd/mips.rs	2022-11-06 22:07:15.448812020 +0000
+@@ -0,0 +1,22 @@
++use PT_FIRSTMACH;
++
++pub type c_long = i32;
++pub type c_ulong = u32;
++pub type c_char = i8;
++pub type __cpu_simple_lock_nv_t = ::c_int;
++
++// should be pub(crate), but that requires Rust 1.18.0
++cfg_if! {
++    if #[cfg(libc_const_size_of)] {
++        #[doc(hidden)]
++        pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_longlong>() - 1;
++    } else {
++        #[doc(hidden)]
++        pub const _ALIGNBYTES: usize = 8 - 1;
++    }
++}
++
++pub const PT_GETREGS: ::c_int = PT_FIRSTMACH + 1;
++pub const PT_SETREGS: ::c_int = PT_FIRSTMACH + 2;
++pub const PT_GETFPREGS: ::c_int = PT_FIRSTMACH + 3;
++pub const PT_SETFPREGS: ::c_int = PT_FIRSTMACH + 4;
diff --git a/rust/patches/patch-vendor_libc_src_unix_bsd_netbsdlike_netbsd_mod.rs b/rust/patches/patch-vendor_libc_src_unix_bsd_netbsdlike_netbsd_mod.rs
index cd519f6261..8f34746b55 100644
--- a/rust/patches/patch-vendor_libc_src_unix_bsd_netbsdlike_netbsd_mod.rs
+++ b/rust/patches/patch-vendor_libc_src_unix_bsd_netbsdlike_netbsd_mod.rs
@@ -4,7 +4,7 @@ Copy execinfo function definitions from openbsd's mod.rs.
 
 --- vendor/libc/src/unix/bsd/netbsdlike/netbsd/mod.rs.orig	2022-05-10 20:59:35.217463943 +0000
 +++ vendor/libc/src/unix/bsd/netbsdlike/netbsd/mod.rs
-@@ -2787,6 +2787,22 @@ extern "C" {
+@@ -2821,6 +2821,22 @@ extern "C" {
      pub fn kinfo_getvmmap(pid: ::pid_t, cntp: *mut ::size_t) -> *mut kinfo_vmentry;
  }
  
@@ -27,3 +27,16 @@ Copy execinfo function definitions from openbsd's mod.rs.
  cfg_if! {
      if #[cfg(target_arch = "aarch64")] {
          mod aarch64;
+@@ -2840,6 +2856,12 @@ cfg_if! {
+     } else if #[cfg(target_arch = "x86")] {
+         mod x86;
+         pub use self::x86::*;
++    } else if #[cfg(target_arch = "mips")] {
++        mod mips;
++        pub use self::mips::*;
++    } else if #[cfg(target_arch = "mipsel")] {
++        mod mips;
++        pub use self::mips::*;
+     } else {
+         // Unknown target_arch
+     }
diff --git a/rust/patches/patch-vendor_openssl-src_src_lib.rs b/rust/patches/patch-vendor_openssl-src_src_lib.rs
index a94c2fa472..b7ab3a1365 100644
--- a/rust/patches/patch-vendor_openssl-src_src_lib.rs
+++ b/rust/patches/patch-vendor_openssl-src_src_lib.rs
@@ -36,15 +36,18 @@ Provide defaults for the various NetBSD targets.
              "mips-unknown-linux-gnu" => "linux-mips32",
              "mips-unknown-linux-musl" => "linux-mips32",
              "mips64-unknown-linux-gnuabi64" => "linux64-mips64",
-@@ -265,6 +271,7 @@ impl Build {
+@@ -263,8 +269,10 @@ impl Build {
+             "mips64el-unknown-linux-muslabi64" => "linux64-mips64",
+             "mipsel-unknown-linux-gnu" => "linux-mips32",
              "mipsel-unknown-linux-musl" => "linux-mips32",
++            "mipsel-unknown-netbsd" => "BSD-generic32",
              "powerpc-unknown-freebsd" => "BSD-generic32",
              "powerpc-unknown-linux-gnu" => "linux-ppc",
 +            "powerpc-unknown-netbsd" => "BSD-generic32",
              "powerpc64-unknown-freebsd" => "BSD-generic64",
              "powerpc64-unknown-linux-gnu" => "linux-ppc64",
              "powerpc64-unknown-linux-musl" => "linux-ppc64",
-@@ -274,6 +281,7 @@ impl Build {
+@@ -274,6 +282,7 @@ impl Build {
              "riscv64gc-unknown-linux-gnu" => "linux-generic64",
              "s390x-unknown-linux-gnu" => "linux64-s390x",
              "s390x-unknown-linux-musl" => "linux64-s390x",
diff --git a/rust/patches/patch-vendor_valuable_no__atomic.rs b/rust/patches/patch-vendor_valuable_no__atomic.rs
new file mode 100644
index 0000000000..f214c98768
--- /dev/null
+++ b/rust/patches/patch-vendor_valuable_no__atomic.rs
@@ -0,0 +1,12 @@
+$NetBSD$
+
+--- vendor/valuable/no_atomic.rs.orig	2022-09-19 15:35:03.000000000 +0000
++++ vendor/valuable/no_atomic.rs
+@@ -30,6 +30,7 @@ const NO_ATOMIC_64: &[&str] = &[
+     "mipsel-unknown-linux-musl",
+     "mipsel-unknown-linux-uclibc",
+     "mipsel-unknown-none",
++    "mipsel-unknown-netbsd",
+     "mipsisa32r6-unknown-linux-gnu",
+     "mipsisa32r6el-unknown-linux-gnu",
+     "powerpc-unknown-freebsd",


Home | Main Index | Thread Index | Old Index