pkgsrc-Changes archive

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

CVS commit: pkgsrc/lang/rust



Module Name:    pkgsrc
Committed By:   he
Date:           Sun Mar  3 14:53:33 UTC 2024

Modified Files:
        pkgsrc/lang/rust: Makefile options.mk platform.mk
        pkgsrc/lang/rust/patches: patch-compiler_rustc__llvm_build.rs
            patch-compiler_rustc__target_src_spec_mod.rs
            patch-library_backtrace_src_symbolize_gimli_elf.rs
            patch-src_bootstrap_bootstrap.py
            patch-src_tools_rust-installer_install-template.sh
            patch-vendor_libc_src_unix_solarish_mod.rs
            patch-vendor_target-lexicon_src_targets.rs
Added Files:
        pkgsrc/lang/rust/patches:
            patch-compiler_rustc__target_src_spec_base_netbsd.rs
            patch-compiler_rustc__target_src_spec_targets_mips64el__unknown__netbsd.rs
            patch-src_bootstrap_src_core_build__steps_compile.rs
            patch-src_bootstrap_src_core_build__steps_llvm.rs
            patch-src_bootstrap_src_core_builder.rs
            patch-src_bootstrap_src_lib.rs
            patch-vendor_libc-0.2.148_src_unix_bsd_netbsdlike+netbsd_mips.rs
            patch-vendor_libc-0.2.148_src_unix_bsd_netbsdlike_netbsd_mod.rs
            patch-vendor_libc-0.2.148_src_unix_bsd_netbsdlike_netbsd_riscv64.rs
            patch-vendor_libc-0.2.148_src_unix_solarish_mod.rs
            patch-vendor_libc-0.2.149_src_unix_bsd_netbsdlike_netbsd_mips.rs
            patch-vendor_libc-0.2.149_src_unix_bsd_netbsdlike_netbsd_mod.rs
            patch-vendor_libc-0.2.149_src_unix_bsd_netbsdlike_netbsd_riscv64.rs
            patch-vendor_libc-0.2.149_src_unix_solarish_mod.rs
Removed Files:
        pkgsrc/lang/rust/patches:
            patch-compiler_rustc__target_src_spec_i586__unknown__netbsd.rs
            patch-compiler_rustc__target_src_spec_mips64el__unknown__netbsd.rs
            patch-compiler_rustc__target_src_spec_mipsel__unknown__netbsd.rs
            patch-compiler_rustc__target_src_spec_netbsd__base.rs
            patch-src_bootstrap_builder.rs patch-src_bootstrap_compile.rs
            patch-src_bootstrap_lib.rs patch-src_bootstrap_llvm.rs
            patch-vendor_libc-0.2.138_src_unix_bsd_netbsdlike_netbsd_mips.rs
            patch-vendor_libc-0.2.138_src_unix_bsd_netbsdlike_netbsd_mod.rs
            patch-vendor_libc-0.2.138_src_unix_bsd_netbsdlike_netbsd_riscv64.rs
            patch-vendor_libc-0.2.140_src_unix_bsd_netbsdlike_netbsd_mips.rs
            patch-vendor_libc-0.2.140_src_unix_bsd_netbsdlike_netbsd_mod.rs
            patch-vendor_libc-0.2.140_src_unix_bsd_netbsdlike_netbsd_riscv64.rs
            patch-vendor_libc-0.2.140_src_unix_solarish_mod.rs
            patch-vendor_libc_src_unix_bsd_netbsdlike_netbsd_mips.rs
            patch-vendor_libc_src_unix_bsd_netbsdlike_netbsd_mod.rs
            patch-vendor_libc_src_unix_bsd_netbsdlike_netbsd_riscv64.rs

Log Message:
rust: Upgrade to version 1.75.0.

Pkgsrc changes:
 * Adjust patches and cargo checksums to new versions.
 * For an external LLVM, set dependency of llvm >= 16, in accordance
   with the upstream changes.
 * Mark that on NetBSD we now need >= 9.0, so 8.x is no longer supported.
 * On NetBSD/sparc64 10.x, we now need GCC 12 to build the embedded
   LLVM, which is version 17; apparently GCC 10.4 or 10.5 mis-compiles it,
   resulting in an illegal instruction fault during the build.
   Ref. https://github.com/rust-lang/rust/issues/117231

Upstream changes:

Version 1.75.0 (2023-12-28)
==========================

- [Stabilize `async fn` and return-position `impl Trait` in traits.]
  (https://github.com/rust-lang/rust/pull/115822/)
- [Allow function pointer signatures containing `&mut T` in `const` contexts.]
  (https://github.com/rust-lang/rust/pull/116015/)
- [Match `usize`/`isize` exhaustively with half-open ranges.]
  (https://github.com/rust-lang/rust/pull/116692/)
- [Guarantee that `char` has the same size and alignment as `u32`.]
  (https://github.com/rust-lang/rust/pull/116894/)
- [Document that the null pointer has the 0 address.]
  (https://github.com/rust-lang/rust/pull/116988/)
- [Allow partially moved values in `match`.]
  (https://github.com/rust-lang/rust/pull/103208/)
- [Add notes about non-compliant FP behavior on 32bit x86 targets.]
  (https://github.com/rust-lang/rust/pull/113053/)
- [Stabilize ratified RISC-V target features.]
  (https://github.com/rust-lang/rust/pull/116485/)

Compiler
--------

- [Rework negative coherence to properly consider impls that only
  partly overlap.] (https://github.com/rust-lang/rust/pull/112875/)
- [Bump `COINDUCTIVE_OVERLAP_IN_COHERENCE` to deny, and warn in dependencies.]
  (https://github.com/rust-lang/rust/pull/116493/)
- [Consider alias bounds when computing liveness in NLL.]
  (https://github.com/rust-lang/rust/pull/116733/)
- [Add the V (vector) extension to the `riscv64-linux-android` target spec.]
  (https://github.com/rust-lang/rust/pull/116618/)
- [Automatically enable cross-crate inlining for small functions]
  (https://github.com/rust-lang/rust/pull/116505)
- Add several new tier 3 targets:
    - [`csky-unknown-linux-gnuabiv2hf`]
      (https://github.com/rust-lang/rust/pull/117049/)
    - [`i586-unknown-netbsd`]
      (https://github.com/rust-lang/rust/pull/117170/)
    - [`mipsel-unknown-netbsd`]
      (https://github.com/rust-lang/rust/pull/117356/)

Refer to Rust's [platform support page][platform-support-doc]
for more information on Rust's tiered platform support.

Libraries
---------

- [Override `Waker::clone_from` to avoid cloning `Waker`s unnecessarily.]
  (https://github.com/rust-lang/rust/pull/96979/)
- [Implement `BufRead` for `VecDeque<u8>`.]
  (https://github.com/rust-lang/rust/pull/110604/)
- [Implement `FusedIterator` for `DecodeUtf16` when the inner iterator does.]
  (https://github.com/rust-lang/rust/pull/110729/)
- [Implement `Not, Bit{And,Or}{,Assign}` for IP addresses.]
  (https://github.com/rust-lang/rust/pull/113747/)
- [Implement `Default` for `ExitCode`.]
  (https://github.com/rust-lang/rust/pull/114589/)
- [Guarantee representation of None in NPO]
  (https://github.com/rust-lang/rust/pull/115333/)
- [Document when atomic loads are guaranteed read-only.]
  (https://github.com/rust-lang/rust/pull/115577/)
- [Broaden the consequences of recursive TLS initialization.]
  (https://github.com/rust-lang/rust/pull/116172/)
- [Windows: Support sub-millisecond sleep.]
  (https://github.com/rust-lang/rust/pull/116461/)
- [Fix generic bound of `str::SplitInclusive`'s `DoubleEndedIterator` impl]
  (https://github.com/rust-lang/rust/pull/100806/)
- [Fix exit status / wait status on non-Unix `cfg(unix)` platforms.]
  (https://github.com/rust-lang/rust/pull/115108/)

Stabilized APIs
---------------

- [`Atomic*::from_ptr`]
  (https://doc.rust-lang.org/stable/core/sync/atomic/struct.AtomicUsize.html#method.from_ptr)
- [`FileTimes`]
  (https://doc.rust-lang.org/stable/std/fs/struct.FileTimes.html)
- [`FileTimesExt`]
  (https://doc.rust-lang.org/stable/std/os/windows/fs/trait.FileTimesExt.html)
- [`File::set_modified`]
  (https://doc.rust-lang.org/stable/std/fs/struct.File.html#method.set_modified)
- [`File::set_times`]
  (https://doc.rust-lang.org/stable/std/fs/struct.File.html#method.set_times)
- [`IpAddr::to_canonical`]
  (https://doc.rust-lang.org/stable/core/net/enum.IpAddr.html#method.to_canonical)
- [`Ipv6Addr::to_canonical`]
  (https://doc.rust-lang.org/stable/core/net/struct.Ipv6Addr.html#method.to_canonical)
- [`Option::as_slice`]
  (https://doc.rust-lang.org/stable/core/option/enum.Option.html#method.as_slice)
- [`Option::as_mut_slice`]
  (https://doc.rust-lang.org/stable/core/option/enum.Option.html#method.as_mut_slice)
- [`pointer::byte_add`]
  (https://doc.rust-lang.org/stable/core/primitive.pointer.html#method.byte_add)
- [`pointer::byte_offset`]
  (https://doc.rust-lang.org/stable/core/primitive.pointer.html#method.byte_offset)
- [`pointer::byte_offset_from`]
  (https://doc.rust-lang.org/stable/core/primitive.pointer.html#method.byte_offset_from)
- [`pointer::byte_sub`]
  (https://doc.rust-lang.org/stable/core/primitive.pointer.html#method.byte_sub)
- [`pointer::wrapping_byte_add`]
  (https://doc.rust-lang.org/stable/core/primitive.pointer.html#method.wrapping_byte_add)
- [`pointer::wrapping_byte_offset`]
  (https://doc.rust-lang.org/stable/core/primitive.pointer.html#method.wrapping_byte_offset)
- [`pointer::wrapping_byte_sub`]
  (https://doc.rust-lang.org/stable/core/primitive.pointer.html#method.wrapping_byte_sub)

These APIs are now stable in const contexts:

- [`Ipv6Addr::to_ipv4_mapped`]
  (https://doc.rust-lang.org/stable/core/net/struct.Ipv6Addr.html#method.to_ipv4_mapped)
- [`MaybeUninit::assume_init_read`]
  (https://doc.rust-lang.org/stable/core/mem/union.MaybeUninit.html#method.assume_init_read)
- [`MaybeUninit::zeroed`]
  (https://doc.rust-lang.org/stable/core/mem/union.MaybeUninit.html#method.zeroed)
- [`mem::discriminant`]
  (https://doc.rust-lang.org/stable/core/mem/fn.discriminant.html)
- [`mem::zeroed`]
  (https://doc.rust-lang.org/stable/core/mem/fn.zeroed.html)

Cargo
-----

- [Add new packages to `[workspace.members]` automatically.]
  (https://github.com/rust-lang/cargo/pull/12779/)
- [Allow version-less `Cargo.toml` manifests.]
  (https://github.com/rust-lang/cargo/pull/12786/)
- [Make browser links out of HTML file paths.]
  (https://github.com/rust-lang/cargo/pull/12889)

Rustdoc
-------

- [Accept less invalid Rust in rustdoc.]
  (https://github.com/rust-lang/rust/pull/117450/)
- [Document lack of object safety on affected traits.]
  (https://github.com/rust-lang/rust/pull/113241/)
- [Hide `#[repr(transparent)]` if it isn't part of the public ABI.]
  (https://github.com/rust-lang/rust/pull/115439/)
- [Show enum discriminant if it is a C-like variant.]
  (https://github.com/rust-lang/rust/pull/116142/)

Compatibility Notes
-------------------

- [FreeBSD targets now require at least version 12.]
  (https://github.com/rust-lang/rust/pull/114521/)
- [Formally demote tier 2 MIPS targets to tier 3.]
  (https://github.com/rust-lang/rust/pull/115238/)
- [Make misalignment a hard error in `const` contexts.]
  (https://github.com/rust-lang/rust/pull/115524/)
- [Fix detecting references to packed unsized fields.]
  (https://github.com/rust-lang/rust/pull/115583/)
- [Remove support for compiler plugins.]
  (https://github.com/rust-lang/rust/pull/116412/)


To generate a diff of this commit:
cvs rdiff -u -r1.302 -r1.303 pkgsrc/lang/rust/Makefile
cvs rdiff -u -r1.34 -r1.35 pkgsrc/lang/rust/options.mk
cvs rdiff -u -r1.20 -r1.21 pkgsrc/lang/rust/platform.mk
cvs rdiff -u -r1.15 -r1.16 \
    pkgsrc/lang/rust/patches/patch-compiler_rustc__llvm_build.rs \
    pkgsrc/lang/rust/patches/patch-compiler_rustc__target_src_spec_mod.rs
cvs rdiff -u -r0 -r1.1 \
    pkgsrc/lang/rust/patches/patch-compiler_rustc__target_src_spec_base_netbsd.rs \
    pkgsrc/lang/rust/patches/patch-compiler_rustc__target_src_spec_targets_mips64el__unknown__netbsd.rs \
    pkgsrc/lang/rust/patches/patch-src_bootstrap_src_core_build__steps_compile.rs \
    pkgsrc/lang/rust/patches/patch-src_bootstrap_src_core_build__steps_llvm.rs \
    pkgsrc/lang/rust/patches/patch-src_bootstrap_src_core_builder.rs \
    pkgsrc/lang/rust/patches/patch-src_bootstrap_src_lib.rs \
    pkgsrc/lang/rust/patches/patch-vendor_libc-0.2.148_src_unix_bsd_netbsdlike+netbsd_mips.rs \
    pkgsrc/lang/rust/patches/patch-vendor_libc-0.2.148_src_unix_bsd_netbsdlike_netbsd_mod.rs \
    pkgsrc/lang/rust/patches/patch-vendor_libc-0.2.148_src_unix_bsd_netbsdlike_netbsd_riscv64.rs \
    pkgsrc/lang/rust/patches/patch-vendor_libc-0.2.148_src_unix_solarish_mod.rs \
    pkgsrc/lang/rust/patches/patch-vendor_libc-0.2.149_src_unix_bsd_netbsdlike_netbsd_mips.rs \
    pkgsrc/lang/rust/patches/patch-vendor_libc-0.2.149_src_unix_bsd_netbsdlike_netbsd_mod.rs \
    pkgsrc/lang/rust/patches/patch-vendor_libc-0.2.149_src_unix_bsd_netbsdlike_netbsd_riscv64.rs \
    pkgsrc/lang/rust/patches/patch-vendor_libc-0.2.149_src_unix_solarish_mod.rs
cvs rdiff -u -r1.10 -r0 \
    pkgsrc/lang/rust/patches/patch-compiler_rustc__target_src_spec_i586__unknown__netbsd.rs
cvs rdiff -u -r1.3 -r0 \
    pkgsrc/lang/rust/patches/patch-compiler_rustc__target_src_spec_mips64el__unknown__netbsd.rs \
    pkgsrc/lang/rust/patches/patch-src_bootstrap_llvm.rs \
    pkgsrc/lang/rust/patches/patch-vendor_libc-0.2.138_src_unix_bsd_netbsdlike_netbsd_mips.rs \
    pkgsrc/lang/rust/patches/patch-vendor_libc-0.2.138_src_unix_bsd_netbsdlike_netbsd_riscv64.rs \
    pkgsrc/lang/rust/patches/patch-vendor_libc_src_unix_bsd_netbsdlike_netbsd_riscv64.rs
cvs rdiff -u -r1.4 -r0 \
    pkgsrc/lang/rust/patches/patch-compiler_rustc__target_src_spec_mipsel__unknown__netbsd.rs \
    pkgsrc/lang/rust/patches/patch-vendor_libc_src_unix_bsd_netbsdlike_netbsd_mips.rs
cvs rdiff -u -r1.9 -r0 \
    pkgsrc/lang/rust/patches/patch-compiler_rustc__target_src_spec_netbsd__base.rs \
    pkgsrc/lang/rust/patches/patch-vendor_libc_src_unix_bsd_netbsdlike_netbsd_mod.rs
cvs rdiff -u -r1.6 -r1.7 \
    pkgsrc/lang/rust/patches/patch-library_backtrace_src_symbolize_gimli_elf.rs
cvs rdiff -u -r1.21 -r1.22 \
    pkgsrc/lang/rust/patches/patch-src_bootstrap_bootstrap.py
cvs rdiff -u -r1.29 -r0 \
    pkgsrc/lang/rust/patches/patch-src_bootstrap_builder.rs
cvs rdiff -u -r1.14 -r0 \
    pkgsrc/lang/rust/patches/patch-src_bootstrap_compile.rs
cvs rdiff -u -r1.21 -r0 pkgsrc/lang/rust/patches/patch-src_bootstrap_lib.rs
cvs rdiff -u -r1.12 -r1.13 \
    pkgsrc/lang/rust/patches/patch-src_tools_rust-installer_install-template.sh \
    pkgsrc/lang/rust/patches/patch-vendor_target-lexicon_src_targets.rs
cvs rdiff -u -r1.5 -r0 \
    pkgsrc/lang/rust/patches/patch-vendor_libc-0.2.138_src_unix_bsd_netbsdlike_netbsd_mod.rs
cvs rdiff -u -r1.2 -r0 \
    pkgsrc/lang/rust/patches/patch-vendor_libc-0.2.140_src_unix_bsd_netbsdlike_netbsd_mips.rs \
    pkgsrc/lang/rust/patches/patch-vendor_libc-0.2.140_src_unix_bsd_netbsdlike_netbsd_mod.rs \
    pkgsrc/lang/rust/patches/patch-vendor_libc-0.2.140_src_unix_bsd_netbsdlike_netbsd_riscv64.rs
cvs rdiff -u -r1.1 -r0 \
    pkgsrc/lang/rust/patches/patch-vendor_libc-0.2.140_src_unix_solarish_mod.rs
cvs rdiff -u -r1.13 -r1.14 \
    pkgsrc/lang/rust/patches/patch-vendor_libc_src_unix_solarish_mod.rs

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

Modified files:

Index: pkgsrc/lang/rust/Makefile
diff -u pkgsrc/lang/rust/Makefile:1.302 pkgsrc/lang/rust/Makefile:1.303
--- pkgsrc/lang/rust/Makefile:1.302     Mon Jan 15 15:15:01 2024
+++ pkgsrc/lang/rust/Makefile   Sun Mar  3 14:53:32 2024
@@ -1,9 +1,8 @@
-# $NetBSD: Makefile,v 1.302 2024/01/15 15:15:01 jperkin Exp $
+# $NetBSD: Makefile,v 1.303 2024/03/03 14:53:32 he Exp $
 
-DISTNAME=      rustc-1.74.1-src
+DISTNAME=      rustc-1.75.0-src
 PKGNAME=       ${DISTNAME:S/rustc/rust/:S/-src//}
 CATEGORIES=    lang
-PKGREVISION=   1
 MASTER_SITES=  https://static.rust-lang.org/dist/
 
 MAINTAINER=    pkgsrc-users%NetBSD.org@localhost
@@ -14,10 +13,9 @@ LICENSE=     mit OR apache-2.0
 CONFLICTS+=    rust-bin-[0-9]*
 
 # LLVM uses -std=c++17
-USE_CXX_FEATURES+=      c++17
-
+USE_CXX_FEATURES+=     c++17
 USE_GCC_RUNTIME=       yes
-USE_LANGUAGES=         c c++17
+USE_LANGUAGES=         c c++
 USE_LIBTOOL=           yes
 USE_TOOLS+=            bash grep gmake perl:build pkg-config
 
@@ -221,49 +219,49 @@ BUILDLINK_TRANSFORM+=     opt:x86_64:arm64
 DISTFILES:=            ${DEFAULT_DISTFILES}
 
 .if ${MACHINE_PLATFORM:MDarwin-*-aarch64} || make(distinfo) || make (makesum) || make(mdi)
-RUST_STAGE0_VER=       1.73.0
+RUST_STAGE0_VER=       1.74.1
 RUST_ARCH:=            aarch64-apple-darwin
 RUST_STAGE0:=          rust-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.gz
 RUST_STD_STAGE0:=      rust-std-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.gz
 DISTFILES:=            ${DISTFILES} ${RUST_STAGE0} ${RUST_STD_STAGE0}
 .endif
 .if ${MACHINE_PLATFORM:MDarwin-*-x86_64} || make(distinfo) || make (makesum) || make(mdi)
-RUST_STAGE0_VER=       1.73.0
+RUST_STAGE0_VER=       1.74.1
 RUST_ARCH:=            x86_64-apple-darwin
 RUST_STAGE0:=          rust-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.gz
 RUST_STD_STAGE0:=      rust-std-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.gz
 DISTFILES:=            ${DISTFILES} ${RUST_STAGE0} ${RUST_STD_STAGE0}
 .endif
 .if ${MACHINE_PLATFORM:MLinux-*-aarch64} || make(distinfo) || make (makesum) || make(mdi)
-RUST_STAGE0_VER=       1.73.0
+RUST_STAGE0_VER=       1.74.1
 RUST_ARCH:=            aarch64-unknown-linux-gnu
 RUST_STAGE0:=          rust-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.gz
 RUST_STD_STAGE0:=      rust-std-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.gz
 DISTFILES:=            ${DISTFILES} ${RUST_STAGE0} ${RUST_STD_STAGE0}
 .endif
 .if ${MACHINE_PLATFORM:MLinux-*-earmv6hf} || make(distinfo) || make (makesum) || make(mdi)
-RUST_STAGE0_VER=       1.73.0
+RUST_STAGE0_VER=       1.74.1
 RUST_ARCH:=            arm-unknown-linux-gnueabihf
 RUST_STAGE0:=          rust-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.gz
 RUST_STD_STAGE0:=      rust-std-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.gz
 DISTFILES:=            ${DISTFILES} ${RUST_STAGE0} ${RUST_STD_STAGE0}
 .endif
 .if ${MACHINE_PLATFORM:MLinux-*-earmv7hf} || make(distinfo) || make (makesum) || make(mdi)
-RUST_STAGE0_VER=       1.73.0
+RUST_STAGE0_VER=       1.74.1
 RUST_ARCH:=            armv7-unknown-linux-gnueabihf
 RUST_STAGE0:=          rust-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.gz
 RUST_STD_STAGE0:=      rust-std-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.gz
 DISTFILES:=            ${DISTFILES} ${RUST_STAGE0} ${RUST_STD_STAGE0}
 .endif
 .if ${MACHINE_PLATFORM:MLinux-*-i386} || make(distinfo) || make (makesum) || make(mdi)
-RUST_STAGE0_VER=       1.73.0
+RUST_STAGE0_VER=       1.74.1
 RUST_ARCH:=            i686-unknown-linux-gnu
 RUST_STAGE0:=          rust-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.gz
 RUST_STD_STAGE0:=      rust-std-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.gz
 DISTFILES:=            ${DISTFILES} ${RUST_STAGE0} ${RUST_STD_STAGE0}
 .endif
 .if ${MACHINE_PLATFORM:MLinux-*-x86_64} || make(distinfo) || make (makesum) || make(mdi)
-RUST_STAGE0_VER=       1.73.0
+RUST_STAGE0_VER=       1.74.1
 RUST_ARCH:=            x86_64-unknown-linux-gnu
 RUST_STAGE0:=          rust-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.gz
 RUST_STD_STAGE0:=      rust-std-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.gz
@@ -275,7 +273,7 @@ DISTFILES:=         ${DISTFILES} ${RUST_STAGE0}
 # x86_64-sun-solaris bootstrap and comment out the overrides.
 #
 .if ${MACHINE_PLATFORM:MSunOS-*-x86_64} || make(distinfo) || make (makesum) || make(mdi)
-RUST_STAGE0_VER=       1.73.0
+RUST_STAGE0_VER=       1.74.1
 RUST_ARCH:=            x86_64-unknown-illumos
 RUST_STAGE0:=          rust-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.gz
 SITES.${RUST_STAGE0}=  https://us-central.manta.mnx.io/pkgsrc/public/pkg-bootstraps/
@@ -288,14 +286,14 @@ CONFIGURE_ARGS+=  --host=${RUST_ARCH}
 CONFIGURE_ARGS+=       --target=${RUST_ARCH}
 .endif
 .if ${MACHINE_PLATFORM:MFreeBSD-*-x86_64} || make(distinfo) || make (makesum) || make(mdi)
-RUST_STAGE0_VER=       1.73.0
+RUST_STAGE0_VER=       1.74.1
 RUST_ARCH:=            x86_64-unknown-freebsd
 RUST_STAGE0:=          rust-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.gz
 RUST_STD_STAGE0:=      rust-std-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.gz
 DISTFILES:=            ${DISTFILES} ${RUST_STAGE0} ${RUST_STD_STAGE0}
 .endif
 .if ${MACHINE_PLATFORM:MNetBSD-*-i386} || make(distinfo) || make (makesum) || make(mdi)
-RUST_STAGE0_VER=       1.73.0
+RUST_STAGE0_VER=       1.74.1
 RUST_ARCH=             i586-unknown-netbsd
 RUST_STAGE0:=          rust-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.xz
 RUST_STD_STAGE0:=      rust-std-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.xz
@@ -315,15 +313,15 @@ pre-build-fix-paxctl:
        ${TOOLS_PLATFORM.paxctl} +am ${WRKDIR}/rust-bootstrap/bin/rustc
 .endif
 .if ${MACHINE_PLATFORM:MNetBSD-*-x86_64} || make(distinfo) || make (makesum) || make(mdi)
-RUST_STAGE0_VER=       1.73.0
+RUST_STAGE0_VER=       1.74.1
 RUST_ARCH=             x86_64-unknown-netbsd
 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}
 .endif
 .if ${MACHINE_PLATFORM:MNetBSD-*-powerpc} || make(distinfo) || make (makesum) || make(mdi)
-RUST_STAGE0_VER=       1.73.0
-RUST_ARCH=             powerpc-unknown-netbsd-nb1
+RUST_STAGE0_VER=       1.74.1
+RUST_ARCH=             powerpc-unknown-netbsd
 
 # Cross-built against NetBSD 9.0
 RUST_STAGE0:=                  rust-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.xz
@@ -334,7 +332,7 @@ SITES.${RUST_STD_STAGE0}=   ${MASTER_SITE_
 
 .endif
 .if ${MACHINE_PLATFORM:MNetBSD-*-aarch64} || make(distinfo) || make (makesum) || make(mdi)
-RUST_STAGE0_VER=               1.73.0
+RUST_STAGE0_VER=               1.74.1
 RUST_ARCH=                     aarch64-unknown-netbsd
 RUST_STAGE0:=                  rust-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.xz
 RUST_STD_STAGE0:=              rust-std-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.xz
@@ -343,7 +341,7 @@ SITES.${RUST_STAGE0}=               ${MASTER_SITE_LOC
 SITES.${RUST_STD_STAGE0}=      ${MASTER_SITE_LOCAL:=rust/}
 .endif
 .if ${MACHINE_PLATFORM:MNetBSD-*-aarch64eb} || make(distinfo) || make (makesum) || make(mdi)
-RUST_STAGE0_VER=               1.73.0
+RUST_STAGE0_VER=               1.74.1
 RUST_ARCH=                     aarch64_be-unknown-netbsd
 RUST_STAGE0:=                  rust-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.xz
 RUST_STD_STAGE0:=              rust-std-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.xz
@@ -352,7 +350,7 @@ SITES.${RUST_STAGE0}=               ${MASTER_SITE_LOC
 SITES.${RUST_STD_STAGE0}=      ${MASTER_SITE_LOCAL:=rust/}
 .endif
 .if ${MACHINE_PLATFORM:MNetBSD-*-sparc64} || make(distinfo) || make (makesum) || make(mdi)
-RUST_STAGE0_VER=               1.73.0
+RUST_STAGE0_VER=               1.74.1
 RUST_ARCH=                     sparc64-unknown-netbsd
 RUST_STAGE0:=                  rust-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.xz
 RUST_STD_STAGE0:=              rust-std-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.xz
@@ -362,7 +360,7 @@ SITES.${RUST_STD_STAGE0}=   ${MASTER_SITE_
 .endif
 .if ${MACHINE_PLATFORM:MNetBSD-*-earmv7hf} || make(distinfo) || make (makesum) || make(mdi)
 RUST_ARCH=                     armv7-unknown-netbsd-eabihf
-RUST_STAGE0_VER=               1.73.0
+RUST_STAGE0_VER=               1.74.1
 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}
@@ -371,7 +369,7 @@ SITES.${RUST_STD_STAGE0}=   ${MASTER_SITE_
 .endif
 .if ${MACHINE_PLATFORM:MNetBSD-*-earmv6hf} || make(distinfo) || make (makesum) || make(mdi)
 RUST_ARCH=                     armv6-unknown-netbsd-eabihf
-RUST_STAGE0_VER=               1.73.0
+RUST_STAGE0_VER=               1.74.1
 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}
@@ -380,7 +378,7 @@ SITES.${RUST_STD_STAGE0}=   ${MASTER_SITE_
 .endif
 .if ${MACHINE_PLATFORM:MNetBSD-*-mipsel} || make(distinfo) || make (makesum) || make(mdi)
 RUST_ARCH=                     mipsel-unknown-netbsd
-RUST_STAGE0_VER=               1.73.0
+RUST_STAGE0_VER=               1.74.1
 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}
@@ -389,7 +387,7 @@ SITES.${RUST_STD_STAGE0}=   ${MASTER_SITE_
 .endif
 .if ${MACHINE_PLATFORM:MNetBSD-*-riscv64} || make(distinfo) || make (makesum) || make(mdi)
 RUST_ARCH=                     riscv64gc-unknown-netbsd
-RUST_STAGE0_VER=               1.73.0
+RUST_STAGE0_VER=               1.74.1
 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}
@@ -413,13 +411,14 @@ TOOLS_PATH.md5sum=        ${PREFIX}/bin/gmd5sum
 TOOLS_PLATFORM.gzcat=  ${PREFIX}/bin/gzip -cd
 .endif
 
-SUBST_CLASSES+=                rpath
-SUBST_STAGE.rpath=     pre-configure
-SUBST_FILES.rpath+=    compiler/rustc_codegen_ssa/src/back/linker.rs
-SUBST_FILES.rpath+=    compiler/rustc_target/src/spec/netbsd_base.rs
-SUBST_FILES.rpath+=    src/bootstrap/builder.rs
-SUBST_FILES.rpath+=    src/bootstrap/compile.rs
-SUBST_VARS.rpath=      PREFIX
+SUBST_CLASSES+=                prefix
+SUBST_STAGE.prefix=    pre-configure
+SUBST_FILES.prefix+=   compiler/rustc_codegen_ssa/src/back/linker.rs
+SUBST_FILES.prefix+=   compiler/rustc_target/src/spec/base/netbsd.rs
+SUBST_FILES.prefix+=   src/bootstrap/src/core/build_steps/compile.rs
+SUBST_FILES.prefix+=   src/bootstrap/src/core/builder.rs
+SUBST_FILES.prefix+=   src/bootstrap/bootstrap.py
+SUBST_VARS.prefix=     PREFIX
 
 #
 # Generate list of subst entries for various .cargo-checksum.json files.  These
@@ -428,37 +427,27 @@ SUBST_VARS.rpath= PREFIX
 # updating and verification.
 #
 
-CKSUM_CRATES+= vendor/cc-1.0.73
-CKSUMS+=       38970d678de0efb4b5e2978265daa8a613a1db35fc42e669621b03fc56d5b138
-CKSUMS+=       65de0d6593a4256e5fcaf898f9468d71bab672c70a2dfab3dcb8514e9b72819c
-
-CKSUM_CRATES+= vendor/cc
-CKSUMS+=       17a4659710aa290c4ed9c23063c7b202c5bcf2a84de33aa1f01fc6fded69a1f8
-CKSUMS+=       a19bcb1a561d4ba5846f8f89fcfe6f05a3cb2e79baf8f21f53f0fba012db1b7f
-
 CKSUM_CRATES+= vendor/libc
+
+CKSUM_CRATES+= vendor/libc-0.2.146
 CKSUMS+=       55ce4624745e31ad226b47fde177a46176a89da3fa5030663673a115102471f9
 CKSUMS+=       09ab15cd50245f4ced230b7919657ab170e06443bb0ed4baf4449d3472f5f656
 CKSUMS+=       90dd33ef20dc3be8aef5bd152a6a06e7ab34f9527b3978487b593aaa16a907bd
 CKSUMS+=       ec1cb2b8522ce7d35c9fce2f5b17a1a7e28cae9836f1cf11e267f222b72dff60
+
+CKSUM_CRATES+= vendor/libc-0.2.149
+CKSUMS+=       1f1beb74c33bd3ad6a5d7aae2afdacf0ccbad0f9dacda2894d2cfdc2414174ae
+CKSUMS+=       80f3168251556b3eb918056aa9563db07383f61e69a262f3af390b542fd757bb
 CKSUMS+=       b1660c631a599a3355116e7485b88ab2f8f2929c2e37851a763431387b902f14
 CKSUMS+=       990d1c6c01db31b9e5541128e4987b114f39c6808d94a5f8f048f492cfb96d78
 
-CKSUM_CRATES+= vendor/libc-0.2.138
-CKSUMS+=       107a4aa396b8383c66e0ace2f941450b4b69146558cdc4d9fbe33eeab51760f1
-CKSUMS+=       4be83bef456569d59405edf134e7fe8eff78f3fe35f1efd60e15405d5c822725
-
-CKSUM_CRATES+= vendor/libc-0.2.140
-CKSUMS+=       4493317993af390d8aafc2cb7ace4c349dfc9d2451fd666844f04a4fa1f47442
-CKSUMS+=       537a01c3cd5507f493616193991e1135c7896aae3fc92d98ec9facbfe243d980
-CKSUMS+=       6442ed05eb390d44a03daa9800af1030f2ee3e61db98675262c227b28de51937
-CKSUMS+=       ec554c837999c718786debfcfe2241984193751fcd52156323b418d96319aa95
+CKSUM_CRATES+= vendor/cc-1.0.73
+CKSUMS+=       38970d678de0efb4b5e2978265daa8a613a1db35fc42e669621b03fc56d5b138
+CKSUMS+=       65de0d6593a4256e5fcaf898f9468d71bab672c70a2dfab3dcb8514e9b72819c
 
-CKSUM_CRATES+= vendor/libc-0.2.146
-#CKSUMS+=      6442ed05eb390d44a03daa9800af1030f2ee3e61db98675262c227b28de51937
-#CKSUMS+=      ec554c837999c718786debfcfe2241984193751fcd52156323b418d96319aa95
-#CKSUMS+=      6a60a542639528a0a34b9c9a7298973ec2cf1449c59546b7b30dcef6c51874dd
-#CKSUMS+=      ec1cb2b8522ce7d35c9fce2f5b17a1a7e28cae9836f1cf11e267f222b72dff60
+CKSUM_CRATES+= vendor/cc
+CKSUMS+=       17a4659710aa290c4ed9c23063c7b202c5bcf2a84de33aa1f01fc6fded69a1f8
+CKSUMS+=       a19bcb1a561d4ba5846f8f89fcfe6f05a3cb2e79baf8f21f53f0fba012db1b7f
 
 CKSUM_CRATES+= vendor/lzma-sys
 CKSUMS+=       6fd5e9245db34c6f557b8bfcaf03db82fc88c3b06dbfbb5f03b2bcd138983ef9

Index: pkgsrc/lang/rust/options.mk
diff -u pkgsrc/lang/rust/options.mk:1.34 pkgsrc/lang/rust/options.mk:1.35
--- pkgsrc/lang/rust/options.mk:1.34    Mon Jan 15 12:24:21 2024
+++ pkgsrc/lang/rust/options.mk Sun Mar  3 14:53:32 2024
@@ -1,4 +1,4 @@
-# $NetBSD: options.mk,v 1.34 2024/01/15 12:24:21 adam Exp $
+# $NetBSD: options.mk,v 1.35 2024/03/03 14:53:32 he Exp $
 
 PKG_OPTIONS_VAR=       PKG_OPTIONS.rust
 PKG_SUPPORTED_OPTIONS+=        rust-cargo-static rust-docs
@@ -19,10 +19,15 @@ PKG_SUGGESTED_OPTIONS+=             rust-internal-l
 PKG_SUGGESTED_OPTIONS+=                rust-internal-llvm
 .endif
 
-# (NetBSD)/sparc64 systems fail to build libunwind,
-# a dependency of pkgsrc llvm, so use the internal one instead
-.if ${MACHINE_PLATFORM:MNetBSD-*-sparc64}
-PKG_SUGGESTED_OPTIONS+=                rust-internal-llvm
+# NetBSD/sparc64 when using the internal LLVM needs
+# to not use gcc 10.4 or 10.5 (as found in 10.0_BETA or 10.0), ref.
+# https://github.com/rust-lang/rust/issues/117231
+# (however, gcc from 9.x produces a working LLVM).
+.if ${MACHINE_PLATFORM:MNetBSD-10.*-sparc64}
+.  if !empty(PKG_OPTIONS:Mrust-internal-llvm)
+# Require GCC 12 (from pkgsrc) to correctly build the embedded LLVM (17.x).
+GCC_REQD=      12
+.  endif
 .endif
 
 # Bundle OpenSSL and curl into the cargo binary when producing
@@ -39,6 +44,7 @@ PKG_OPTIONS_LEGACY_OPTS+=     rust-llvm:rust
 # Use the internal copy of LLVM or the external one?
 #
 .if empty(PKG_OPTIONS:Mrust-internal-llvm)
+# External LLVM must be >= 15, ref. RELEASES.md
 BUILDLINK_API_DEPENDS.llvm+=   llvm>=15
 .include "../../lang/libunwind/buildlink3.mk"
 .include "../../lang/llvm/buildlink3.mk"

Index: pkgsrc/lang/rust/platform.mk
diff -u pkgsrc/lang/rust/platform.mk:1.20 pkgsrc/lang/rust/platform.mk:1.21
--- pkgsrc/lang/rust/platform.mk:1.20   Wed Oct 25 05:50:43 2023
+++ pkgsrc/lang/rust/platform.mk        Sun Mar  3 14:53:32 2024
@@ -1,4 +1,4 @@
-# $NetBSD: platform.mk,v 1.20 2023/10/25 05:50:43 pin Exp $
+# $NetBSD: platform.mk,v 1.21 2024/03/03 14:53:32 he Exp $
 
 # This file encodes whether a given platform has support for rust.
 
@@ -7,10 +7,10 @@
 
 .if !defined(PLATFORM_SUPPORTS_RUST)
 
-# Rust needs NetBSD>7
+# Rust needs NetBSD>8
 .for rust_arch in aarch64 earmv7hf i386 powerpc riscv64 sparc64 x86_64
 .  for rust_os in Darwin FreeBSD Linux NetBSD SunOS
-.    if ${OPSYS} != "NetBSD" || empty(OS_VERSION:M[0-7].*)
+.    if ${OPSYS} != "NetBSD" || empty(OS_VERSION:M[0-8].*)
 RUST_PLATFORMS+=       ${rust_os}-*-${rust_arch}
 .    endif
 .  endfor

Index: pkgsrc/lang/rust/patches/patch-compiler_rustc__llvm_build.rs
diff -u pkgsrc/lang/rust/patches/patch-compiler_rustc__llvm_build.rs:1.15 pkgsrc/lang/rust/patches/patch-compiler_rustc__llvm_build.rs:1.16
--- pkgsrc/lang/rust/patches/patch-compiler_rustc__llvm_build.rs:1.15   Sat Jan  6 19:00:19 2024
+++ pkgsrc/lang/rust/patches/patch-compiler_rustc__llvm_build.rs        Sun Mar  3 14:53:32 2024
@@ -1,4 +1,4 @@
-$NetBSD: patch-compiler_rustc__llvm_build.rs,v 1.15 2024/01/06 19:00:19 he Exp $
+$NetBSD: patch-compiler_rustc__llvm_build.rs,v 1.16 2024/03/03 14:53:32 he Exp $
 
 Fix build on NetBSD HEAD-llvm. XXX there is probably a better way to do this.
 
@@ -20,22 +20,20 @@ https://github.com/rust-lang/rust/pull/1
      } else if target.contains("windows-gnu") {
          println!("cargo:rustc-link-lib=shell32");
          println!("cargo:rustc-link-lib=uuid");
-@@ -258,6 +262,14 @@ fn main() {
-     {
-         println!("cargo:rustc-link-lib=z");
-     } else if target.contains("netbsd") {
-+        // When build llvm for i486, and then need -latomic for 64-bit atomics
-+        if target.starts_with("i386")
-+           || target.starts_with("i486")
-+           || target.starts_with("i586")
+@@ -261,7 +265,11 @@ fn main() {
+         // On NetBSD/i386, gcc and g++ is built for i486 (to maximize backward compat)
+         // However, LLVM insists on using 64-bit atomics.
+         // This gives rise to a need to link rust itself with -latomic for these targets
+-        if target.starts_with("i586") || target.starts_with("i686") {
++        if target.starts_with("i386") 
++           || target.starts_with("i486") 
++           || target.starts_with("i586") 
 +           || target.starts_with("i686")
 +        {
-+            println!("cargo:rustc-link-lib=atomic");
-+        }
+             println!("cargo:rustc-link-lib=atomic");
+         }
          println!("cargo:rustc-link-lib=z");
-         println!("cargo:rustc-link-lib=execinfo");
-     }
-@@ -346,7 +358,13 @@ fn main() {
+@@ -352,7 +360,13 @@ fn main() {
          "c++"
      } else if target.contains("netbsd") && llvm_static_stdcpp.is_some() {
          // NetBSD uses a separate library when relocation is required
Index: pkgsrc/lang/rust/patches/patch-compiler_rustc__target_src_spec_mod.rs
diff -u pkgsrc/lang/rust/patches/patch-compiler_rustc__target_src_spec_mod.rs:1.15 pkgsrc/lang/rust/patches/patch-compiler_rustc__target_src_spec_mod.rs:1.16
--- pkgsrc/lang/rust/patches/patch-compiler_rustc__target_src_spec_mod.rs:1.15  Wed Oct 25 05:50:43 2023
+++ pkgsrc/lang/rust/patches/patch-compiler_rustc__target_src_spec_mod.rs       Sun Mar  3 14:53:32 2024
@@ -1,15 +1,14 @@
-$NetBSD: patch-compiler_rustc__target_src_spec_mod.rs,v 1.15 2023/10/25 05:50:43 pin Exp $
+$NetBSD: patch-compiler_rustc__target_src_spec_mod.rs,v 1.16 2024/03/03 14:53:32 he Exp $
 
-Add i586(pentium) and mipsel NetBSD targets.
+Add entry for NetBSD/mips64el.
 
---- compiler/rustc_target/src/spec/mod.rs.orig 2021-03-23 16:15:10.000000000 +0000
+--- compiler/rustc_target/src/spec/mod.rs.orig 2024-01-13 14:20:59.236278792 +0000
 +++ compiler/rustc_target/src/spec/mod.rs
-@@ -1324,6 +1324,8 @@ supported_targets! {
-     ("armv6-unknown-netbsd-eabihf", armv6_unknown_netbsd_eabihf),
+@@ -1532,6 +1532,7 @@ supported_targets! {
      ("armv7-unknown-netbsd-eabihf", armv7_unknown_netbsd_eabihf),
+     ("i586-unknown-netbsd", i586_unknown_netbsd),
      ("i686-unknown-netbsd", i686_unknown_netbsd),
-+    ("i586-unknown-netbsd", i586_unknown_netbsd),
-+    ("mipsel-unknown-netbsd", mipsel_unknown_netbsd),
++    ("mips64el-unknown-netbsd", mips64el_unknown_netbsd),
+     ("mipsel-unknown-netbsd", mipsel_unknown_netbsd),
      ("powerpc-unknown-netbsd", powerpc_unknown_netbsd),
      ("riscv64gc-unknown-netbsd", riscv64gc_unknown_netbsd),
-     ("sparc64-unknown-netbsd", sparc64_unknown_netbsd),

Index: pkgsrc/lang/rust/patches/patch-library_backtrace_src_symbolize_gimli_elf.rs
diff -u pkgsrc/lang/rust/patches/patch-library_backtrace_src_symbolize_gimli_elf.rs:1.6 pkgsrc/lang/rust/patches/patch-library_backtrace_src_symbolize_gimli_elf.rs:1.7
--- pkgsrc/lang/rust/patches/patch-library_backtrace_src_symbolize_gimli_elf.rs:1.6     Wed Oct 25 05:50:43 2023
+++ pkgsrc/lang/rust/patches/patch-library_backtrace_src_symbolize_gimli_elf.rs Sun Mar  3 14:53:32 2024
@@ -1,10 +1,10 @@
-$NetBSD: patch-library_backtrace_src_symbolize_gimli_elf.rs,v 1.6 2023/10/25 05:50:43 pin Exp $
+$NetBSD: patch-library_backtrace_src_symbolize_gimli_elf.rs,v 1.7 2024/03/03 14:53:32 he Exp $
 
 Make NetBSD also find its debug libraries, if present.
 
 --- library/backtrace/src/symbolize/gimli/elf.rs.orig  2022-04-04 09:41:26.000000000 +0000
 +++ library/backtrace/src/symbolize/gimli/elf.rs
-@@ -276,11 +276,16 @@ fn decompress_zlib(input: &[u8], output:
+@@ -304,11 +304,17 @@ fn decompress_zlib(input: &[u8], output:
      }
  }
  
@@ -15,9 +15,10 @@ Make NetBSD also find its debug librarie
  
  fn debug_path_exists() -> bool {
      cfg_if::cfg_if! {
--        if #[cfg(any(target_os = "freebsd", target_os = "linux"))] {
-+        if #[cfg(any(target_os = "freebsd", 
-+                   target_os = "netbsd",
+-        if #[cfg(any(target_os = "freebsd", target_os = "hurd", target_os = "linux"))] {
++        if #[cfg(any(target_os = "freebsd",
++                     target_os = "netbsd",
++                     target_os = "hurd",
 +                     target_os = "linux"))] {
              use core::sync::atomic::{AtomicU8, Ordering};
              static DEBUG_PATH_EXISTS: AtomicU8 = AtomicU8::new(0);

Index: pkgsrc/lang/rust/patches/patch-src_bootstrap_bootstrap.py
diff -u pkgsrc/lang/rust/patches/patch-src_bootstrap_bootstrap.py:1.21 pkgsrc/lang/rust/patches/patch-src_bootstrap_bootstrap.py:1.22
--- pkgsrc/lang/rust/patches/patch-src_bootstrap_bootstrap.py:1.21      Sat Jan  6 19:00:19 2024
+++ pkgsrc/lang/rust/patches/patch-src_bootstrap_bootstrap.py   Sun Mar  3 14:53:32 2024
@@ -1,7 +1,8 @@
-$NetBSD: patch-src_bootstrap_bootstrap.py,v 1.21 2024/01/06 19:00:19 he Exp $
+$NetBSD: patch-src_bootstrap_bootstrap.py,v 1.22 2024/03/03 14:53:32 he Exp $
 
 Use `uname -p` on NetBSD, as that is reliable and sensible there.
 Handle earmv[67]hf for NetBSD.
+Also use @PREFIX@ and not $ORIGIN in rpath.
 
 --- src/bootstrap/bootstrap.py.orig    2023-07-12 03:32:40.000000000 +0000
 +++ src/bootstrap/bootstrap.py
@@ -35,3 +36,12 @@ Handle earmv[67]hf for NetBSD.
          else:
              kernel += 'eabihf'
      elif cputype == 'mips':
+@@ -735,7 +746,7 @@ class RustBuild(object):
+         rpath_entries = [
+             # Relative default, all binary and dynamic libraries we ship
+             # appear to have this (even when `../lib` is redundant).
+-            "$ORIGIN/../lib",
++            "@PREFIX@/lib",
+             os.path.join(os.path.realpath(nix_deps_dir), "lib")
+         ]
+         patchelf_args = ["--set-rpath", ":".join(rpath_entries)]

Index: pkgsrc/lang/rust/patches/patch-src_tools_rust-installer_install-template.sh
diff -u pkgsrc/lang/rust/patches/patch-src_tools_rust-installer_install-template.sh:1.12 pkgsrc/lang/rust/patches/patch-src_tools_rust-installer_install-template.sh:1.13
--- pkgsrc/lang/rust/patches/patch-src_tools_rust-installer_install-template.sh:1.12    Mon Jan 22 11:00:16 2024
+++ pkgsrc/lang/rust/patches/patch-src_tools_rust-installer_install-template.sh Sun Mar  3 14:53:33 2024
@@ -1,4 +1,4 @@
-$NetBSD: patch-src_tools_rust-installer_install-template.sh,v 1.12 2024/01/22 11:00:16 adam Exp $
+$NetBSD: patch-src_tools_rust-installer_install-template.sh,v 1.13 2024/03/03 14:53:33 he Exp $
 
 No logging to 'install.log'.
 Do not create 'uninstall.sh'.
@@ -9,7 +9,7 @@ pattern matching and substitution in the
 and "sed" when shell builtin "case" and "omit shortest match" ops
 should do just fine.
 
---- src/tools/rust-installer/install-template.sh.orig  2023-12-04 19:48:34.000000000 +0000
+--- src/tools/rust-installer/install-template.sh.orig  2023-12-21 16:55:28.000000000 +0000
 +++ src/tools/rust-installer/install-template.sh
 @@ -6,20 +6,12 @@ set -u
  init_logging() {
Index: pkgsrc/lang/rust/patches/patch-vendor_target-lexicon_src_targets.rs
diff -u pkgsrc/lang/rust/patches/patch-vendor_target-lexicon_src_targets.rs:1.12 pkgsrc/lang/rust/patches/patch-vendor_target-lexicon_src_targets.rs:1.13
--- pkgsrc/lang/rust/patches/patch-vendor_target-lexicon_src_targets.rs:1.12    Wed Oct 25 05:50:43 2023
+++ pkgsrc/lang/rust/patches/patch-vendor_target-lexicon_src_targets.rs Sun Mar  3 14:53:33 2024
@@ -1,10 +1,10 @@
-$NetBSD: patch-vendor_target-lexicon_src_targets.rs,v 1.12 2023/10/25 05:50:43 pin Exp $
+$NetBSD: patch-vendor_target-lexicon_src_targets.rs,v 1.13 2024/03/03 14:53:33 he Exp $
 
-Add aarch64_eb, mipsel and riscv64gc for NetBSD.
+Add aarch64_eb and mipsel for NetBSD.
 
 --- vendor/target-lexicon/src/targets.rs.orig  2021-05-03 21:35:46.000000000 +0000
 +++ vendor/target-lexicon/src/targets.rs
-@@ -1357,6 +1357,7 @@ mod tests {
+@@ -1526,6 +1526,7 @@ mod tests {
              "aarch64-unknown-linux-gnu_ilp32",
              "aarch64-unknown-linux-musl",
              "aarch64-unknown-netbsd",
@@ -12,7 +12,7 @@ Add aarch64_eb, mipsel and riscv64gc for
              "aarch64-unknown-none",
              "aarch64-unknown-none-softfloat",
              "aarch64-unknown-openbsd",
-@@ -1441,6 +1442,7 @@ mod tests {
+@@ -1611,6 +1612,7 @@ mod tests {
              "mipsel-unknown-linux-gnu",
              "mipsel-unknown-linux-musl",
              "mipsel-unknown-linux-uclibc",
@@ -20,11 +20,3 @@ Add aarch64_eb, mipsel and riscv64gc for
              "mipsel-unknown-none",
              "mipsisa32r6el-unknown-linux-gnu",
              "mipsisa32r6-unknown-linux-gnu",
-@@ -1478,6 +1480,7 @@ mod tests {
-             "riscv64gc-unknown-freebsd",
-             "riscv64gc-unknown-linux-gnu",
-             "riscv64gc-unknown-linux-musl",
-+            "riscv64gc-unknown-netbsd",
-             "riscv64gc-unknown-none-elf",
-             "riscv64gc-unknown-openbsd",
-             "riscv64imac-unknown-none-elf",

Index: pkgsrc/lang/rust/patches/patch-vendor_libc_src_unix_solarish_mod.rs
diff -u pkgsrc/lang/rust/patches/patch-vendor_libc_src_unix_solarish_mod.rs:1.13 pkgsrc/lang/rust/patches/patch-vendor_libc_src_unix_solarish_mod.rs:1.14
--- pkgsrc/lang/rust/patches/patch-vendor_libc_src_unix_solarish_mod.rs:1.13    Wed Oct 25 05:50:43 2023
+++ pkgsrc/lang/rust/patches/patch-vendor_libc_src_unix_solarish_mod.rs Sun Mar  3 14:53:33 2024
@@ -1,10 +1,10 @@
-$NetBSD: patch-vendor_libc_src_unix_solarish_mod.rs,v 1.13 2023/10/25 05:50:43 pin Exp $
+$NetBSD: patch-vendor_libc_src_unix_solarish_mod.rs,v 1.14 2024/03/03 14:53:33 he Exp $
 
 Fix xattr build.
 
 --- vendor/libc/src/unix/solarish/mod.rs.orig  2019-05-20 13:47:24.000000000 +0000
 +++ vendor/libc/src/unix/solarish/mod.rs
-@@ -1215,6 +1215,8 @@ pub const EOWNERDEAD: ::c_int = 58;
+@@ -1523,6 +1523,8 @@ pub const EOWNERDEAD: ::c_int = 58;
  pub const ENOTRECOVERABLE: ::c_int = 59;
  pub const ENOSTR: ::c_int = 60;
  pub const ENODATA: ::c_int = 61;

Added files:

Index: pkgsrc/lang/rust/patches/patch-compiler_rustc__target_src_spec_base_netbsd.rs
diff -u /dev/null pkgsrc/lang/rust/patches/patch-compiler_rustc__target_src_spec_base_netbsd.rs:1.1
--- /dev/null   Sun Mar  3 14:53:34 2024
+++ pkgsrc/lang/rust/patches/patch-compiler_rustc__target_src_spec_base_netbsd.rs       Sun Mar  3 14:53:32 2024
@@ -0,0 +1,32 @@
+$NetBSD: patch-compiler_rustc__target_src_spec_base_netbsd.rs,v 1.1 2024/03/03 14:53:32 he Exp $
+
+For the benefit of powerpc, when libatomic-links is installed,
+search the directory containing the symlinks to -latomic.
+
+--- compiler/rustc_target/src/spec/base/netbsd.rs.orig 2024-01-06 19:57:14.887897867 +0000
++++ compiler/rustc_target/src/spec/base/netbsd.rs
+@@ -1,12 +1,23 @@
+-use crate::spec::{cvs, RelroLevel, TargetOptions};
++use crate::spec::{cvs, Cc, Lld, RelroLevel, LinkerFlavor, TargetOptions};
+ 
+ pub fn opts() -> TargetOptions {
++    let add_linker_paths =
++        &[
++            // For the benefit of powerpc, when libatomic-links is installed,
++            "-Wl,-R@PREFIX@/lib/libatomic",
++            "-Wl,-L@PREFIX@/lib/libatomic",
++        ];
++    let pre_link_args = TargetOptions::link_args(
++        LinkerFlavor::Gnu(Cc::Yes, Lld::No),
++        add_linker_paths
++    );
+     TargetOptions {
+         os: "netbsd".into(),
+         dynamic_linking: true,
+         families: cvs!["unix"],
+         no_default_libraries: false,
+         has_rpath: true,
++        pre_link_args,
+         position_independent_executables: true,
+         relro_level: RelroLevel::Full,
+         use_ctors_section: true,
Index: pkgsrc/lang/rust/patches/patch-compiler_rustc__target_src_spec_targets_mips64el__unknown__netbsd.rs
diff -u /dev/null pkgsrc/lang/rust/patches/patch-compiler_rustc__target_src_spec_targets_mips64el__unknown__netbsd.rs:1.1
--- /dev/null   Sun Mar  3 14:53:34 2024
+++ pkgsrc/lang/rust/patches/patch-compiler_rustc__target_src_spec_targets_mips64el__unknown__netbsd.rs Sun Mar  3 14:53:32 2024
@@ -0,0 +1,29 @@
+$NetBSD: patch-compiler_rustc__target_src_spec_targets_mips64el__unknown__netbsd.rs,v 1.1 2024/03/03 14:53:32 he Exp $
+
+Provide a mips64el target with N32, suitable for NetBSD/mips64el.
+
+--- compiler/rustc_target/src/spec/targets/mips64el_unknown_netbsd.rs.orig     2024-01-13 14:16:30.122042614 +0000
++++ compiler/rustc_target/src/spec/targets/mips64el_unknown_netbsd.rs
+@@ -0,0 +1,22 @@
++use crate::abi::Endian;
++use crate::spec::{base, Target, TargetOptions};
++
++pub fn target() -> Target {
++    let mut base = base::netbsd::opts();
++    base.max_atomic_width = Some(32);
++    base.cpu = "mips32".into();
++
++    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 {
++            abi: "n32".into(),
++            features: "+soft-float,+abi=n32".into(),
++            endian: Endian::Little,
++            mcount: "__mcount".into(),
++            ..base
++        },
++    }
++}
Index: pkgsrc/lang/rust/patches/patch-src_bootstrap_src_core_build__steps_compile.rs
diff -u /dev/null pkgsrc/lang/rust/patches/patch-src_bootstrap_src_core_build__steps_compile.rs:1.1
--- /dev/null   Sun Mar  3 14:53:34 2024
+++ pkgsrc/lang/rust/patches/patch-src_bootstrap_src_core_build__steps_compile.rs       Sun Mar  3 14:53:32 2024
@@ -0,0 +1,15 @@
+$NetBSD: patch-src_bootstrap_src_core_build__steps_compile.rs,v 1.1 2024/03/03 14:53:32 he Exp $
+
+On Darwin, do not use @rpath for internal libraries.
+
+--- src/bootstrap/src/core/build_steps/compile.rs.orig 2024-01-06 20:42:20.028206400 +0000
++++ src/bootstrap/src/core/build_steps/compile.rs
+@@ -626,7 +626,7 @@ fn copy_sanitizers(
+             || target == "x86_64-apple-ios"
+         {
+             // Update the library’s install name to reflect that it has been renamed.
+-            apple_darwin_update_library_name(&dst, &format!("@rpath/{}", &runtime.name));
++            apple_darwin_update_library_name(&dst, &format!("@PREFIX@/lib/{}", &runtime.name));
+             // Upon renaming the install name, the code signature of the file will invalidate,
+             // so we will sign it again.
+             apple_darwin_sign_file(&dst);
Index: pkgsrc/lang/rust/patches/patch-src_bootstrap_src_core_build__steps_llvm.rs
diff -u /dev/null pkgsrc/lang/rust/patches/patch-src_bootstrap_src_core_build__steps_llvm.rs:1.1
--- /dev/null   Sun Mar  3 14:53:34 2024
+++ pkgsrc/lang/rust/patches/patch-src_bootstrap_src_core_build__steps_llvm.rs  Sun Mar  3 14:53:32 2024
@@ -0,0 +1,20 @@
+$NetBSD: patch-src_bootstrap_src_core_build__steps_llvm.rs,v 1.1 2024/03/03 14:53:32 he Exp $
+
+Force use of -latomic on mips* on NetBSD.
+
+--- src/bootstrap/src/core/build_steps/llvm.rs.orig    2024-01-06 20:59:17.436053488 +0000
++++ src/bootstrap/src/core/build_steps/llvm.rs
+@@ -402,6 +402,13 @@ impl Step for Llvm {
+             ldflags.shared.push(" -latomic");
+         }
+ 
++        if target.starts_with("mips") && target.contains("netbsd")
++        {
++            // try to force this here, should possibly go elsewhere...
++            ldflags.exe.push(" -latomic");
++            ldflags.shared.push(" -latomic");
++        }
++
+         if target.contains("msvc") {
+             cfg.define("LLVM_USE_CRT_DEBUG", "MT");
+             cfg.define("LLVM_USE_CRT_RELEASE", "MT");
Index: pkgsrc/lang/rust/patches/patch-src_bootstrap_src_core_builder.rs
diff -u /dev/null pkgsrc/lang/rust/patches/patch-src_bootstrap_src_core_builder.rs:1.1
--- /dev/null   Sun Mar  3 14:53:34 2024
+++ pkgsrc/lang/rust/patches/patch-src_bootstrap_src_core_builder.rs    Sun Mar  3 14:53:32 2024
@@ -0,0 +1,15 @@
+$NetBSD: patch-src_bootstrap_src_core_builder.rs,v 1.1 2024/03/03 14:53:32 he Exp $
+
+Use @PREFIX@, not $ORIGIN in rpath.
+
+--- src/bootstrap/src/core/builder.rs.orig     2024-01-13 20:06:50.748741545 +0000
++++ src/bootstrap/src/core/builder.rs
+@@ -1678,7 +1678,7 @@ impl<'a> Builder<'a> {
+                 && !target.contains("xous")
+             {
+                 rustflags.arg("-Clink-args=-Wl,-z,origin");
+-                Some(format!("-Wl,-rpath,$ORIGIN/../{libdir}"))
++                Some(format!("-Wl,-rpath,@PREFIX@/{libdir}"))
+             } else {
+                 None
+             };
Index: pkgsrc/lang/rust/patches/patch-src_bootstrap_src_lib.rs
diff -u /dev/null pkgsrc/lang/rust/patches/patch-src_bootstrap_src_lib.rs:1.1
--- /dev/null   Sun Mar  3 14:53:34 2024
+++ pkgsrc/lang/rust/patches/patch-src_bootstrap_src_lib.rs     Sun Mar  3 14:53:32 2024
@@ -0,0 +1,23 @@
+$NetBSD: patch-src_bootstrap_src_lib.rs,v 1.1 2024/03/03 14:53:32 he Exp $
+
+Don't filter out optimization flags.
+FreeBSD has a particular C++ runtime library name
+
+--- src/bootstrap/src/lib.rs.orig      2024-01-06 20:52:50.892941220 +0000
++++ src/bootstrap/src/lib.rs
+@@ -1195,13 +1195,13 @@ impl Build {
+             .args()
+             .iter()
+             .map(|s| s.to_string_lossy().into_owned())
+-            .filter(|s| !s.starts_with("-O") && !s.starts_with("/O"))
+             .collect::<Vec<String>>();
+ 
+         // If we're compiling C++ on macOS then we add a flag indicating that
+         // we want libc++ (more filled out than libstdc++), ensuring that
+         // LLVM/etc are all properly compiled.
+-        if matches!(c, CLang::Cxx) && target.contains("apple-darwin") {
++        if matches!(c, CLang::Cxx) && 
++            (target.contains("apple-darwin") || target.contains("freebsd")) {
+             base.push("-stdlib=libc++".into());
+         }
+ 
Index: pkgsrc/lang/rust/patches/patch-vendor_libc-0.2.148_src_unix_bsd_netbsdlike+netbsd_mips.rs
diff -u /dev/null pkgsrc/lang/rust/patches/patch-vendor_libc-0.2.148_src_unix_bsd_netbsdlike+netbsd_mips.rs:1.1
--- /dev/null   Sun Mar  3 14:53:34 2024
+++ pkgsrc/lang/rust/patches/patch-vendor_libc-0.2.148_src_unix_bsd_netbsdlike+netbsd_mips.rs   Sun Mar  3 14:53:33 2024
@@ -0,0 +1,29 @@
+$NetBSD: patch-vendor_libc-0.2.148_src_unix_bsd_netbsdlike+netbsd_mips.rs,v 1.1 2024/03/03 14:53:33 he Exp $
+
+Add entry for NetBSD/mips.
+
+--- vendor/libc-0.2.148/src/unix/bsd/netbsdlike/netbsd/mips.rs.orig    2024-01-06 21:03:21.781003759 +0000
++++ vendor/libc-0.2.148/src/unix/bsd/netbsdlike/netbsd/mips.rs 2024-01-06 22:27:31.830676317 +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;
Index: pkgsrc/lang/rust/patches/patch-vendor_libc-0.2.148_src_unix_bsd_netbsdlike_netbsd_mod.rs
diff -u /dev/null pkgsrc/lang/rust/patches/patch-vendor_libc-0.2.148_src_unix_bsd_netbsdlike_netbsd_mod.rs:1.1
--- /dev/null   Sun Mar  3 14:53:34 2024
+++ pkgsrc/lang/rust/patches/patch-vendor_libc-0.2.148_src_unix_bsd_netbsdlike_netbsd_mod.rs    Sun Mar  3 14:53:33 2024
@@ -0,0 +1,52 @@
+$NetBSD: patch-vendor_libc-0.2.148_src_unix_bsd_netbsdlike_netbsd_mod.rs,v 1.1 2024/03/03 14:53:33 he Exp $
+
+Add entries for execinfo, and support
+for NetBSD/mips and NetBSD/riscv64.
+
+--- vendor/libc-0.2.148/src/unix/bsd/netbsdlike/netbsd/mod.rs.orig     2024-01-06 22:33:33.911876204 +0000
++++ vendor/libc-0.2.148/src/unix/bsd/netbsdlike/netbsd/mod.rs
+@@ -10,7 +10,7 @@ type __pthread_spin_t = __cpu_simple_loc
+ pub type vm_size_t = ::uintptr_t; // FIXME: deprecated since long time
+ pub type lwpid_t = ::c_uint;
+ pub type shmatt_t = ::c_uint;
+-pub type cpuid_t = u64;
++pub type cpuid_t = ::c_ulong;
+ pub type cpuset_t = _cpuset;
+ pub type pthread_spin_t = ::c_uchar;
+ pub type timer_t = ::c_int;
+@@ -3153,6 +3153,22 @@ extern "C" {
+     pub fn kinfo_getvmmap(pid: ::pid_t, cntp: *mut ::size_t) -> *mut kinfo_vmentry;
+ }
+ 
++#[link(name = "execinfo")]
++extern "C" {
++    pub fn backtrace(addrlist: *mut *mut ::c_void, len: ::size_t) -> ::size_t;
++    pub fn backtrace_symbols(addrlist: *const *mut ::c_void, len: ::size_t) -> *mut *mut ::c_char;
++    pub fn backtrace_symbols_fd(
++        addrlist: *const *mut ::c_void,
++        len: ::size_t,
++        fd: ::c_int,
++    ) -> ::c_int;
++    pub fn backtrace_symbols_fmt(
++        addrlist: *const *mut ::c_void,
++        len: ::size_t,
++        fmt: *const ::c_char,
++    ) -> *mut *mut ::c_char;
++}
++
+ cfg_if! {
+     if #[cfg(target_arch = "aarch64")] {
+         mod aarch64;
+@@ -3172,6 +3188,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 = "riscv64")] {
++        mod riscv64;
++        pub use self::riscv64::*;
+     } else {
+         // Unknown target_arch
+     }
Index: pkgsrc/lang/rust/patches/patch-vendor_libc-0.2.148_src_unix_bsd_netbsdlike_netbsd_riscv64.rs
diff -u /dev/null pkgsrc/lang/rust/patches/patch-vendor_libc-0.2.148_src_unix_bsd_netbsdlike_netbsd_riscv64.rs:1.1
--- /dev/null   Sun Mar  3 14:53:34 2024
+++ pkgsrc/lang/rust/patches/patch-vendor_libc-0.2.148_src_unix_bsd_netbsdlike_netbsd_riscv64.rs        Sun Mar  3 14:53:33 2024
@@ -0,0 +1,29 @@
+$NetBSD: patch-vendor_libc-0.2.148_src_unix_bsd_netbsdlike_netbsd_riscv64.rs,v 1.1 2024/03/03 14:53:33 he Exp $
+
+Add support for NetBSD/riscv64.
+
+--- vendor/libc-0.2.148/src/unix/bsd/netbsdlike/netbsd/riscv64.rs.orig 2024-01-06 21:03:21.781003759 +0000
++++ vendor/libc-0.2.148/src/unix/bsd/netbsdlike/netbsd/riscv64.rs      2024-01-06 22:31:25.289387359 +0000
+@@ -0,0 +1,22 @@
++use PT_FIRSTMACH;
++
++pub type c_long = i64;
++pub type c_ulong = u64;
++pub type c_char = u8;
++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_long>() - 1;
++    } else {
++        #[doc(hidden)]
++        pub const _ALIGNBYTES: usize = 8 - 1;
++    }
++}
++
++pub const PT_GETREGS: ::c_int = PT_FIRSTMACH + 0;
++pub const PT_SETREGS: ::c_int = PT_FIRSTMACH + 1;
++pub const PT_GETFPREGS: ::c_int = PT_FIRSTMACH + 2;
++pub const PT_SETFPREGS: ::c_int = PT_FIRSTMACH + 3;
Index: pkgsrc/lang/rust/patches/patch-vendor_libc-0.2.148_src_unix_solarish_mod.rs
diff -u /dev/null pkgsrc/lang/rust/patches/patch-vendor_libc-0.2.148_src_unix_solarish_mod.rs:1.1
--- /dev/null   Sun Mar  3 14:53:34 2024
+++ pkgsrc/lang/rust/patches/patch-vendor_libc-0.2.148_src_unix_solarish_mod.rs Sun Mar  3 14:53:33 2024
@@ -0,0 +1,15 @@
+$NetBSD: patch-vendor_libc-0.2.148_src_unix_solarish_mod.rs,v 1.1 2024/03/03 14:53:33 he Exp $
+
+Fix xattr build.
+
+--- vendor/libc-0.2.148/src/unix/solarish/mod.rs.orig  2024-01-06 22:41:58.182128108 +0000
++++ vendor/libc-0.2.148/src/unix/solarish/mod.rs
+@@ -1523,6 +1523,8 @@ pub const EOWNERDEAD: ::c_int = 58;
+ pub const ENOTRECOVERABLE: ::c_int = 59;
+ pub const ENOSTR: ::c_int = 60;
+ pub const ENODATA: ::c_int = 61;
++// This is not supported but is required for xattr
++pub const ENOATTR: ::c_int = ::ENODATA;
+ pub const ETIME: ::c_int = 62;
+ pub const ENOSR: ::c_int = 63;
+ pub const ENONET: ::c_int = 64;
Index: pkgsrc/lang/rust/patches/patch-vendor_libc-0.2.149_src_unix_bsd_netbsdlike_netbsd_mips.rs
diff -u /dev/null pkgsrc/lang/rust/patches/patch-vendor_libc-0.2.149_src_unix_bsd_netbsdlike_netbsd_mips.rs:1.1
--- /dev/null   Sun Mar  3 14:53:34 2024
+++ pkgsrc/lang/rust/patches/patch-vendor_libc-0.2.149_src_unix_bsd_netbsdlike_netbsd_mips.rs   Sun Mar  3 14:53:33 2024
@@ -0,0 +1,29 @@
+$NetBSD: patch-vendor_libc-0.2.149_src_unix_bsd_netbsdlike_netbsd_mips.rs,v 1.1 2024/03/03 14:53:33 he Exp $
+
+Add support for NetBSD/mipsel.
+
+--- vendor/libc-0.2.149/src/unix/bsd/netbsdlike/netbsd/mips.rs.orig    2024-01-08 07:29:24.841727520 +0000
++++ vendor/libc-0.2.149/src/unix/bsd/netbsdlike/netbsd/mips.rs 2024-01-08 07:30:35.869045004 +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;
Index: pkgsrc/lang/rust/patches/patch-vendor_libc-0.2.149_src_unix_bsd_netbsdlike_netbsd_mod.rs
diff -u /dev/null pkgsrc/lang/rust/patches/patch-vendor_libc-0.2.149_src_unix_bsd_netbsdlike_netbsd_mod.rs:1.1
--- /dev/null   Sun Mar  3 14:53:34 2024
+++ pkgsrc/lang/rust/patches/patch-vendor_libc-0.2.149_src_unix_bsd_netbsdlike_netbsd_mod.rs    Sun Mar  3 14:53:33 2024
@@ -0,0 +1,31 @@
+$NetBSD: patch-vendor_libc-0.2.149_src_unix_bsd_netbsdlike_netbsd_mod.rs,v 1.1 2024/03/03 14:53:33 he Exp $
+
+Add support for NetBSD/riscv64 and MetBSD/mipsel.
+
+Add fix to cpuid_t definition by applying
+  https://github.com/rust-lang/libc/pull/3386
+
+--- vendor/libc-0.2.149/src/unix/bsd/netbsdlike/netbsd/mod.rs.orig     2024-01-08 07:25:50.125422539 +0000
++++ vendor/libc-0.2.149/src/unix/bsd/netbsdlike/netbsd/mod.rs
+@@ -10,7 +10,7 @@ type __pthread_spin_t = __cpu_simple_loc
+ pub type vm_size_t = ::uintptr_t; // FIXME: deprecated since long time
+ pub type lwpid_t = ::c_uint;
+ pub type shmatt_t = ::c_uint;
+-pub type cpuid_t = u64;
++pub type cpuid_t = ::c_ulong;
+ pub type cpuset_t = _cpuset;
+ pub type pthread_spin_t = ::c_uchar;
+ pub type timer_t = ::c_int;
+@@ -3208,6 +3208,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 = "riscv64")] {
++        mod riscv64;
++        pub use self::riscv64::*;
+     } else {
+         // Unknown target_arch
+     }
Index: pkgsrc/lang/rust/patches/patch-vendor_libc-0.2.149_src_unix_bsd_netbsdlike_netbsd_riscv64.rs
diff -u /dev/null pkgsrc/lang/rust/patches/patch-vendor_libc-0.2.149_src_unix_bsd_netbsdlike_netbsd_riscv64.rs:1.1
--- /dev/null   Sun Mar  3 14:53:34 2024
+++ pkgsrc/lang/rust/patches/patch-vendor_libc-0.2.149_src_unix_bsd_netbsdlike_netbsd_riscv64.rs        Sun Mar  3 14:53:33 2024
@@ -0,0 +1,29 @@
+$NetBSD: patch-vendor_libc-0.2.149_src_unix_bsd_netbsdlike_netbsd_riscv64.rs,v 1.1 2024/03/03 14:53:33 he Exp $
+
+Add support for NetBSD/riscv64.
+
+--- vendor/libc-0.2.149/src/unix/bsd/netbsdlike/netbsd/riscv64.rs.orig 2024-01-08 07:29:24.841727520 +0000
++++ vendor/libc-0.2.149/src/unix/bsd/netbsdlike/netbsd/riscv64.rs      2024-01-08 07:33:10.924970251 +0000
+@@ -0,0 +1,22 @@
++use PT_FIRSTMACH;
++
++pub type c_long = i64;
++pub type c_ulong = u64;
++pub type c_char = u8;
++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_long>() - 1;
++    } else {
++        #[doc(hidden)]
++        pub const _ALIGNBYTES: usize = 8 - 1;
++    }
++}
++
++pub const PT_GETREGS: ::c_int = PT_FIRSTMACH + 0;
++pub const PT_SETREGS: ::c_int = PT_FIRSTMACH + 1;
++pub const PT_GETFPREGS: ::c_int = PT_FIRSTMACH + 2;
++pub const PT_SETFPREGS: ::c_int = PT_FIRSTMACH + 3;
Index: pkgsrc/lang/rust/patches/patch-vendor_libc-0.2.149_src_unix_solarish_mod.rs
diff -u /dev/null pkgsrc/lang/rust/patches/patch-vendor_libc-0.2.149_src_unix_solarish_mod.rs:1.1
--- /dev/null   Sun Mar  3 14:53:34 2024
+++ pkgsrc/lang/rust/patches/patch-vendor_libc-0.2.149_src_unix_solarish_mod.rs Sun Mar  3 14:53:33 2024
@@ -0,0 +1,15 @@
+$NetBSD: patch-vendor_libc-0.2.149_src_unix_solarish_mod.rs,v 1.1 2024/03/03 14:53:33 he Exp $
+
+Fix xattr build.
+
+--- vendor/libc-0.2.149/src/unix/solarish/mod.rs.orig  2024-01-08 13:00:15.626503385 +0000
++++ vendor/libc-0.2.149/src/unix/solarish/mod.rs
+@@ -1523,6 +1523,8 @@ pub const EOWNERDEAD: ::c_int = 58;
+ pub const ENOTRECOVERABLE: ::c_int = 59;
+ pub const ENOSTR: ::c_int = 60;
+ pub const ENODATA: ::c_int = 61;
++// This is not supported but is required for xattr
++pub const ENOATTR: ::c_int = ::ENODATA;
+ pub const ETIME: ::c_int = 62;
+ pub const ENOSR: ::c_int = 63;
+ pub const ENONET: ::c_int = 64;



Home | Main Index | Thread Index | Old Index