pkgsrc-WIP-changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
rust199: update to rust version 1.99.0.
Module Name: pkgsrc-wip
Committed By: Havard Eidnes <he%NetBSD.org@localhost>
Pushed By: he
Date: Fri Oct 2 00:14:23 2026 +0000
Changeset: e3b10412926b0c38ab557df0429852d8a1e4e1cf
Added Files:
rust199/DESCR
rust199/Makefile
rust199/README.md
rust199/buildlink3.mk
rust199/cargo.mk
rust199/cross.mk
rust199/distinfo
rust199/do-cross.mk
rust199/files/gcc-wrap
rust199/options.mk
rust199/patches/patch-compiler_rustc__codegen__ssa_src_back_linker.rs
rust199/patches/patch-compiler_rustc__llvm_build.rs
rust199/patches/patch-compiler_rustc__target_src_spec_base_netbsd.rs
rust199/patches/patch-compiler_rustc__target_src_spec_mod.rs
rust199/patches/patch-compiler_rustc__target_src_spec_targets_aarch64__be__unknown__netbsd.rs
rust199/patches/patch-compiler_rustc__target_src_spec_targets_aarch64__unknown__netbsd.rs
rust199/patches/patch-compiler_rustc__target_src_spec_targets_m68k__unknown__netbsd.rs
rust199/patches/patch-compiler_rustc__target_src_spec_targets_mips64el__unknown__netbsd.rs
rust199/patches/patch-compiler_rustc__target_src_spec_targets_mipsel__unknown__netbsd.rs
rust199/patches/patch-library_backtrace_src_symbolize_gimli.rs
rust199/patches/patch-library_backtrace_src_symbolize_gimli_elf.rs
rust199/patches/patch-src_bootstrap_Cargo.toml
rust199/patches/patch-src_bootstrap_bootstrap.py
rust199/patches/patch-src_bootstrap_src_core_build__steps_compile.rs
rust199/patches/patch-src_bootstrap_src_core_build__steps_install.rs
rust199/patches/patch-src_bootstrap_src_core_builder_cargo.rs
rust199/patches/patch-src_bootstrap_src_core_sanity.rs
rust199/patches/patch-src_bootstrap_src_lib.rs
rust199/patches/patch-src_llvm-project_llvm_CMakeLists.txt
rust199/patches/patch-src_llvm-project_llvm_cmake_modules_AddLLVM.cmake
rust199/patches/patch-src_llvm-project_llvm_include_llvm-c_DataTypes.h
rust199/patches/patch-src_llvm-project_llvm_include_llvm_Analysis_ConstantFolding.h
rust199/patches/patch-src_llvm-project_llvm_lib_TargetParser_TargetDataLayout.cpp
rust199/patches/patch-src_tools_cargo_src_workspace_profiles.rs
rust199/patches/patch-src_tools_cargo_tests_testsuite_build.rs
rust199/patches/patch-src_tools_rust-installer_install-template.sh
rust199/patches/patch-tests_assembly-llvm_targets_targets-elf.rs
rust199/patches/patch-vendor_crossbeam-utils-0.8.20_no__atomic.rs
rust199/patches/patch-vendor_crossbeam-utils-0.8.21_no__atomic.rs
rust199/patches/patch-vendor_libc-0.2.155_src_unix_bsd_netbsdlike_netbsd_mod.rs
rust199/patches/patch-vendor_libc-0.2.155_src_unix_solarish_mod.rs
rust199/patches/patch-vendor_libc-0.2.168_src_unix_bsd_netbsdlike_netbsd_mod.rs
rust199/patches/patch-vendor_libc-0.2.168_src_unix_bsd_netbsdlike_netbsd_riscv64.rs
rust199/patches/patch-vendor_libc-0.2.168_src_unix_solarish_mod.rs
rust199/patches/patch-vendor_libc-0.2.169_src_unix_bsd_netbsdlike_netbsd_mod.rs
rust199/patches/patch-vendor_libc-0.2.169_src_unix_bsd_netbsdlike_netbsd_riscv64.rs
rust199/patches/patch-vendor_libc-0.2.169_src_unix_solarish_mod.rs
rust199/patches/patch-vendor_libc-0.2.172_src_unix_bsd_netbsdlike_netbsd_riscv64.rs
rust199/patches/patch-vendor_libc-0.2.172_src_unix_solarish_mod.rs
rust199/patches/patch-vendor_libc-0.2.183_src_unix_bsd_netbsdlike_netbsd_m68k.rs
rust199/patches/patch-vendor_libc-0.2.183_src_unix_bsd_netbsdlike_netbsd_mod.rs
rust199/patches/patch-vendor_libc-0.2.184_src_unix_bsd_netbsdlike_netbsd_m68k.rs
rust199/patches/patch-vendor_libc-0.2.184_src_unix_bsd_netbsdlike_netbsd_mod.rs
rust199/patches/patch-vendor_libc-0.2.186_src_unix_bsd_netbsdlike_netbsd_m68k.rs
rust199/patches/patch-vendor_libc-0.2.186_src_unix_bsd_netbsdlike_netbsd_mod.rs
rust199/patches/patch-vendor_libc-0.2.189_src_unix_bsd_netbsdlike_netbsd_m68k.rs
rust199/patches/patch-vendor_libc-0.2.189_src_unix_bsd_netbsdlike_netbsd_mod.rs
rust199/patches/patch-vendor_line-index-0.1.2_src_lib.rs
rust199/patches/patch-vendor_lzma-sys-0.1.20_config.h
rust199/patches/patch-vendor_memchr-2.7.2_src_vector.rs
rust199/patches/patch-vendor_memchr-2.7.4_src_vector.rs
rust199/patches/patch-vendor_memchr-2.7.5_src_vector.rs
rust199/patches/patch-vendor_memchr-2.7.6_src_vector.rs
rust199/patches/patch-vendor_memchr-2.8.0_src_vector.rs
rust199/patches/patch-vendor_openssl-src-111.28.2+1.1.1w_openssl_Configurations_10-main.conf
rust199/patches/patch-vendor_openssl-src-111.28.2+1.1.1w_openssl_crypto_aria_aria.c
rust199/patches/patch-vendor_openssl-src-111.28.2+1.1.1w_src_lib.rs
rust199/patches/patch-vendor_openssl-src-300.5.0+3.5.0_openssl_Configurations_10-main.conf
rust199/patches/patch-vendor_openssl-src-300.5.0+3.5.0_openssl_crypto_aria_aria.c
rust199/patches/patch-vendor_openssl-src-300.5.0+3.5.0_src_lib.rs
rust199/patches/patch-vendor_openssl-src-300.6.1+3.6.3_openssl_Configurations_10-main.conf
rust199/patches/patch-vendor_openssl-src-300.6.1+3.6.3_openssl_crypto_aria_aria.c
rust199/patches/patch-vendor_openssl-src-300.6.1+3.6.3_src_lib.rs
rust199/patches/patch-vendor_openssl-sys-0.9.107_build_find__normal.rs
rust199/patches/patch-vendor_openssl-sys-0.9.107_build_main.rs
rust199/patches/patch-vendor_openssl-sys-0.9.114_build_find__normal.rs
rust199/patches/patch-vendor_openssl-sys-0.9.114_build_main.rs
rust199/patches/patch-vendor_openssl-sys-0.9.117_build_find__normal.rs
rust199/patches/patch-vendor_openssl-sys-0.9.117_build_main.rs
rust199/patches/patch-vendor_openssl-sys-0.9.92_build_find__normal.rs
rust199/patches/patch-vendor_openssl-sys-0.9.92_build_main.rs
rust199/patches/patch-vendor_rustc-ap-rustc__target_src_spec_aarch64__be__unknown__netbsd.rs
rust199/patches/patch-vendor_zerocopy-0.7.35_src_lib.rs
rust199/patches/patch-vendor_zeroize-1.8.1_src_lib.rs
rust199/platform.mk
rust199/rust.mk
Log Message:
rust199: update to rust version 1.99.0.
Pkgsrc changes:
* Adapt to changes in vendored crate versions.
* Version & checksum changes.
Upstream changes:
Version 1.99.0 (2026-10-01)
==========================
Language
--------
- [Add allow-by-default `raw_borrows_via_references` lint that
checks for references that decay immediately into raw
borrows](https://github.com/rust-lang/rust/pull/138230)
- [Extend `unconditional_panic` lint to function calls that panic
when the chunks/windows size is zero]
(https://github.com/rust-lang/rust/pull/153563)
- [Stabilize C-variadic function definitions]
(https://github.com/rust-lang/rust/pull/155697)
- [Stabilize the ability to use `#[unsafe(naked)]` functions to
define C-variadic functions (`#![feature(c_variadic_naked_functions)]`).]
(https://github.com/rust-lang/rust/pull/159746)
- [Trait methods are now resolved on an adjusted never type (producing a FCW)]
(https://github.com/rust-lang/rust/pull/156047)
- [Coerce from inference variables to trait objects if the inference
variable is related via subtyping to a type that is known to be `Sized`]
(https://github.com/rust-lang/rust/pull/157820)
- [Stabilize `#[my_macro] mod foo;`]
(https://github.com/rust-lang/rust/pull/157857). This allows
outlined modules (`mod foo;`) anywhere in the body of a custom
attribute or derive macro.
- [Fix the `overflowing_literals` lint with repeated negation]
(https://github.com/rust-lang/rust/pull/158302). For instance,
it will now no longer lint on `--128_i8`, which is already detected
by the `arithmetic_overflow` lint.
- [Add POSIX symbols to the `invalid_runtime_symbol_definitions`
and `suspicious_runtime_symbol_definitions` lints]
(https://github.com/rust-lang/rust/pull/158522)
- [Lint unused `#[path]` attributes on inline modules]
(https://github.com/rust-lang/rust/pull/158835)
- [Enable `unreachable_cfg_select_predicates` lint as part of
`unused` lint group] (https://github.com/rust-lang/rust/pull/159179)
- [Stabilize passing 128-bit integers via vector registers with `asm!` on x86]
(https://github.com/rust-lang/rust/pull/159525)
- [Explicitly document that some allocations are allowed to grow
in-place (but none are allowed to shrink)]
(https://github.com/rust-lang/rust/pull/159729)
- We now [guarantee]
(https://github.com/rust-lang/rust/pull/159730) that the contents
of an `UnsafeCell` can be accessed without going through `get`
- [The `invalid_reference_casting` lint was adjusted accordingly]
(https://github.com/rust-lang/rust/pull/159960)
- [Account for globally enabled target features in `global_asm!`]
(https://github.com/rust-lang/rust/pull/160594)
- [Warn if an invalid `doc` attribute is used on a macro invocation]
(https://github.com/rust-lang/rust/pull/161003)
Compiler
--------
- [Convert `-Ctarget-cpu` into a target-modifier for AVR, AMDGCN and NVPTX]
(https://github.com/rust-lang/rust/pull/150732)
- [Enable `static_position_independent_executables` on all gnu and musl targets]
(https://github.com/rust-lang/rust/pull/158510)
- When providing a suggestion about a missing method, rustc now
prefers an exactly matching name from a [doc alias attribute]
(https://doc.rust-lang.org/rustdoc/advanced-features.html#add-aliases-for-an-item-in-documentation-search)
over a similarity search from other method names. If your new
users sometimes expect a method under a different name, adding
a doc alias will now help them find it via rustc suggestions, in
addition to helping them find it via rustdoc search: [When
suggesting method names, prefer *exact* doc aliases over similar
names](https://github.com/rust-lang/rust/pull/160369)
Platform Support
----------------
- [Promote `riscv64-unknown-linux-musl` to Tier 2 with host tools]
(https://github.com/rust-lang/rust/pull/158766)
Refer to Rust's [platform support page][platform-support-doc]
for more information on Rust's tiered platform support.
[platform-support-doc]: https://doc.rust-lang.org/rustc/platform-support.html
Libraries
---------
- Iteration on `RangeInclusive` (`a..=b` ranges) is now [optimized
better in some circumstances]
(https://github.com/rust-lang/rust/pull/155114). As a side effect
of this, the behavior of `RangeInclusive` values that has already
been exhausted (as an iterator) has changed. For example, the
return values of `start()` and `end()` on such ranges may return
different values, and using such ranges as slice indexes may have
different behavior. These behaviors were not guaranteed to be
stable, so these changes are considered to not be breaking changes.
- [Relax `transmute_copy` to accept `?Sized` types]
(https://github.com/rust-lang/rust/pull/155989)
- [Update `transmute_copy` to use a non-unwinding panic]
(https://github.com/rust-lang/rust/pull/155989)
- [Don't escape U+FF9E and U+FF9F in `escape_debug_ext`]
(https://github.com/rust-lang/rust/pull/158057)
- [Re-export `core::fmt::NumBuffer` in `alloc` (and `std`)]
(https://github.com/rust-lang/rust/pull/161430)
Stabilized APIs
---------------
- [`IntoIterator` for `Box<[T; N]>`]
(https://doc.rust-lang.org/stable/std/iter/trait.IntoIterator.html#impl-IntoIterator-for-Box%3C%5BT;+N%5D,+A%3E)
- [`IntoIterator` for `&Box<[T; N]>`]
(https://doc.rust-lang.org/stable/std/iter/trait.IntoIterator.html#impl-IntoIterator-for-%26Box%3C%5BT;+N%5D,+A%3E)
- [`IntoIterator` for `&mut Box<[T; N]>`]
(https://doc.rust-lang.org/stable/std/iter/trait.IntoIterator.html#impl-IntoIterator-for-%26mut+Box%3C%5BT;+N%5D,+A%3E)
- [`VecDeque::retain_back`]
(https://doc.rust-lang.org/stable/std/collections/struct.VecDeque.html#method.retain_back)
- [`core::ffi::VaList`]
(https://doc.rust-lang.org/stable/core/ffi/struct.VaList.html)
- [`Box::into_non_null`]
(https://doc.rust-lang.org/stable/std/boxed/struct.Box.html#method.into_non_null)
- [`Box::from_non_null`]
(https://doc.rust-lang.org/stable/std/boxed/struct.Box.html#method.from_non_null)
- [`Vec::into_parts`]
(https://doc.rust-lang.org/stable/std/vec/struct.Vec.html#method.into_parts)
- [`Vec::from_parts`]
(https://doc.rust-lang.org/stable/std/vec/struct.Vec.html#method.from_parts)
- [`core::mem::size_of_val_raw`]
(https://doc.rust-lang.org/stable/core/mem/fn.size_of_val_raw.html)
- [`core::mem::align_of_val_raw`]
(https://doc.rust-lang.org/stable/core/mem/fn.align_of_val_raw.html)
- [`core::alloc::Layout::for_value_raw`]
(https://doc.rust-lang.org/stable/core/alloc/struct.Layout.html#method.for_value_raw)
- [`String::from_utf8_lossy_owned`]
(https://doc.rust-lang.org/stable/std/string/struct.String.html#method.from_utf8_lossy_owned)
- [`string::FromUtf8Error::into_utf8_lossy`]
(https://doc.rust-lang.org/stable/std/string/struct.FromUtf8Error.html#method.into_utf8_lossy)
- [`FusedIterator for StepBy<I>`]
(https://doc.rust-lang.org/stable/std/iter/struct.StepBy.html#impl-FusedIterator-for-StepBy%3CI%3E)
- [`std::fs::set_times`]
(https://doc.rust-lang.org/stable/std/fs/fn.set_times.html)
- [`std::fs::set_times_nofollow`]
(https://doc.rust-lang.org/stable/std/fs/fn.set_times_nofollow.html)
Cargo
-----
- Add a new built-in profile `debug`. This is a preparation for
transitioning the `dev` profile away from debugging to give a saner
default for faster development iterations. Currently there is no
difference between `dev` and `debug` profiles. [docs]
(https://doc.rust-lang.org/nightly/cargo/reference/profiles.html#debug-1)
[#17214] (https://github.com/rust-lang/cargo/pull/17214)
- Workspace members on edition 2024 or later can now override an
inherited workspace dependency's `default-features` field. For
example, `serde = { workspace = true, default-features = false }`
now turns off default features even when the workspace definition
enables them. On earlier editions, `default-features = false` is
ignored with a warning. ([RFC 3945]
(https://github.com/rust-lang/rfcs/pull/3945))
[#17126](https://github.com/rust-lang/cargo/pull/17126)
- Incremental compilation is now disabled by default when running
in CI. CI is detected via the CI environment variable. [#17220]
(https://github.com/rust-lang/cargo/pull/17220)
See also the [full Cargo changelog]
(https://doc.rust-lang.org/nightly/cargo/CHANGELOG.html#cargo-199-2026-10-01)
Rustdoc
-----
- [Add new `unused_footnote_definition` rustdoc lint]
(https://github.com/rust-lang/rust/pull/137858)
- Smarter filtering of trait impls yields performance improvements
of 20% on average and up to 40% on some real-world crates. ([1]
(https://github.com/rust-lang/rust/pull/159623),
[2](https://github.com/rust-lang/rust/pull/159721),
[3](https://github.com/rust-lang/rust/pull/159779),
[4](https://github.com/rust-lang/rust/pull/159854),
[5](https://github.com/rust-lang/rust/pull/159091))
Compatibility Notes
-------------------
- [Fully deprecate the legacy integral modules]
(https://github.com/rust-lang/rust/pull/146882). For example,
`std::i32::MAX` should be accessed via `i32::MAX` instead.
- [Upgrade `no_mangle_generic_items` into hard error]
(https://github.com/rust-lang/rust/pull/154585)
- [The `Pin::new_unchecked` has had its safety invariants changed slightly]
(https://github.com/rust-lang/rust/pull/156935)
- [Do not promote references to extern statics]
(https://github.com/rust-lang/rust/pull/157641)
- [Ensure that the inferred types of `let` patterns typecheck]
(https://github.com/rust-lang/rust/pull/157841)
- [hermit/fs: Return `unsupported()` instead of `from_raw_os_error(22)`]
(https://github.com/rust-lang/rust/pull/158247)
- [Fixed a bug where `#[repr(simd)]` was accidentally allowed on
macro invocations on stable Rust]
(https://github.com/rust-lang/rust/pull/158523)
- [Abort const-eval when there are generics in the type of the
value being produced]
(https://github.com/rust-lang/rust/pull/159504)
- [Attributes not applying to anything are now an error in code
blocks in doc comments]
(https://github.com/rust-lang/rust/pull/159849)
- [`Box::leak`: tell people to avoid unleaking]
(https://github.com/rust-lang/rust/pull/160323)
- [PowerPC inline ASM: Fix scalar floats being in the wrong vector
lane on little endian] (https://github.com/rust-lang/rust/pull/160441)
- [Do not take `doc(cfg())` into account when filtering doctests]
(https://github.com/rust-lang/rust/pull/159014)
- [Infer anonymous lifetimes in the types of associated consts as `'static`]
(https://github.com/rust-lang/rust/pull/156508)
- Macros that expand to a semicolon now produce a warning lint
(`semicolon_in_expressions_from_non_local_macros`) even when the
macro comes from another crate. Previously, such warnings only
appeared for macros from the same crate, to avoid showing warnings
that can't be fixed locally; however, this masked problems, as
integration tests from the crate providing the macro get compiled
as a separate crate, so tests often wouldn't reveal this issue. If
you encounter a lint like this, please make sure to report it to
the crate providing the macro so they can fix it; don't just silence
it in your own crate.
- [`semicolon_in_expressions_from_macros`: Lint on non-local
macros too] (https://github.com/rust-lang/rust/pull/159222)
- [Split non-local `semicolon_in_expressions_from_macros` into
a separate lint] (https://github.com/rust-lang/rust/pull/159700)
Internal Changes
----------------
These changes do not affect any public interfaces of Rust, but they represent
significant improvements to the performance or internals of rustc and related
tools.
- [Update to LLVM 23]
(https://github.com/rust-lang/rust/pull/158734)
To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=e3b10412926b0c38ab557df0429852d8a1e4e1cf
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
diffstat:
rust199/DESCR | 13 +
rust199/Makefile | 793 +++++++++++++++++++++
rust199/README.md | 38 +
rust199/buildlink3.mk | 28 +
rust199/cargo.mk | 140 ++++
rust199/cross.mk | 86 +++
rust199/distinfo | 187 +++++
rust199/do-cross.mk | 117 +++
rust199/files/gcc-wrap | 215 ++++++
rust199/options.mk | 131 ++++
...compiler_rustc__codegen__ssa_src_back_linker.rs | 27 +
.../patches/patch-compiler_rustc__llvm_build.rs | 50 ++
...-compiler_rustc__target_src_spec_base_netbsd.rs | 32 +
.../patch-compiler_rustc__target_src_spec_mod.rs | 22 +
...rc_spec_targets_aarch64__be__unknown__netbsd.rs | 17 +
...et_src_spec_targets_aarch64__unknown__netbsd.rs | 17 +
...arget_src_spec_targets_m68k__unknown__netbsd.rs | 39 +
...t_src_spec_targets_mips64el__unknown__netbsd.rs | 39 +
...get_src_spec_targets_mipsel__unknown__netbsd.rs | 14 +
.../patch-library_backtrace_src_symbolize_gimli.rs | 14 +
...ch-library_backtrace_src_symbolize_gimli_elf.rs | 26 +
rust199/patches/patch-src_bootstrap_Cargo.toml | 18 +
rust199/patches/patch-src_bootstrap_bootstrap.py | 48 ++
...-src_bootstrap_src_core_build__steps_compile.rs | 15 +
...-src_bootstrap_src_core_build__steps_install.rs | 15 +
.../patch-src_bootstrap_src_core_builder_cargo.rs | 26 +
.../patches/patch-src_bootstrap_src_core_sanity.rs | 26 +
rust199/patches/patch-src_bootstrap_src_lib.rs | 40 ++
.../patch-src_llvm-project_llvm_CMakeLists.txt | 18 +
...c_llvm-project_llvm_cmake_modules_AddLLVM.cmake | 49 ++
...rc_llvm-project_llvm_include_llvm-c_DataTypes.h | 34 +
...ct_llvm_include_llvm_Analysis_ConstantFolding.h | 18 +
...ject_llvm_lib_TargetParser_TargetDataLayout.cpp | 74 ++
...patch-src_tools_cargo_src_workspace_profiles.rs | 17 +
.../patch-src_tools_cargo_tests_testsuite_build.rs | 39 +
...ch-src_tools_rust-installer_install-template.sh | 48 ++
...atch-tests_assembly-llvm_targets_targets-elf.rs | 16 +
...tch-vendor_crossbeam-utils-0.8.20_no__atomic.rs | 13 +
...tch-vendor_crossbeam-utils-0.8.21_no__atomic.rs | 13 +
...c-0.2.155_src_unix_bsd_netbsdlike_netbsd_mod.rs | 15 +
...ch-vendor_libc-0.2.155_src_unix_solarish_mod.rs | 15 +
...c-0.2.168_src_unix_bsd_netbsdlike_netbsd_mod.rs | 15 +
...2.168_src_unix_bsd_netbsdlike_netbsd_riscv64.rs | 44 ++
...ch-vendor_libc-0.2.168_src_unix_solarish_mod.rs | 15 +
...c-0.2.169_src_unix_bsd_netbsdlike_netbsd_mod.rs | 15 +
...2.169_src_unix_bsd_netbsdlike_netbsd_riscv64.rs | 90 +++
...ch-vendor_libc-0.2.169_src_unix_solarish_mod.rs | 15 +
...2.172_src_unix_bsd_netbsdlike_netbsd_riscv64.rs | 89 +++
...ch-vendor_libc-0.2.172_src_unix_solarish_mod.rs | 15 +
...-0.2.183_src_unix_bsd_netbsdlike_netbsd_m68k.rs | 17 +
...c-0.2.183_src_unix_bsd_netbsdlike_netbsd_mod.rs | 16 +
...-0.2.184_src_unix_bsd_netbsdlike_netbsd_m68k.rs | 17 +
...c-0.2.184_src_unix_bsd_netbsdlike_netbsd_mod.rs | 16 +
...-0.2.186_src_unix_bsd_netbsdlike_netbsd_m68k.rs | 17 +
...c-0.2.186_src_unix_bsd_netbsdlike_netbsd_mod.rs | 16 +
...-0.2.189_src_unix_bsd_netbsdlike_netbsd_m68k.rs | 17 +
...c-0.2.189_src_unix_bsd_netbsdlike_netbsd_mod.rs | 16 +
.../patch-vendor_line-index-0.1.2_src_lib.rs | 42 ++
.../patches/patch-vendor_lzma-sys-0.1.20_config.h | 25 +
.../patch-vendor_memchr-2.7.2_src_vector.rs | 34 +
.../patch-vendor_memchr-2.7.4_src_vector.rs | 34 +
.../patch-vendor_memchr-2.7.5_src_vector.rs | 34 +
.../patch-vendor_memchr-2.7.6_src_vector.rs | 34 +
.../patch-vendor_memchr-2.8.0_src_vector.rs | 34 +
...28.2+1.1.1w_openssl_Configurations_10-main.conf | 18 +
...-src-111.28.2+1.1.1w_openssl_crypto_aria_aria.c | 18 +
...h-vendor_openssl-src-111.28.2+1.1.1w_src_lib.rs | 67 ++
...0.5.0+3.5.0_openssl_Configurations_10-main.conf | 18 +
...sl-src-300.5.0+3.5.0_openssl_crypto_aria_aria.c | 18 +
...tch-vendor_openssl-src-300.5.0+3.5.0_src_lib.rs | 30 +
...0.6.1+3.6.3_openssl_Configurations_10-main.conf | 18 +
...sl-src-300.6.1+3.6.3_openssl_crypto_aria_aria.c | 17 +
...tch-vendor_openssl-src-300.6.1+3.6.3_src_lib.rs | 30 +
...endor_openssl-sys-0.9.107_build_find__normal.rs | 30 +
.../patch-vendor_openssl-sys-0.9.107_build_main.rs | 23 +
...endor_openssl-sys-0.9.114_build_find__normal.rs | 30 +
.../patch-vendor_openssl-sys-0.9.114_build_main.rs | 23 +
...endor_openssl-sys-0.9.117_build_find__normal.rs | 30 +
.../patch-vendor_openssl-sys-0.9.117_build_main.rs | 23 +
...vendor_openssl-sys-0.9.92_build_find__normal.rs | 30 +
.../patch-vendor_openssl-sys-0.9.92_build_main.rs | 23 +
...target_src_spec_aarch64__be__unknown__netbsd.rs | 27 +
.../patch-vendor_zerocopy-0.7.35_src_lib.rs | 25 +
.../patches/patch-vendor_zeroize-1.8.1_src_lib.rs | 15 +
rust199/platform.mk | 34 +
rust199/rust.mk | 68 ++
86 files changed, 3884 insertions(+)
diffs:
diff --git a/rust199/DESCR b/rust199/DESCR
new file mode 100644
index 0000000000..6dc90a671e
--- /dev/null
+++ b/rust199/DESCR
@@ -0,0 +1,13 @@
+Rust is a systems programming language focused on three goals: safety,
+speed, and concurrency. It maintains these goals without having a
+garbage collector, making it a useful language for a number of use cases
+other languages aren't good at: embedding in other languages, programs
+with specific space and time requirements, and writing low-level code,
+like device drivers and operating systems.
+
+It improves on current languages targeting this space by having a number
+of compile-time safety checks that produce no runtime overhead, while
+eliminating all data races. Rust also aims to achieve "zero-cost
+abstractions" even though some of these abstractions feel like those of
+a high-level language. Even then, Rust still allows precise control
+like a low-level language would.
diff --git a/rust199/Makefile b/rust199/Makefile
new file mode 100644
index 0000000000..eec969f525
--- /dev/null
+++ b/rust199/Makefile
@@ -0,0 +1,793 @@
+# $NetBSD: Makefile,v 1.360 2026/05/14 16:41:22 ryoon Exp $
+
+DISTNAME= rustc-1.99.0-src
+PKGNAME= ${DISTNAME:S/rustc/rust/:S/-src//}
+CATEGORIES= lang
+MASTER_SITES= https://static.rust-lang.org/dist/
+EXTRACT_SUFX= .tar.xz
+
+MAINTAINER= pkgsrc-users%NetBSD.org@localhost
+HOMEPAGE= https://www.rust-lang.org/
+COMMENT= Safe, concurrent, practical language
+LICENSE= mit OR apache-2.0
+
+CONFLICTS+= rust-bin-[0-9]*
+
+# LLVM uses -std=c++17
+USE_CXX_FEATURES+= c++17
+USE_GCC_RUNTIME= yes
+USE_LANGUAGES= c c++
+USE_LIBTOOL= yes
+USE_TOOLS+= bash grep gmake perl:build pkg-config
+
+# This is a bug:
+# https://github.com/rust-lang/rust/issues/130708
+# "Building rust 1.81.0 does network access in the "build" phase"
+# but set it for now to allow progress in finding other build issues.
+#ALLOW_NETWORK_ACCESS= yes
+# Ref. dist.vendor below.
+
+# The NetBSD bootstraps are built for NetBSD 9 (because rust doesn't
+# build on 8 or earlier), or because the target didn't exist in 8
+# or 9 (as in riscv64). Therefore, mark earlier versions as broken.
+BROKEN_ON_PLATFORM+= NetBSD-[1-8].*-*
+
+HAS_CONFIGURE= yes
+PYTHON_FOR_BUILD_ONLY= tool
+CONFIG_SHELL= ${TOOL_PYTHONBIN}
+CONFIGURE_SCRIPT= src/bootstrap/configure.py
+CONFIGURE_ARGS+= --prefix=${PREFIX}
+CONFIGURE_ARGS+= --mandir=${PREFIX}/${PKGMANDIR}
+CONFIGURE_ARGS+= --sysconfdir=${PKG_SYSCONFDIR}
+CONFIGURE_ARGS+= --python=${TOOL_PYTHONBIN}
+CONFIGURE_ARGS+= --release-channel=stable
+CONFIGURE_ARGS+= --local-rust-root=${RUST_BOOTSTRAP_PATH}
+CONFIGURE_ARGS+= --enable-extended # Build and install cargo too.
+CONFIGURE_ARGS+= --enable-rpath
+CONFIGURE_ARGS+= --disable-codegen-tests
+CONFIGURE_ARGS+= --disable-compiler-docs
+CONFIGURE_ARGS+= --disable-llvm-static-stdcpp
+CONFIGURE_ARGS+= --disable-ninja
+CONFIGURE_ARGS+= --dist-compression-formats=xz
+# Ref. issue #130708 & backport of pull-request 130110
+CONFIGURE_ARGS+= --set dist.vendor=false
+
+CGC= compiler/rustc_codegen_cranelift
+REPLACE_BASH+= ${CGC}/.github/scripts/free-disk-space.sh
+REPLACE_BASH+= library/portable-simd/subtree-sync.sh
+CB= library/compiler-builtins
+REPLACE_BASH+= ${CB}/ci/bench-icount.sh
+REPLACE_BASH+= ${CB}/ci/install-bench-deps.sh
+REPLACE_BASH+= ${CB}/ci/miri.sh
+REPLACE_BASH+= ${CB}/ci/run-docker.sh
+REPLACE_BASH+= ${CB}/ci/run-extensive.sh
+REPLACE_BASH+= ${CB}/ci/run.sh
+
+REPLACE_PYTHON+= ${CB}/ci/ci-util.py
+REPLACE_PYTHON+= ${CB}/etc/update-api-list.py
+
+# This one is evidently coming from a vendored crates where all the
+# files are checksummed & locked. Applying a substitution with a
+# somewhat "unknown" result then becomes problematical or at best
+# overly complicated.
+RL= lib/rustlib/src/rust
+CHECK_INTERPRETER_SKIP+=${RL}/library/vendor/libc-0.2.189/etc/libc-util.py
+
+# Include (optional) settings to cross-build rust
+.include "cross.mk"
+
+# optional from do-cross.mk
+CONFIGURE_ARGS+= ${ADD_CONFIGURE_ARGS}
+
+# This should allow us to perform "offline" builds (so cargo doesn't fetch
+# dependencies during the build stage) but this isn't hooked up yet.
+CONFIGURE_ARGS+= --enable-vendor
+
+# cargo defaults to using the number of available CPUs
+MAKE_ENV+= CARGO_BUILD_JOBS=${_MAKE_JOBS_N}
+
+CFLAGS.SunOS+= -D_POSIX_PTHREAD_SEMANTICS
+MAKE_ENV.SunOS+= AR=gar
+MAKE_ENV.SunOS+= BOOTSTRAP_SKIP_TARGET_SANITY=1
+
+# Debugging of crate resolution
+# Annoyingly, this makes the powerpc build succeed...
+#MAKE_ENV+= RUSTC_LOG=rustc_metadata
+
+UNLIMIT_RESOURCES+= cputime stacksize datasize virtualsize
+
+TEST_TARGET= check
+
+# bin/* lib/*, but names vary
+CHECK_RELRO_SUPPORTED= no
+CHECK_SSP_SUPPORTED= no
+
+.include "../../mk/bsd.prefs.mk"
+
+.if ${OPSYS} == "NetBSD"
+# Getting RPATH with $ORIGIN into the bootstrap binaries is
+# problematic, since pkgsrc refuses to put $ORIGIN into RPATHs
+# of executables. So instead we need these so that the bootstrap
+# compiler can be run out of the $RUST_BOOTSTRAP_PATH directory as
+# part of the initial part of the rust compiler build.
+# This problem is not present with the amd64 bootstrap bits,
+# which are built by our upstream and uses $ORIGIN/../lib in RPATH.
+#
+# The above is only true on NetBSD, for other bootstrap kits (e.g. illumos)
+# the binaries are made to be relocatable after the build using elfedit or
+# similar. It is unclear why this approach is not used by NetBSD too.
+#
+MAKE_ENV+= LD_LIBRARY_PATH=${RUST_BOOTSTRAP_PATH:Q}/lib
+PKGSRC_MAKE_ENV+= LD_LIBRARY_PATH=${RUST_BOOTSTRAP_PATH:Q}/lib
+.endif
+
+# TODO: Hack introduced for 1.86.0 as @loader_path is stripped from the
+# bootstrap compiler arguments and the stage1 libraries cannot be found.
+# Ideally this should be inserted only in the necessary points of the
+# bootstrap script.
+.if ${OPSYS} == "Darwin"
+MAKE_ENV+= DYLD_LIBRARY_PATH="${WRKSRC}/build/${MACHINE_ARCH}-apple-darwin/stage1/lib:${WRKSRC}/build/${MACHINE_ARCH}-apple-darwin/stage2/lib"
+.endif
+
+# Allow overriding MAKE_JOBS_SAFE
+# some may chose to mostly build faster,
+# and deal with any failures due to deadlocks
+.if !empty(rust.MAKE_JOBS_SAFE)
+. if ${rust.MAKE_JOBS_SAFE:tl} == "yes"
+MAKE_JOBS_SAFE= yes
+. endif
+.endif
+
+.if !empty(rust.BUILD_TARGET)
+BUILD_TARGET= ${rust.BUILD_TARGET}
+.endif
+
+.if !empty(TARGET)
+# Use "dist" build target for cross compile of bootstrap
+BUILD_TARGET?= dist
+.else
+BUILD_TARGET?= build
+.endif
+
+.if ${MACHINE_PLATFORM:MNetBSD-*-powerpc} || \
+ ${MACHINE_PLATFORM:MNetBSD-*-earmv[67]hf} || \
+ ${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.
+CONFIGURE_ARGS+= --disable-debug
+CONFIGURE_ARGS+= --disable-debug-assertions
+CONFIGURE_ARGS+= --disable-llvm-release-debuginfo
+CONFIGURE_ARGS+= --debuginfo-level=0
+CONFIGURE_ARGS+= --debuginfo-level-rustc=0
+CONFIGURE_ARGS+= --debuginfo-level-std=0
+CONFIGURE_ARGS+= --debuginfo-level-tools=0
+CONFIGURE_ARGS+= --debuginfo-level-tests=0
+.endif
+
+# Only build the ARM target on/for this host, due to resource constraints
+.if ${MACHINE_PLATFORM:MNetBSD-*-earmv[67]hf}
+CONFIGURE_ARGS+= --set llvm.targets="ARM"
+.endif
+# When cross-building for ARM on X86, X86 needs to go along due
+# to 2-stage build process
+.if !empty(TARGET:Marmv[67]-unknown-netbsd-eabihf)
+CONFIGURE_ARGS+= --set llvm.targets="ARM;X86"
+.endif
+# Same for mips:
+.if ${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
+
+RUSTLIB_COMPILER= lib/rustlib/rustc-src/rust/compiler
+RUSTC_CG_CRANELIFT= ${RUSTLIB_COMPILER}/rustc_codegen_cranelift
+
+CHECK_INTERPRETER_SKIP+= ${RUSTC_CG_CRANELIFT}/scripts/filter_profile.rs
+CHECK_INTERPRETER_SKIP+= ${RUSTC_CG_CRANELIFT}/scripts/rustup.sh
+CHECK_INTERPRETER_SKIP+= ${RUSTC_CG_CRANELIFT}/scripts/test_bootstrap.sh
+CHECK_INTERPRETER_SKIP+= ${RUSTC_CG_CRANELIFT}/scripts/test_rustc_tests.sh
+CHECK_INTERPRETER_SKIP+= ${RUSTLIB_COMPILER}/rustc_codegen_gcc/y.sh
+CHECK_INTERPRETER_SKIP+= lib/rustlib/src/rust/library/backtrace/ci/*.sh
+CHECK_INTERPRETER_SKIP+= lib/rustlib/src/rust/library/core/src/unicode/printable.py
+CHECK_INTERPRETER_SKIP+= lib/rustlib/src/rust/library/stdarch/ci/*.sh
+CHECK_PORTABILITY_SKIP+= tests/run-make/dump-ice-to-disk/check.sh
+CHECK_PORTABILITY_SKIP+= vendor/libdbus-sys-0.2.5/vendor/dbus/tools/cmake-format
+
+.if ${OPSYS} == "NetBSD"
+# This block contains information about known trouble on NetBSD and workarounds.
+
+# Parallel builds failed on NetBSD due to dynamic linker locking bugs.
+# \todo Explain if the build is believed to be sound if not parallel,
+# or if a non-parallel build is merely more likely to work.
+#
+# See toolchain/54192 at
+# http://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=54192
+# which was fixed in -current on 2020-04-19:
+# http://mail-index.netbsd.org/source-changes/2020/04/16/msg116256.html
+# http://mail-index.netbsd.org/source-changes/2020/04/19/msg116337.html
+# These were pulled up to netbsd-9 on 2020-05-13:
+# http://releng.netbsd.org/cgi-bin/req-9.cgi?show=907
+# This has not been pulled up to netbsd-8
+# \todo Explain if it's not applicable, shouldn't be pulled up, should be
+# but hasn't, is too hard, etc.
+#
+# On pkgbuild for 2020Q1 9.0_RELEASE amd64, rust did not build despite
+# MAKE_JOBS_SAFE=no, but setting MAKE_JOBS=1 resulted in success. (No
+# PR is open for this.) \todo Understand and fix.
+#
+# If we aren't on 9-current, and are on 8.x or 9.x, avoid parallel.
+# Release 9.x and 9.1 or later is OK.
+. if ${OPSYS} == "NetBSD" && ${OPSYS_VERSION} > 090999 && ${OPSYS_VERSION} < 090900
+MAKE_JOBS_SAFE?= no
+. endif
+
+# Open PRs
+#
+# Broken package with PREFIX not /usr/pkg:
+# http://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=54453
+#
+
+.endif
+
+#
+# Under NetBSD, do not use DT_RUNPATH
+#
+BUILDLINK_TRANSFORM.NetBSD+= rm:-Wl,--enable-new-dtags
+
+#
+# Somewhere in the LLVM build "-arch x86_64" is passed on macOS/arm64 which
+# breaks linking, see https://github.com/rust-lang/rust/issues/81790. Until
+# this can be located (proving difficult!) we just force it.
+#
+.if ${MACHINE_PLATFORM:MDarwin-*-aarch64}
+BUILDLINK_TRANSFORM+= opt:x86_64:arm64
+.endif
+
+#
+# Rust unfortunately requires itself to build. On platforms which aren't
+# supported by upstream (where they offer binary bootstraps), or where we do
+# not trust random binaries from the Internet, we need to build and provide our
+# own bootstrap. See the stage0-bootstrap below for more details.
+#
+DISTFILES:= ${DEFAULT_DISTFILES}
+
+.if ${MACHINE_PLATFORM:MDarwin-*-aarch64} || make(distinfo) || make (makesum) || make(mdi)
+RUST_STAGE0_VER= 1.98.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.98.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.98.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.98.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.98.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.98.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.98.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
+DISTFILES:= ${DISTFILES} ${RUST_STAGE0} ${RUST_STD_STAGE0}
+.endif
+.if ${MACHINE_PLATFORM:MSunOS-*-x86_64} || make(distinfo) || make (makesum) || make(mdi)
+RUST_STAGE0_VER= 1.98.1
+RUST_ARCH:= x86_64-unknown-illumos
+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}
+# Override default "x86_64-sun-solaris" selection
+CONFIGURE_ARGS+= --set=target.${RUST_ARCH}.llvm-config=${LLVM_CONFIG_PATH}
+CONFIGURE_ARGS+= --build=${RUST_ARCH}
+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.98.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.98.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
+SITES.${RUST_STAGE0}= ${MASTER_SITE_LOCAL:=rust/}
+SITES.${RUST_STD_STAGE0}= ${MASTER_SITE_LOCAL:=rust/}
+DISTFILES:= ${DISTFILES} ${RUST_STAGE0} ${RUST_STD_STAGE0}
+# Setting this changes it for every distfile, which doesn't match what is
+# currently in distinfo.
+#DIST_SUBDIR= ${PKGNAME}
+# For atomic ops
+CFLAGS+= -march=i586
+CONFIGURE_ARGS+= --build=${RUST_ARCH}
+pre-build: pre-build-fix-paxctl
+.PHONY: pre-build-fix-paxctl
+pre-build-fix-paxctl:
+ ${TOOLS_PLATFORM.paxctl} +am ${WRKDIR}/rust-bootstrap/bin/cargo
+ ${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.98.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.98.1
+RUST_ARCH= powerpc-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}
+SITES.${RUST_STAGE0}= ${MASTER_SITE_LOCAL:=rust/}
+SITES.${RUST_STD_STAGE0}= ${MASTER_SITE_LOCAL:=rust/}
+.endif
+.if ${MACHINE_PLATFORM:MNetBSD-*-aarch64} || make(distinfo) || make (makesum) || make(mdi)
+RUST_STAGE0_VER= 1.98.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
+DISTFILES:= ${DISTFILES} ${RUST_STAGE0} ${RUST_STD_STAGE0}
+SITES.${RUST_STAGE0}= ${MASTER_SITE_LOCAL:=rust/}
+SITES.${RUST_STD_STAGE0}= ${MASTER_SITE_LOCAL:=rust/}
+.endif
+.if ${MACHINE_PLATFORM:MNetBSD-*-aarch64eb} || make(distinfo) || make (makesum) || make(mdi)
+RUST_STAGE0_VER= 1.98.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
+DISTFILES:= ${DISTFILES} ${RUST_STAGE0} ${RUST_STD_STAGE0}
+SITES.${RUST_STAGE0}= ${MASTER_SITE_LOCAL:=rust/}
+SITES.${RUST_STD_STAGE0}= ${MASTER_SITE_LOCAL:=rust/}
+.endif
+.if ${MACHINE_PLATFORM:MNetBSD-*-sparc64} || make(distinfo) || make (makesum) || make(mdi)
+RUST_STAGE0_VER= 1.98.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
+DISTFILES:= ${DISTFILES} ${RUST_STAGE0} ${RUST_STD_STAGE0}
+SITES.${RUST_STAGE0}= ${MASTER_SITE_LOCAL:=rust/}
+SITES.${RUST_STD_STAGE0}= ${MASTER_SITE_LOCAL:=rust/}
+.endif
+.if ${MACHINE_PLATFORM:MNetBSD-*-earmv7hf} || make(distinfo) || make (makesum) || make(mdi)
+RUST_ARCH= armv7-unknown-netbsd-eabihf
+RUST_STAGE0_VER= 1.98.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}
+SITES.${RUST_STAGE0}= ${MASTER_SITE_LOCAL:=rust/}
+SITES.${RUST_STD_STAGE0}= ${MASTER_SITE_LOCAL:=rust/}
+.endif
+.if ${MACHINE_PLATFORM:MNetBSD-*-earmv6hf} || make(distinfo) || make (makesum) || make(mdi)
+RUST_ARCH= armv6-unknown-netbsd-eabihf
+RUST_STAGE0_VER= 1.98.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}
+SITES.${RUST_STAGE0}= ${MASTER_SITE_LOCAL:=rust/}
+SITES.${RUST_STD_STAGE0}= ${MASTER_SITE_LOCAL:=rust/}
+.endif
+#.if ${MACHINE_PLATFORM:MNetBSD-*-mipsel} || make(distinfo) || make (makesum) || make(mdi)
+#RUST_ARCH= mipsel-unknown-netbsd
+#RUST_STAGE0_VER= 1.98.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}
+#SITES.${RUST_STAGE0}= ${MASTER_SITE_LOCAL:=rust/}
+#SITES.${RUST_STD_STAGE0}= ${MASTER_SITE_LOCAL:=rust/}
+#.endif
+.if ${MACHINE_PLATFORM:MNetBSD-*-riscv64} || make(distinfo) || make (makesum) || make(mdi)
+RUST_ARCH= riscv64gc-unknown-netbsd
+RUST_STAGE0_VER= 1.98.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}
+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.
+.if !defined(RUST_ARCH) && !defined(RUST_BOOTSTRAP_PATH)
+NOT_FOR_PLATFORM+= ${MACHINE_PLATFORM}
+.else
+RUST_BOOTSTRAP_PATH?= ${WRKDIR}/rust-bootstrap
+.endif
+
+.if ${OPSYS} == "SunOS"
+TOOL_DEPENDS+= coreutils>=0:../../sysutils/coreutils
+TOOL_DEPENDS+= gzip>=0:../../archivers/gzip
+TOOLS_CREATE+= md5sum
+TOOLS_PATH.md5sum= ${TOOLBASE}/bin/gmd5sum
+TOOLS_PLATFORM.gzcat= ${TOOLBASE}/bin/gzip -cd
+.endif
+
+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/cargo.rs
+SUBST_FILES.prefix+= src/bootstrap/bootstrap.py
+SUBST_VARS.prefix= PREFIX
+
+#
+# Generate list of subst entries for various .cargo-checksum.json files. These
+# are all handled together in one big substitution to simplify things rather
+# than one substitution entry per file, but are kept separate below to ease
+# updating and verification.
+#
+
+CKSUM_CRATES+= vendor/crossbeam-utils-0.8.20
+CKSUM_CRATES+= vendor/crossbeam-utils-0.8.21
+CKSUMS+= fc1baa4489d9842988bacaaa545a7d7d0e2f8b93cfa0b7d1ae31f21256e4cb0a
+CKSUMS+= 8bbab76be05d066794a096725ec70fd563142e28966da34ef93f09b5bedda3ca
+
+CKSUM_CRATES+= vendor/openssl-src-300.5.0+3.5.0
+CKSUMS+= 16c0b9fa70475cfb50ac21ad4ce049b494c45b3270fed386013785a28abb8d0a
+CKSUMS+= e2817c457afa7efc0f2ca62ce9dab5254eb5ddd9a5fd9e75bba2789be92c7b14
+CKSUMS+= 6e62515e67910aea2f04b64c643aa2545732f9dd7bf0abf87d8accf8c2c1fb88
+CKSUMS+= ccc5252660386fbfec2d66423f2dc87e6da74efd39ca0fcd7c7fd583056725c1
+CKSUMS+= ac5501e7bff0f4384db0537307b362bf1bcb120d8b5859e5f08bd796e78feaea
+CKSUMS+= 6d2c2831119e059d35e81a89b08195a29e325f68acfd86a3a7157ebf8e78182d
+
+CKSUM_CRATES+= vendor/openssl-src-300.6.1+3.6.3
+CKSUMS+= f29bb8de5bfbace12cbf9f4fbf952fccc7a34e105d50105d35e99754df53f2df
+CKSUMS+= 7167b1e432a14fb4d52436b6549f358e998b494d8edb30e22ebd6e514f661769
+CKSUMS+= ebaf5be4d2ab6cf1de443a970a575bbb533cd19a53dc82e2f2fa6ef9c629c36e
+CKSUMS+= c67b20dee2ffe22c6e35ad3e2f39c76902b41e0595a4db62e1dce7887f59e8b4
+CKSUMS+= 0b3d584f0823ce98ec4bc36460c5a0e9fa3c50ac00b987f03d835bd9aef52361
+CKSUMS+= bc61fdad9fa969c350171a3ec1b0a96b145257463c8c7f06c8c332f9bf26b0e8
+CKSUMS+= c0f7ee0384ee12835abc6197122dc60ac75e33a3906dfe90bc378e62df56839d
+CKSUMS+= 7acabb818d0c2e0ace63893b7a0d2f85325445833bc85c9d72e9ac00ef5f95d8
+
+CKSUM_CRATES+= vendor/openssl-sys-0.9.107
+CKSUMS+= a0d47c624273b43b4250cff5fa2f9b75e4199ca76897608563b526aedcdf3a16
+CKSUMS+= fcfc15ca30e1f881ed46cf57597a72bd2a8307269d0394c905f23e076a983e12
+CKSUMS+= e6d478786035538d721d88b7736f602c965a38687a805cb377ebbe0ea1a14617
+CKSUMS+= e2b2473bdf7ce5f854fcef6f07f984accc53b4382dba160d625c1fcbaba31612
+
+CKSUM_CRATES+= vendor/openssl-sys-0.9.114
+CKSUMS+= 906f7cc22c01c7e505abbbc861592f5546b9a8a66ac0d79b7d5c5e909bc58ac0
+CKSUMS+= e3c1239f28dd508e145040022537b328b5e12371fa5fc45442fbbd6183d213a4
+CKSUMS+= 0c5a4bd38ed007182cfec3cf0824a4806e5c629b9d69e3cc2a5b6e9be3eec280
+CKSUMS+= 777a22f3cd39ad01f2e559ecf600bb9c03ec42e0b9fbe41746f42938e162d523
+
+CKSUM_CRATES+= vendor/openssl-sys-0.9.117
+CKSUMS+= 015b5d233c175a67111743c25839a1917242b575f9bbf2fa36582d060c9d1696
+CKSUMS+= 682114fe96d6b25d856e88e414925ba7b0668884ecbe839cf8cd46e41aaba202
+CKSUMS+= 3a7f63b3c446451801ac03c34e03051b8d3ebcceea28b8fb2688922255629d27
+CKSUMS+= dff78be9ee1ae4f9b0436814609884f507572ba8eebf5021bf9865805a7528fd
+
+CKSUM_CRATES+= vendor/libc-0.2.155
+CKSUMS+= 3e550d95419169febf094c425451ca86b12821fa17839b4b0ba7520b145a5820
+CKSUMS+= 1cf38d9ddeca5295821b4234e17e1fc749f35b00307bdfdacb24c6892a288ad6
+CKSUMS+= b8d6f089fc8eb2cb59e45335a26c9ce871b846216c9859b553c6b91982f8de33
+CKSUMS+= d8c4a979ce9b406fb63c5aaf2827b616689294331341737fec392b8faa2126fa
+
+CKSUM_CRATES+= vendor/libc-0.2.169
+CKSUMS+= dc216609dfc6b2835e26f8c3e70f4c7c65425933eef04538de603f51e9429ec5
+CKSUMS+= 04004bda0ea97d55c3588a7d82fa1faf0d150c5390250a298216ff3cc899b911
+CKSUMS+= b5dae853ebfc3355b155f8c20f3a481517bce27e164e304f56dfff172e313098
+CKSUMS+= 55fb7f2c0877231286b2b6515e08eda1d5cac1311a402d0aa162c7eb867ee19b
+CKSUMS+= 0b1936bad97b3a272c2d323d3435f6860fc355abe7603ca7ed8c4166cac75cc5
+CKSUMS+= 1eb383a057cdf2826d884b19142bf0b68b6b30c5bc20baf7ee10401a92a8ef22
+
+CKSUM_CRATES+= vendor/libc-0.2.172
+CKSUMS+= ec4c1dce83e8531df71b89e4aee1ab4d3b3b18d1b6d34b03d94573144c40e7c5
+CKSUMS+= dc3179a14c65c5e3d250ce9819934236f11fc6c9bfa7afa8d4208931d28e4250
+CKSUMS+= f3778a9bd2ba923220537d167cfb10b91580ffbf583100789a46d2807f7a1e3e
+CKSUMS+= 2dc054435fd2976536b6685d66ba6796d4eb143885bd573e686e9b042ae7257a
+
+CKSUM_CRATES+= vendor/libc-0.2.183
+CKSUMS+= a782d53bc9e06c87c6c8b8182ee79cab693ce39be7d9ecb9dcd7ca285284734f
+CKSUMS+= 2113dd4a3bdacf81fc125eb14b6e42d34e79c7df8909ace69c41e639bea51b4f
+
+CKSUM_CRATES+= vendor/libc-0.2.186
+CKSUMS+= 12d1e288aa3c351000721502e3cbd7115d7d5584ffc5c37f5c00e9c56f657385
+CKSUMS+= ba90b1b54ba7ec1368ade4eeebc5a6ac0f43aa2468ace5601b3a2d64b8b2e3af
+
+CKSUM_CRATES+= vendor/libc-0.2.189
+CKSUMS+= 31a6505b5a16b6cbe5b6463359f76a4ad8f896b3beb75a84b71dce2b8188dafa
+CKSUMS+= ba9599e6dacbb2ad1be2115aa0ec172f46f9b916ab820aa64c08be8db8e0b91c
+
+CKSUM_CRATES+= vendor/zerocopy-0.7.35
+CKSUMS+= eb5033d1f2f3d5314625bc63353b1d105cb414d4bc68edf8700b401e4055d669
+CKSUMS+= bd504cc95f722a296a5f221c3a3068c9eaa946258beff163581d9492de6ccdce
+
+CKSUM_CRATES+= vendor/memchr-2.7.4
+CKSUMS+= 3b15d5cb9715f26e655598eacbb8bbba74cbe8ddb2fb969d13aa75f216a118dd
+CKSUMS+= cc7227e092904a02235c5518224924eb5e035441a2be2e28ab0102719fbe090f
+
+CKSUM_CRATES+= vendor/memchr-2.7.6
+CKSUM_CRATES+= vendor/memchr-2.8.0
+CKSUMS+= e787c4ed2f499802e90910f7aedc7ca41acea39c8ef416b19d6d572c1a540422
+CKSUMS+= 9b104d0bda9b8e18b10c41633513637af84346282bf113f3be3813725605fe31
+
+CKSUM_CRATES+= vendor/line-index-0.1.2
+CKSUMS+= c4613b718951cf0b880a3a7829e102a9ec7196591437e3bc0cfd857c717bfb61
+CKSUMS+= 5183e802793932fb980b4e321656c65d1b6231de3febd1ac94dfa73de31245f0
+
+CKSUM_CRATES+= vendor/lzma-sys-0.1.20
+CKSUMS+= 6fd5e9245db34c6f557b8bfcaf03db82fc88c3b06dbfbb5f03b2bcd138983ef9
+CKSUMS+= 2a68e3e635dce81c7dba25b3d3abfaa894ee729e1604f2d000ae3e201f7739a4
+
+CKSUM_CRATES+= vendor/zeroize-1.8.1
+CKSUMS+= 9f59308c21265a2fb46935a6468d8bc2e86e4613c9a942fcfc91d61bec8cc878
+CKSUMS+= 9e20af81edc96e11f17c3e3a2933c073b6c6f9b86ca25cab0eabd763c6b80aee
+
+SUBST_CLASSES+= cksum
+SUBST_STAGE.cksum= pre-configure
+.for crate in ${CKSUM_CRATES}
+SUBST_FILES.cksum+= ${crate}/.cargo-checksum.json
+.endfor
+.for from to in ${CKSUMS}
+SUBST_SED.cksum+= -e 's,${from},${to},g'
+.endfor
+
+post-extract:
+ set -e; \
+ if ${TEST} -e ${WRKDIR}/rust-${RUST_STAGE0_VER}-${RUST_ARCH}/install.sh \
+ -a ! -e ${RUST_BOOTSTRAP_PATH}/bin/rustc; then \
+ cd ${WRKDIR}/rust-${RUST_STAGE0_VER}-${RUST_ARCH}; \
+ env ${MAKE_ENV} ${TOOLS_BASH} \
+ ./install.sh --prefix=${RUST_BOOTSTRAP_PATH}; \
+ cd ${WRKDIR}/rust-std-${RUST_STAGE0_VER}-${RUST_ARCH}; \
+ env ${MAKE_ENV} ${TOOLS_BASH} \
+ ./install.sh --prefix=${RUST_BOOTSTRAP_PATH}; \
+ fi
+.if ${OPSYS} == "NetBSD"
+ SDIR=${WRKDIR}/scripts; \
+ ${MKDIR} $${SDIR}; \
+ cd $${SDIR}; \
+ ${RM} -f c++-wrap; \
+ ${RM} -f clang++-wrap; \
+ ${RM} -f clang-wrap; \
+ ${RM} -f ar-wrap; \
+ ${CP} ${.CURDIR}/files/gcc-wrap .; \
+ ${CHMOD} +x gcc-wrap; \
+ ${LN} -s gcc-wrap c++-wrap; \
+ ${LN} -s gcc-wrap clang++-wrap; \
+ ${LN} -s gcc-wrap clang-wrap; \
+ ${LN} -s gcc-wrap ar-wrap
+.endif
+
+.if ${OPSYS} == "FreeBSD"
+MAKE_ENV+= OPENSSL_DIR=${SSLBASE}
+.endif
+
+.if ${OPSYS} == "NetBSD" && !empty(PKGSRC_COMPILER:Mclang) && !exists(/lib/libgcc_s.so)
+BUILDLINK_TRANSFORM+= rm:-lgcc_s
+MAKE_ENV+= PKGSRC_HAVE_LIBCPP=yes
+
+pre-build: provide-libgcc-for-bootstrap
+.PHONY: provide-libgcc-for-bootstrap
+provide-libgcc-for-bootstrap:
+. if exists(${FILESDIR}/libgcc_s.so.1)
+ cp ${FILESDIR}/libgcc_s.so.1 ${RUST_BOOTSTRAP_PATH}/lib/.
+. endif
+.endif
+
+# Rust builds some bundled components with strict version requirements, ensure
+# that any conflicting packages pulled in via dependencies are not buildlinked.
+BUILDLINK_FILES_CMD.xz= ${TRUE}
+MAKE_ENV+= LZMA_API_STATIC=1
+pre-configure:
+ ${RM} -rf ${BUILDLINK_DIR}/include/libssh2*
+
+#
+# These are essentially copies of the "all", "test", and "install" Makefile
+# targets, but are duplicated here so that we can specify -j.
+#
+do-build:
+ ${RUN}${_ULIMIT_CMD} \
+ cd ${WRKSRC} && \
+ ${SETENV} ${MAKE_ENV} \
+ sh -c "if [ \"${BUILD_TARGET}\" = \"dist\" ]; then \
+ unset DESTDIR; \
+ ${TOOL_PYTHONBIN} ./x.py \
+ ${BUILD_TARGET} -j ${_MAKE_JOBS_N}; \
+ else \
+ ${TOOL_PYTHONBIN} ./x.py \
+ ${BUILD_TARGET} --stage 2 -j ${_MAKE_JOBS_N} && \
+ ${TOOL_PYTHONBIN} ./x.py \
+ doc --stage 2 -j ${_MAKE_JOBS_N}; \
+ fi"
+
+do-test:
+ ${RUN}${_ULIMIT_CMD} \
+ cd ${WRKSRC} && \
+ ${SETENV} ${MAKE_ENV} \
+ ${TOOL_PYTHONBIN} ./x.py test -j ${_MAKE_JOBS_N}
+
+do-install:
+ ${RUN}${_ULIMIT_CMD} \
+ cd ${WRKSRC} && \
+ ${SETENV} ${MAKE_ENV} ${INSTALL_ENV} \
+ ${TOOL_PYTHONBIN} ./x.py install -j ${_MAKE_JOBS_N}
+.if ${OPSYS} == "Darwin"
+ cd ${DESTDIR}${PREFIX}/lib && \
+ for lib in rustlib/*/lib/lib*.${SHLIB_EXT}; do \
+ install_name_tool -id ${PREFIX}/lib/$${lib##*/} $${lib}; \
+ ${LN} -f $${lib} $${lib##*/}; \
+ done
+.endif
+
+.if ${MACHINE_PLATFORM:MNetBSD-*-i386}
+USE_TOOLS+= paxctl
+# Turn off address space layout randomization
+# so that we can build firefox natively:
+post-install:
+ ${TOOLS_PLATFORM.paxctl} +a ${DESTDIR}${PREFIX}/bin/rustc
+.endif
+
+SUBST_CLASSES+= destdir
+SUBST_STAGE.destdir= post-install
+SUBST_FILES.destdir= ${DESTDIR}${PREFIX}/lib/rustlib/manifest-*
+SUBST_SED.destdir= -e 's|file:${DESTDIR}${PREFIX}|file:${PREFIX}|'
+
+GENERATE_PLIST+= ${FIND} ${DESTDIR}${PREFIX} \( -type f -o -type l \) -print | \
+ ${SED} -e 's,${DESTDIR}${PREFIX}/,,' | ${SORT} ;
+
+# Create a relocatable stage2 bootstrap from the bits we just built that can be
+# used to build the next version of rust. Currently only tested on SmartOS.
+#
+# Use the alternate BOOTSTRAP_NAME when creating a nightly release.
+#
+#BOOTSTRAP_NAME= ${PKGNAME_NOREV:C/rust/rust-nightly/}-${RUST_ARCH}
+BOOTSTRAP_NAME= ${PKGNAME_NOREV}-${RUST_ARCH}
+BOOTSTRAP_TMPDIR= ${WRKDIR}/${BOOTSTRAP_NAME}
+USE_TOOLS+= gtar
+
+# The NetBSD part is so far untested, because I could not convince
+# the rust build to use the gcc wrapper when building natively,
+# so that I could get a placeholder in the RPATH, because chrpath
+# cannot extend the length of the RPATH...
+ELFEDIT?= /usr/bin/elfedit
+
+.PHONY: stage0-bootstrap
+stage0-bootstrap: install
+ ${RM} -rf ${BOOTSTRAP_TMPDIR}
+ ${MKDIR} ${BOOTSTRAP_TMPDIR}
+.if ${OPSYS} == "NetBSD"
+ (cd ${BOOTSTRAP_TMPDIR}; \
+ DISTDIR=${WRKSRC}/bild/dist; \
+ VER_ARCH=${PKGVERSION}-${RUST_ARCH}; \
+ RUSTC=rustc-$${VER_ARCH}; \
+ RUSTC_FILE=$${RUSTC}.tar.gz; \
+ RUST_STD=rust-std-$${VER_ARCH}; \
+ RUST_STD_FILE=$${RUST_STD}.tar.gz; \
+ ${GTAR} -xzf $${DISTDIR}/$${RUSTC_FILE}; \
+ (cd ${RUSTC}; \
+ RPATH='/usr/pkg/lib:/lib:/usr/lib:$$ORIGIN/../lib'; \
+ for f in rls-preview/bin/rls rustc/bin/rustc rustc/bin/rustdoc; do \
+ chrpath -r $$RPATH $$f; \
+ done; \
+ RPATH='/usr/pkg/lib:/lib:/usr/lib:$$ORIGIN'; \
+ for f in rustc/lib/*.so*; do \
+ chrpath -r $$RPATH $$f; \
+ done; \
+ RPATH='/usr/pkg/lib:/lib:/usr/lib:$$ORIGIN:$$ORIGIN/../../..'; \
+ for f in rustc/lib/rustlib/*/*/*.so*; do \
+ chrpath -r $$RPATH $$f; \
+ done;); \
+ ${GTAR} -czf $${RUSTC_FILE} $${RUSTC}; \
+ ${CP} $${DISTDIR}/$${RUST_STD_FILE} .; \
+ ${ECHO} "Fixed stage0 bootstrap in ${BOOTSTRAP_TMPDIR}:"; \
+ ${ECHO} "$${RUSTC_FILE}"; \
+ ${ECHO} "$${RUST_STD_FILE}"; \
+ )
+.endif
+.if ${OS_VARIANT} == "SmartOS"
+ ${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 \
+ ${CP} `${PKG_CC} -print-file-name=$${lib}` \
+ ${BOOTSTRAP_TMPDIR}/lib/pkgsrc/; \
+ done; \
+ for lib in libLLVM.so.21.1 libcrypto.so.3 libcurl.so.4 \
+ libssl.so.3 libz.so.1 libzstd.so.1; do \
+ ${CP} ${PREFIX}/lib/$${lib} ${BOOTSTRAP_TMPDIR}/lib/pkgsrc/; \
+ done; \
+ for lib in libiconv.so.2 libidn2.so.0 libintl.so.8 liblber.so.2 \
+ libldap.so.2 liblzma.so.5 libnghttp2.so.14 libsasl2.so.3 \
+ libssh2.so.1 libunistring.so.5 libxml2.so.16; do \
+ ${CP} ${PREFIX}/lib/$${lib} ${BOOTSTRAP_TMPDIR}/lib/pkgsrc/; \
+ done; \
+ for f in ${BOOTSTRAP_TMPDIR}/bin/*; do \
+ /bin/file -b "$$f" | grep ^ELF >/dev/null || continue; \
+ ${ELFEDIT} -e 'dyn:runpath $$ORIGIN/../lib:$$ORIGIN/../lib/pkgsrc' $$f; \
+ done; \
+ for f in ${BOOTSTRAP_TMPDIR}/lib/pkgsrc/*.so*; do \
+ ${ELFEDIT} -e 'dyn:runpath $$ORIGIN' $$f; \
+ done; \
+ for f in ${BOOTSTRAP_TMPDIR}/lib/*.so*; do \
+ ${ELFEDIT} -e 'dyn:runpath $$ORIGIN:$$ORIGIN/pkgsrc' $$f; \
+ done; \
+ for f in ${BOOTSTRAP_TMPDIR}/lib/rustlib/*/*/*.so* \
+ ${BOOTSTRAP_TMPDIR}/lib/rustlib/*/bin/* \
+ ${BOOTSTRAP_TMPDIR}/lib/rustlib/*/bin/*/*; do \
+ /bin/file -b "$$f" | grep ^ELF >/dev/null || continue; \
+ ${ELFEDIT} -e 'dyn:runpath $$ORIGIN:$$ORIGIN/../../..:$$ORIGIN/../../../pkgsrc' $$f; \
+ done; \
+ cd ${WRKDIR}; ${GTAR} -zcf ${BOOTSTRAP_NAME}.tar.gz ${BOOTSTRAP_NAME}
+ @${ECHO} ""
+ @${ECHO} "Verify correct library paths using the following:"
+ @${ECHO} ""
+ @${ECHO} " cd ${BOOTSTRAP_TMPDIR}"
+ @${ECHO} " find . -type f | xargs ldd 2>/dev/null | egrep 'not.found|${PREFIX}'"
+ @${ECHO} ""
+ @${ECHO} "If there is no output then this bootstrap kit is ready to go:"
+ @${ECHO} ""
+ @${ECHO} " ${WRKDIR}/${BOOTSTRAP_NAME}.tar.gz"
+ @${ECHO} ""
+.endif
+
+.include "options.mk"
+
+# These dependencies currently use the bundled sources as they require
+# development features not yet available in released versions.
+#
+#.include "../../devel/libgit2/buildlink3.mk"
+#.include "../../security/libssh2/buildlink3.mk"
+#.include "../../www/http-parser/buildlink3.mk"
+#.include "../../devel/jemalloc/buildlink3.mk"
+
+## Issues specific to: bootstrap AND NetBSD follow
+
+.include "../../mk/atomic64.mk"
+# This is for when we build natively:
+.if ${MACHINE_PLATFORM:MNetBSD-*-powerpc} || \
+ ${MACHINE_PLATFORM:MNetBSD-*-i386} || \
+ ${MACHINE_PLATFORM:MNetBSD-*-mipsel} || \
+ ${MACHINE_PLATFORM:MNetBSD-*-riscv64}
+# Make libatomic library available via a unique directory:
+DEPENDS+= libatomic-links>=0:../../devel/libatomic-links
+.endif
+
+TOOL_DEPENDS+= cmake-[0-9]*:../../devel/cmake
+
+.include "../../devel/zlib/buildlink3.mk"
+.include "../../lang/python/tool.mk"
+.include "../../lang/python/application.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/rust199/README.md b/rust199/README.md
new file mode 100644
index 0000000000..95f9fe6393
--- /dev/null
+++ b/rust199/README.md
@@ -0,0 +1,38 @@
+# Rust Maintenance Plan
+
+$NetBSD: README.md,v 1.1 2023/10/23 17:10:23 gdt Exp $
+
+This file describes a plan for maintaining rust. It's logically like
+comments in the Makefile.
+
+# Plan
+
+Generally, pkgsrc will update to each minor version (1.x) of rust in
+sequence, to enable people to bisect if they have to, and to reduce
+pain towards a future, even if theoretical, get-well plan for perhaps
+reproducible and from-source build chains. (It might be that a
+version is only in for a few days.)
+
+pkgsrc will in general update rust and rust-bin at the same time.
+
+There will be platforms where rust or rust-bin won't work, because
+forward progress and no lossage are obviously incompatible in
+practice, at least for now. We (currently, will evolve) insist on
+x86, i386, aarch64, earmv7hf-el working, would really like to see
+sparc64 and earmv7hf-el, and hope for powerpc, riscv64, mipsel. See
+https://cdn.netbsd.org/pub/pkgsrc/distfiles/LOCAL_PORTS/rust/
+for status.
+
+We will try to stage each update in wip, so that people can test
+before it is committed. These will be wip/rust1NN and wip/rust1NN-bin,
+so that N and N+1 can coexist if the 2nd version is being packaged
+before pkgsrc is updated to the first.
+
+
+# Goals
+
+We will attempt to document the bootstrap process such that people who
+are not rust experts but have the hardware (or have set up an
+
+Document the testing plan. Attempt to minimize work while maximizing
+safety.
diff --git a/rust199/buildlink3.mk b/rust199/buildlink3.mk
new file mode 100644
index 0000000000..485765e95e
--- /dev/null
+++ b/rust199/buildlink3.mk
@@ -0,0 +1,28 @@
+# $NetBSD: buildlink3.mk,v 1.19 2026/04/02 19:06:34 wiz Exp $
+
+BUILDLINK_TREE+= rust
+
+#
+# DO NOT include this directly! Use rust.mk instead.
+#
+
+.if !defined(RUST_BUILDLINK3_MK)
+RUST_BUILDLINK3_MK:=
+
+BUILDLINK_API_DEPENDS.rust+= rust>=1.85.0
+BUILDLINK_PKGSRCDIR.rust?= ../../lang/rust
+BUILDLINK_PASSTHRU_DIRS+= ${PREFIX}/lib/rustlib
+
+.include "../../mk/bsd.fast.prefs.mk"
+
+pkgbase:= rust
+.include "../../mk/pkg-build-options.mk"
+# 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
+
+.endif
+
+BUILDLINK_TREE+= -rust
diff --git a/rust199/cargo.mk b/rust199/cargo.mk
new file mode 100644
index 0000000000..dac26e10bb
--- /dev/null
+++ b/rust199/cargo.mk
@@ -0,0 +1,140 @@
+# $NetBSD: cargo.mk,v 1.47 2026/06/03 09:06:11 adam Exp $
+#
+# Common logic that can be used by packages that depend on cargo crates
+# from crates.io. This lets existing pkgsrc infrastructure fetch and verify
+# cargo crates instead of using the rust package manager in the build phase.
+# Inspired by cargo.mk from FreeBSD ports.
+#
+# Usage example:
+#
+# CARGO_CRATE_DEPENDS+= sha1-0.20
+# .include "../../lang/rust/cargo.mk"
+#
+# If modifying the list of dependencies, re-run the build once without
+# --offline in CARGO_ARGS to generate a new valid Cargo.lock.
+# e.g: make CARGO_ARGS="build --release" build
+#
+# a list of CARGO_CRATE_DEPENDS can be generated via
+# make print-cargo-depends > cargo-depends.mk
+#
+# See also www/geckodriver for a full example.
+#
+# Some dependencies are pulled in from git repositories directly (not
+# using crates.io). You can define CARGO_GITHUB_CRATES for
+# those. Every entry in CARGO_GITHUB_CRATES consists of three parts
+# ("user", "name", "hash") separated by spaces, where "user" is the
+# github user account (first part of the github URL), "name" is the
+# github project name (second part of the github URL) and "hash" is
+# the git revision to fetch. For example:
+#
+# CARGO_GITHUB_CRATES= foo bar 12345
+#
+# will fetch https://github.com/foo/bar/ revision 12345
+
+MASTER_SITES?= ${MASTER_SITE_CRATESIO}${PKGBASE}/
+
+CHECK_SSP_SUPPORTED= no
+
+.include "../../lang/rust/rust.mk"
+
+USE_TOOLS+= bsdtar digest
+CARGO_VENDOR_DIR= ${WRKDIR}/vendor
+CARGO_WRKSRC?= ${WRKSRC}
+
+# TODO: some Cargo.lock files include git+https sources which need to be fetched from the URL (not necessarily resolving to a crate.io url)
+DISTFILES?= ${DEFAULT_DISTFILES}
+
+.if defined(CARGO_GITHUB_CRATES)
+SUBST_CLASSES+= gitcrate
+SUBST_FILES.gitcrate+= Cargo.toml
+SUBST_MESSAGE.gitcrate= Replacing github crate path with local path.
+SUBST_STAGE.gitcrate= pre-configure
+. for user name hash in ${CARGO_GITHUB_CRATES}
+DISTFILES+= ${name}-${hash}.tar.gz
+SITES.${name}-${hash}.tar.gz+= -${MASTER_SITE_GITHUB:=${user}/}${name}/archive/${hash}.tar.gz
+SUBST_SED.gitcrate+= -E -e 's!git.*github.com/${user}/${name}.*${hash}(.)!path = \1../${name}-${hash}\1!'
+. endfor
+.endif
+
+.for crate in ${CARGO_CRATE_DEPENDS}
+DISTFILES+= ${crate}.crate
+SITES.${crate}.crate+= -${MASTER_SITE_CRATESIO}${crate:C/-[0-9]+\.[0-9.]+.*$//}/${crate}.crate
+EXTRACT_DIR.${crate}.crate?= ${CARGO_VENDOR_DIR}
+.endfor
+
+.include "../../mk/bsd.prefs.mk"
+# Triggers NetBSD ld.so bug (PR toolchain/54192)
+# See Makefile for further information.
+.if ${OPSYS} == "NetBSD" && ${OPSYS_VERSION} < 099957
+MAKE_JOBS_SAFE= no
+.endif
+
+post-extract: cargo-vendor-crates
+.PHONY: cargo-vendor-crates
+cargo-vendor-crates:
+ @${STEP_MSG} "Extracting local cargo crates"
+ ${RUN}${MKDIR} ${WRKDIR}/.cargo
+ ${RUN}${PRINTF} "[source.crates-io]\nreplace-with = \"vendored-sources\"\n[source.vendored-sources]\ndirectory = \"${CARGO_VENDOR_DIR}\"\n" > ${WRKDIR}/.cargo/config.toml
+ ${RUN}${MKDIR} ${CARGO_VENDOR_DIR}
+.for crate in ${CARGO_CRATE_DEPENDS}
+ ${RUN}${PRINTF} '{"package":"%s","files":{}}' \
+ `${DIGEST} sha256 < ${_DISTDIR}/${crate}.crate` \
+ > ${CARGO_VENDOR_DIR}/${crate}/.cargo-checksum.json
+.endfor
+
+# Legacy name
+.PHONY: show-cargo-depends
+show-cargo-depends: print-cargo-depends
+
+.PHONY: print-cargo-depends
+print-cargo-depends:
+ ${RUN}${AWK} 'BEGIN {print "# $$Net" "BSD$$"; print;} \
+ /^name = / { split($$3, a, "\""); name=a[2]; } \
+ /^version = / { split($$3, a, "\""); vers=a[2]; } \
+ /^source = / { \
+ print "CARGO_CRATE_DEPENDS+=\t" name "-" vers; \
+ }' ${CARGO_WRKSRC}/Cargo.lock
+
+.if ${RUST_TYPE} == "native"
+CARGO= cargo
+.else
+CARGO= ${PREFIX}/bin/cargo
+.endif
+DEFAULT_CARGO_ARGS= --offline -j${_MAKE_JOBS_N} \
+ ${CARGO_NO_DEFAULT_FEATURES:M[yY][eE][sS]:C/[yY][eE][sS]/--no-default-features/} \
+ ${CARGO_FEATURES:C/.*/--features/W} \
+ ${CARGO_FEATURES:S/ /,/Wg}
+CARGO_ARGS?= build --release ${DEFAULT_CARGO_ARGS}
+CARGO_INSTALL_ARGS?= install --path . --root ${DESTDIR}${PREFIX} ${DEFAULT_CARGO_ARGS}
+
+MAKE_ENV+= RUSTFLAGS=${RUSTFLAGS:Q}
+ALL_ENV+= CARGO_HOME=${WRKDIR}
+
+.if !target(do-build)
+do-build: do-cargo-build
+.endif
+
+.PHONY: do-cargo-build
+do-cargo-build:
+ ${RUN} cd ${CARGO_WRKSRC} && ${SETENV} ${MAKE_ENV} ${CARGO} ${CARGO_ARGS}
+
+.if !target(do-install) && ${GNU_CONFIGURE:Uno:tl} == no
+do-install: do-cargo-install
+.endif
+
+.PHONY: do-cargo-install
+do-cargo-install:
+ ${RUN} cd ${CARGO_WRKSRC} && ${SETENV} ${MAKE_ENV} ${CARGO} ${CARGO_INSTALL_ARGS}
+ # remove files cargo uses for tracking installations
+ ${RM} -f ${DESTDIR}${PREFIX}/.crates.toml
+ ${RM} -f ${DESTDIR}${PREFIX}/.crates2.json
+
+.if ${OPSYS} == "Darwin"
+.PHONY: do-cargo-post-install-darwin-fix-rpath
+post-install: do-cargo-post-install-darwin-fix-rpath
+do-cargo-post-install-darwin-fix-rpath:
+ ${RUN} cd ${DESTDIR}; \
+ for i in $$(${FIND} .${PREFIX}/lib -name '*.so' | ${SED} -e 's|^\./||'); do \
+ install_name_tool -id /$$i $$i; \
+ done
+.endif
diff --git a/rust199/cross.mk b/rust199/cross.mk
new file mode 100644
index 0000000000..3ccdc3e35b
--- /dev/null
+++ b/rust199/cross.mk
@@ -0,0 +1,86 @@
+# $NetBSD: cross.mk,v 1.16 2026/04/02 19:06:34 wiz Exp $
+
+# These settings may be used to cross-build rust.
+#
+# They interact with the files/gcc-wrap script to pick the
+# right compiler for the different phases of the build, and
+# use the headers for the target when required. Note that the
+# cross-root tree will need to have the required binary packages
+# installed (curl etc., see list of buildlink3.mk includes in main
+# Makefile).
+
+# The gcc-wrap / c++-wrap script takes CROSS_ROOT environment variable
+# to do a cross-build. The wrapper script assumes dest/ and tools/
+# as a result of a cross-build of NetBSD as subdirectories of this root
+#CROSS_ROOT= /u/evbarm-armv7hf
+#CROSS_ROOT= /u/evbarm-armv7hf-10.0
+#CROSS_ROOT= /u/evbarm-armv6hf
+#CROSS_ROOT= /u/sparc64
+#CROSS_ROOT= /u/macppc
+#CROSS_ROOT= /u/evbarm64
+#CROSS_ROOT= /u/evbarm64eb
+#CROSS_ROOT= /u/i386
+#CROSS_ROOT= /u/mipsel
+#CROSS_ROOT= /u/riscv64
+#CROSS_ROOT= /u/m68k
+#CROSS_ROOT= /
+#MAKE_ENV+= CROSS_ROOT=${CROSS_ROOT}
+
+# The GNU cross target designation
+#GNU_CROSS_TARGET= armv7--netbsdelf-eabihf
+#GNU_CROSS_TARGET= armv6--netbsdelf-eabihf
+#GNU_CROSS_TARGET= sparc64--netbsd
+#GNU_CROSS_TARGET= powerpc--netbsd
+#GNU_CROSS_TARGET= aarch64--netbsd
+#GNU_CROSS_TARGET= aarch64_be--netbsd
+#GNU_CROSS_TARGET= i486--netbsdelf
+#GNU_CROSS_TARGET= mipsel--netbsd
+#GNU_CROSS_TARGET= riscv64--netbsd
+#GNU_CROSS_TARGET= m68k--netbsdelf
+#MAKE_ENV+= GNU_CROSS_TARGET=${GNU_CROSS_TARGET}
+
+# To cross-build rust, you need to specify
+# the ultimate target to built for, as well as the
+# host the compiler is supposed to run on.
+# Rust's target designation
+#TARGET= armv7-unknown-netbsd-eabihf
+#TARGET= armv6-unknown-netbsd-eabihf
+#TARGET= sparc64-unknown-netbsd
+#TARGET= powerpc-unknown-netbsd
+#TARGET= aarch64-unknown-netbsd
+#TARGET= aarch64_be-unknown-netbsd
+#TARGET= i686-unknown-netbsd
+#TARGET= i586-unknown-netbsd
+#TARGET= mipsel-unknown-netbsd
+#TARGET= riscv64gc-unknown-netbsd
+#TARGET= m68k-unknown-netbsd
+#
+#SCRIPTS= ${WRKDIR}/scripts
+#CONFIGURE_ARGS+= --host=${TARGET}
+#CONFIGURE_ARGS+= --target=${TARGET}
+#CONFIGURE_ARGS+= --set=target.${TARGET}.cc=${SCRIPTS}/gcc-wrap
+#CONFIGURE_ARGS+= --set=target.${TARGET}.cxx=${SCRIPTS}/c++-wrap
+#CONFIGURE_ARGS+= --set=target.${TARGET}.linker=${SCRIPTS}/gcc-wrap
+# Pick one:
+#CONFIGURE_ARGS+= --set=target.${TARGET}.ar=${CROSS_ROOT}/tools/bin/${GNU_CROSS_TARGET}-ar
+#CONFIGURE_ARGS+= --set=target.${TARGET}.ar=${SCRIPTS}/ar-wrap
+
+# May be required when cross-building on NetBSD
+#MAKE_ENV+= OPENSSL_DIR=/usr
+
+#
+# Cross-compile illumos target. The host is identical, it's just the target
+# that is renamed from x86_64-sun-solaris to x86_64-unknown-illumos.
+#
+#TARGET= x86_64-unknown-illumos
+#
+# Use these variables for "cross-compiling" from x86_64-sun-solaris.
+#
+#CONFIGURE_ARGS+= --set=target.${TARGET}.llvm-config=${LLVM_CONFIG_PATH}
+#CONFIGURE_ARGS+= --host=${TARGET}
+#CONFIGURE_ARGS+= --target=${TARGET}
+#
+# Set this variable when using a native x86_64-unknown-illumos bootstrap, as
+# the build still defaults to x86_64-sun-solaris based on uname.
+#
+#CONFIGURE_ARGS+= --build=${TARGET}
diff --git a/rust199/distinfo b/rust199/distinfo
new file mode 100644
index 0000000000..ce7840088a
--- /dev/null
+++ b/rust199/distinfo
@@ -0,0 +1,187 @@
+$NetBSD: distinfo,v 1.199 2026/05/14 14:37:35 jperkin Exp $
+
+BLAKE2s (rust-1.98.1-aarch64-apple-darwin.tar.gz) = f9305741cccb8a0078a7d9d1eef36bf255a8cfb1a01a89f91fbb0f71c8615aa0
+SHA512 (rust-1.98.1-aarch64-apple-darwin.tar.gz) = 9bb59c9b47cbef360fdc43067f21386240b5f8261c32d9c1fc4408e49f11a7afbd3461698f129acc050eab4a0cc1d186bd3cab1e8b5dd109f0e8f45ea1297a07
+Size (rust-1.98.1-aarch64-apple-darwin.tar.gz) = 296243773 bytes
+BLAKE2s (rust-1.98.1-aarch64-unknown-linux-gnu.tar.gz) = 1ccb0508905d7229af82c3fb4e86fd296783384596df30518c5dbd6893f8d10f
+SHA512 (rust-1.98.1-aarch64-unknown-linux-gnu.tar.gz) = 02f7bdffad5c97c6594586719bf7807e5bd1d4a01705050cf4f53f3bb9dfc0648881f233d6770433cf93ad859e87aa0fb69edfe4efceab7432d15227e8efe532
+Size (rust-1.98.1-aarch64-unknown-linux-gnu.tar.gz) = 333370498 bytes
+BLAKE2s (rust-1.98.1-aarch64-unknown-netbsd.tar.xz) = bb5928e4c46f553b0f98eef906371529a00d99c6b19525812ff62c68d5f9c1d2
+SHA512 (rust-1.98.1-aarch64-unknown-netbsd.tar.xz) = 5e9ebe633a2d2273e5344873acfb6a98427bcb05c3fcab29e89d724b8a8d3cb243e0f5a28ae37d74895078ac7f7d26307464b23a66630d61518d249273baac23
+Size (rust-1.98.1-aarch64-unknown-netbsd.tar.xz) = 212508872 bytes
+BLAKE2s (rust-1.98.1-aarch64_be-unknown-netbsd.tar.xz) = c2050934e16285492f2833708eed1a1d5319fda881a96e3b4dde8bb8ad41c054
+SHA512 (rust-1.98.1-aarch64_be-unknown-netbsd.tar.xz) = c13d70551bf01ded01512ad5b3c81f30fd32a5ecf4ba955cab6007e8ce708a066995a9097074853279e4197b4106392ef1c4a4719f251151c312cdb90ea22af5
+Size (rust-1.98.1-aarch64_be-unknown-netbsd.tar.xz) = 209763868 bytes
+BLAKE2s (rust-1.98.1-arm-unknown-linux-gnueabihf.tar.gz) = 47e78eac2add27f57d467cdec2abcf448ec75b6927c42191475bc40c2484a8ac
+SHA512 (rust-1.98.1-arm-unknown-linux-gnueabihf.tar.gz) = fc519d4b8971cbe982db8ba6b2f8d7a07d749c19e1c73f8889a976e907bdf0b1fb1e4cd2821e1f6eeb17d427409286e0a38f928907234441c4c61757af3d1f34
+Size (rust-1.98.1-arm-unknown-linux-gnueabihf.tar.gz) = 449242783 bytes
+BLAKE2s (rust-1.98.1-armv6-unknown-netbsd-eabihf.tar.xz) = 54a3d1771599548a0cdf10faf9a7baa9667218dc414d5d2a57e5c4488dbb0570
+SHA512 (rust-1.98.1-armv6-unknown-netbsd-eabihf.tar.xz) = 8ae5179f30572a8fd4de8210af13baffeb607e3cc150b05c3c29faf38dd9e85416497e53ac68d5fd1692c1c3c7e6b8ccb46b1f5868e4e7963cc719fca68823ef
+Size (rust-1.98.1-armv6-unknown-netbsd-eabihf.tar.xz) = 169539580 bytes
+BLAKE2s (rust-1.98.1-armv7-unknown-linux-gnueabihf.tar.gz) = 8ab095d4478dd4894243360fb7c4d9096cb57d34bd75e673955bdabacabc8b91
+SHA512 (rust-1.98.1-armv7-unknown-linux-gnueabihf.tar.gz) = 85b2e514f0c11d7d023e65334247a34bcb8d319728158898b8654b956a65c97bda71b226abf5940bb9a6a760c8e327d154655b264cb5a95a3e2c57060142a1de
+Size (rust-1.98.1-armv7-unknown-linux-gnueabihf.tar.gz) = 433573355 bytes
+BLAKE2s (rust-1.98.1-armv7-unknown-netbsd-eabihf.tar.xz) = 2c9a2eafb8689c53234ffbb97c27fb0a5550ab099f49851ed03f222d787d178e
+SHA512 (rust-1.98.1-armv7-unknown-netbsd-eabihf.tar.xz) = a8f29b8a6c72416cefdec1eafa2c81ee06f5db4aa090fb5a900d4015309d9df200a11aea49b4e4fd1ab6b4a22cf1ba94b40b3301b6fafc43b279a42b88e74e31
+Size (rust-1.98.1-armv7-unknown-netbsd-eabihf.tar.xz) = 171101676 bytes
+BLAKE2s (rust-1.98.1-i586-unknown-netbsd.tar.xz) = 630b2764589728104c48c981dd2646586d3b4e946a0d3a5a3ddb5d27d1fe02dc
+SHA512 (rust-1.98.1-i586-unknown-netbsd.tar.xz) = d832095802d343e6e1b402f8228a750674fea33f1cb12d70d5cf401ef1ca6f3d40e87340895898544c192e8a8437c5d4c53d89d67ebd98ee182f881944e7383d
+Size (rust-1.98.1-i586-unknown-netbsd.tar.xz) = 231619864 bytes
+BLAKE2s (rust-1.98.1-i686-unknown-linux-gnu.tar.gz) = 36a554985aae229801bd8b1c728e380f3983fa4846421cf05f1ca5d7d2dd7975
+SHA512 (rust-1.98.1-i686-unknown-linux-gnu.tar.gz) = bf3c0a7ea4940c6afd979825972d475a7af98655b70bf0bc65ae9eda6185e26170cbbb97ead3eb0bc202a96e83b574a341585c34feefc9e79939aecd5110b0cf
+Size (rust-1.98.1-i686-unknown-linux-gnu.tar.gz) = 518362979 bytes
+BLAKE2s (rust-1.98.1-powerpc-unknown-netbsd.tar.xz) = f9271b220cd2dd816958baa7216b0dd6993f60bcf71764858726e0f75af7c72a
+SHA512 (rust-1.98.1-powerpc-unknown-netbsd.tar.xz) = 6940485961bd2c4a5f7b330f47c548c37244d39aa8611ae4fefaf0192a3101b2f4fb1e5050e945367da1451453b3134110710184388b64ae7f4d313aefea03fe
+Size (rust-1.98.1-powerpc-unknown-netbsd.tar.xz) = 114972480 bytes
+BLAKE2s (rust-1.98.1-riscv64gc-unknown-netbsd.tar.xz) = 052102e58243e0a6be17727283f1189f081f7492fd92b1383d5792a7949d34fc
+SHA512 (rust-1.98.1-riscv64gc-unknown-netbsd.tar.xz) = f997b290025ddfb2834dab98b9ccb6932c0d3753b23a374729959b2bb79841bdc8d65d990795b62800d495314148c832501867731baf05f22707a88e0e368714
+Size (rust-1.98.1-riscv64gc-unknown-netbsd.tar.xz) = 228611732 bytes
+BLAKE2s (rust-1.98.1-sparc64-unknown-netbsd.tar.xz) = bd2723a4cc6ca6fd7fed572a58fe539570960240c8fc6163741183ecdbdf1563
+SHA512 (rust-1.98.1-sparc64-unknown-netbsd.tar.xz) = c1ae573f856c55c1287a0c0ceab0f011e94a99eb63bcde15ee19cd0061771bf0da61d39c94eeff2dadd780f82f4bbaa7dfed971e6e0b06f997c31d30a4e83cdb
+Size (rust-1.98.1-sparc64-unknown-netbsd.tar.xz) = 208342388 bytes
+BLAKE2s (rust-1.98.1-x86_64-apple-darwin.tar.gz) = 325a04070f49f633f023461b7d949a42cf2fd41081941b7b2889303f4b4381b6
+SHA512 (rust-1.98.1-x86_64-apple-darwin.tar.gz) = db1a63c559047f7fb3025dd60a42d8d7bfd8a3eb5d91f4252ca5ff18317c0c3ab002cd1d3ab818fa42019fd0300d29a47c0ef28b99309d7624f39f2531c91188
+Size (rust-1.98.1-x86_64-apple-darwin.tar.gz) = 229281172 bytes
+BLAKE2s (rust-1.98.1-x86_64-unknown-freebsd.tar.gz) = bef9cf4db04fd501cb425498cf102cb5de08e49d0b66ad0de45316875b349f79
+SHA512 (rust-1.98.1-x86_64-unknown-freebsd.tar.gz) = d35bbc9dc2c52c71b5807a56d0e15f357db063cb440a4282aa2354f38ab768b8cab8aa7dc251d925ae5b0ccfc99d91219542055e1b608ba9f6ddecdb491f13f3
+Size (rust-1.98.1-x86_64-unknown-freebsd.tar.gz) = 397124058 bytes
+BLAKE2s (rust-1.98.1-x86_64-unknown-illumos.tar.gz) = edde5b151752db847f487881d78f9f5e9415d565b2388ca9c99f54b7e84e3bc6
+SHA512 (rust-1.98.1-x86_64-unknown-illumos.tar.gz) = bbb179963b31724c44e4d0b025cdc617e6f3d311de8a4d2b1ef6cc7aff0a5f4b1351e00beec2263e1b2c2f30f458264c085be9cb1b551f1a6949848243009654
+Size (rust-1.98.1-x86_64-unknown-illumos.tar.gz) = 472579870 bytes
+BLAKE2s (rust-1.98.1-x86_64-unknown-linux-gnu.tar.gz) = 17722ba8031840b97e626043e6e38b28701432361a98a3ef1898f9fc6ddcf339
+SHA512 (rust-1.98.1-x86_64-unknown-linux-gnu.tar.gz) = 9a3d49b1749a7cb829189ec314c3280671e32a15cdbc49705c4271e229d2463843a917cdbe7fed4e85b977a8429ff7292c0c11fded481aad8d8a0a38ea434ec7
+Size (rust-1.98.1-x86_64-unknown-linux-gnu.tar.gz) = 381649661 bytes
+BLAKE2s (rust-1.98.1-x86_64-unknown-netbsd.tar.xz) = 6bdd08f864a0edfc881a4832bf6ea6dd34ae31179d9e6f38909e27035dcfa518
+SHA512 (rust-1.98.1-x86_64-unknown-netbsd.tar.xz) = d74256554f1f0a1c76c442842c96dc6fc2dac5ee5beaf803f42bd2c26263673de34892b4a56a01c3387febced164e3ac5493fd66379f9af506071a27a7f40c9f
+Size (rust-1.98.1-x86_64-unknown-netbsd.tar.xz) = 239120352 bytes
+BLAKE2s (rust-std-1.98.1-aarch64-apple-darwin.tar.gz) = 34afea01ab9eeaccf6d6bdc49d471e6c8770663e7f84f4e468bee9403bbe3a3b
+SHA512 (rust-std-1.98.1-aarch64-apple-darwin.tar.gz) = a0715a66e5987f0f76a7eff0de2faa0b2b1b453c54065c79dc24551760b259192854207b6b92d29fd2ad19ec3d15f9b0892c85144e30b13ebc87b61b0fee3b9c
+Size (rust-std-1.98.1-aarch64-apple-darwin.tar.gz) = 46982505 bytes
+BLAKE2s (rust-std-1.98.1-aarch64-unknown-linux-gnu.tar.gz) = 54e840bed7c8e30faac205d2c956d366854cf22a179ab307217f4f1170ae81f0
+SHA512 (rust-std-1.98.1-aarch64-unknown-linux-gnu.tar.gz) = f61ae7d68a0d829b2d5c2f1932f9b630cfd35597b999b289bd22f37b88e1a05501ef1e94b49a8f25469ecec0246a0379f070ba19fe7cc8ba71a4dd8a798b801e
+Size (rust-std-1.98.1-aarch64-unknown-linux-gnu.tar.gz) = 48587596 bytes
+BLAKE2s (rust-std-1.98.1-aarch64-unknown-netbsd.tar.xz) = f7f918d22b30aab67b84dd120fe4799acfeaa1ecb68644d2e646326e6d102a35
+SHA512 (rust-std-1.98.1-aarch64-unknown-netbsd.tar.xz) = 649c3c2668f18cbbc410aa43c283cd0ef5aee06bc01a66b3a77f314e6d2d531732b7e77e77bf3817bd44d2d7a521b9ecc0b24ad67e6a8ca8f42c8821ffcdf0d2
+Size (rust-std-1.98.1-aarch64-unknown-netbsd.tar.xz) = 25354840 bytes
+BLAKE2s (rust-std-1.98.1-aarch64_be-unknown-netbsd.tar.xz) = 631cc7f93cc9408343c61cda599111e5dea502abc6b6db72a2acdd68f04d99a3
+SHA512 (rust-std-1.98.1-aarch64_be-unknown-netbsd.tar.xz) = ea52f32b10f33e4e50ce662eac1043eba32cdd2c2ada44fb7bd07f9d6402ade6e00721359be66e4600447250e995a66db31ac2d0eff0c608f27d6f3dd68a3314
+Size (rust-std-1.98.1-aarch64_be-unknown-netbsd.tar.xz) = 23996756 bytes
+BLAKE2s (rust-std-1.98.1-arm-unknown-linux-gnueabihf.tar.gz) = 384f11acb5b8e734b99ecfe1fd5fc30f1bb1068c0eb97b0131f45cd97a1c85cc
+SHA512 (rust-std-1.98.1-arm-unknown-linux-gnueabihf.tar.gz) = c7ad3d0849d22a21a6e023833f9aa8ec551ac5596da4d870cbf77ec1bc275c02715db3107a6588c3b113a83684dd2486ffa7f3ba6cdab36ac9bb16e238b4b9ee
+Size (rust-std-1.98.1-arm-unknown-linux-gnueabihf.tar.gz) = 39981316 bytes
+BLAKE2s (rust-std-1.98.1-armv6-unknown-netbsd-eabihf.tar.xz) = 9a384dee912dd687c0cef840438043da5052848d2f676be57d43785e8e20846c
+SHA512 (rust-std-1.98.1-armv6-unknown-netbsd-eabihf.tar.xz) = e3574273893c173c7bd59a6a4e719a3abcbe42193648dc8c5b18a0ac012bddc4971fa3ad9627c376b395a2f0c299236203fa141348e26d3c131688e5f45fe260
+Size (rust-std-1.98.1-armv6-unknown-netbsd-eabihf.tar.xz) = 21925292 bytes
+BLAKE2s (rust-std-1.98.1-armv7-unknown-linux-gnueabihf.tar.gz) = ff0de547aa8f4c501a0526eeb2744f08300d65353c3a264692cebe743fb09c66
+SHA512 (rust-std-1.98.1-armv7-unknown-linux-gnueabihf.tar.gz) = b8d3d2a757bc453ecf0b68f5306647acdc6de9952f807be07d669fc3cb40c31e5ff1645aafd276a2afebf2c50bd89f6baccb755dc5f5b2f686a0d09021c618e2
+Size (rust-std-1.98.1-armv7-unknown-linux-gnueabihf.tar.gz) = 41459854 bytes
+BLAKE2s (rust-std-1.98.1-armv7-unknown-netbsd-eabihf.tar.xz) = 0d24b078a079306c7caa05cfb7004a89962db54fe9c66fa0a62ad56003c41311
+SHA512 (rust-std-1.98.1-armv7-unknown-netbsd-eabihf.tar.xz) = 041af7b014536f409f33c0a646ec0b5a27539eb90a4d5f671927e569f7fb30957deff5d918da324191aa09ff77b214ef5e24a414ce373dec5a42a89df2ab1deb
+Size (rust-std-1.98.1-armv7-unknown-netbsd-eabihf.tar.xz) = 23079604 bytes
+BLAKE2s (rust-std-1.98.1-i586-unknown-netbsd.tar.xz) = 90b9f842282377f56ca0ae5376e18fbea10766b160341abb1da0051b772a1dec
+SHA512 (rust-std-1.98.1-i586-unknown-netbsd.tar.xz) = 047c86318e025962e1c658ca44d1f30c5d54266a502d4dc2b5edfa888cbb55458baa271c00893ca08771c587baef2a171548e32764175194b2e48dda0b9138c8
+Size (rust-std-1.98.1-i586-unknown-netbsd.tar.xz) = 24828616 bytes
+BLAKE2s (rust-std-1.98.1-i686-unknown-linux-gnu.tar.gz) = 75f8172db9f1218ebfe40e88ac67743f3593a80f03cd2617837b7e4024e4f15e
+SHA512 (rust-std-1.98.1-i686-unknown-linux-gnu.tar.gz) = aa8a9a1d1df3e336329a989799379048e37b870b456c8ca90731961985d48ed8e197887c2d0d9c9bd90f12a692e1910e7357ec9c6996b95ce7205e5e9791fe31
+Size (rust-std-1.98.1-i686-unknown-linux-gnu.tar.gz) = 44754162 bytes
+BLAKE2s (rust-std-1.98.1-powerpc-unknown-netbsd.tar.xz) = b5ef04968747f4c6585bdf1423e296324552d3f87feb3078f6c7e0779b19ae3f
+SHA512 (rust-std-1.98.1-powerpc-unknown-netbsd.tar.xz) = b261a0e4cab7012a788915586ca32730a656f5d146177d7f04118498337f148ccdfda0a1e3d2832f5d6b272eb19cd4bdff25e8601da1617cce1a015ed7b66c19
+Size (rust-std-1.98.1-powerpc-unknown-netbsd.tar.xz) = 22074940 bytes
+BLAKE2s (rust-std-1.98.1-riscv64gc-unknown-netbsd.tar.xz) = 6990b3cb41413f58d07f74e4b6ad98ebfd5badd35d788722d6e412df6a5d1d6e
+SHA512 (rust-std-1.98.1-riscv64gc-unknown-netbsd.tar.xz) = 23289ebae9d16846442a0c84b8a95018bc276f9d957e958f6fabbd6a006473ef56bd22bd7a9ff5bc30c85ff82887644763ddb8f77b602a70f6c9d06ca6ef737a
+Size (rust-std-1.98.1-riscv64gc-unknown-netbsd.tar.xz) = 22152024 bytes
+BLAKE2s (rust-std-1.98.1-sparc64-unknown-netbsd.tar.xz) = f3bb2d85f4d0d8ae99369c26ff52ae45b3cb037a393c88dace1dde0f5a48bda3
+SHA512 (rust-std-1.98.1-sparc64-unknown-netbsd.tar.xz) = 1866695b8abdf04e5a4323f53d8ceb1926830b1d2fffdf2f3aae16487697abdafabd5756a146c89c55c106f9c5c0ed001737c51982b4833d1921a49d9ad9eda6
+Size (rust-std-1.98.1-sparc64-unknown-netbsd.tar.xz) = 21940632 bytes
+BLAKE2s (rust-std-1.98.1-x86_64-apple-darwin.tar.gz) = 2fc01502565aeffee84472f2777fe285e316dcce2c9ffa2e4c299bc18666758e
+SHA512 (rust-std-1.98.1-x86_64-apple-darwin.tar.gz) = 4c634bec2ffa5dc4d261a1e40f02a34a407f9dd6e2891d17b3d0f691873d0699ad13016b14df4bb91d2abcc85028f4a685bdcdb0da788e5583cf23258d990a25
+Size (rust-std-1.98.1-x86_64-apple-darwin.tar.gz) = 47592902 bytes
+BLAKE2s (rust-std-1.98.1-x86_64-unknown-freebsd.tar.gz) = b2d139ae924d2c540a7b67f80201605553a138f2b3e25f6f543e4d83a2b2a778
+SHA512 (rust-std-1.98.1-x86_64-unknown-freebsd.tar.gz) = 944c29ab1a25b02bb03b871cc8cbdec61e853ce1c025559e8ec1ceadac3c1699bb57582983b17478d0182da6200b9b67eca7995fbde5b128e5fd0edc839938c4
+Size (rust-std-1.98.1-x86_64-unknown-freebsd.tar.gz) = 48360729 bytes
+BLAKE2s (rust-std-1.98.1-x86_64-unknown-illumos.tar.gz) = 47ec506630bb4573ebd89c3b2c5b2df353117f19e6273ff123aaa5bd995e8302
+SHA512 (rust-std-1.98.1-x86_64-unknown-illumos.tar.gz) = 186cc9b5564c072f1a38402a45bc51886c7f39f6adf191e52217215e3c9b379a77bca09298732531c441b52cbf2c4a9c881df06a400e54bdbe7e3a2fddf9810c
+Size (rust-std-1.98.1-x86_64-unknown-illumos.tar.gz) = 44161467 bytes
+BLAKE2s (rust-std-1.98.1-x86_64-unknown-linux-gnu.tar.gz) = e52c1ba38c4f7d299656389752e5d40f7c8a9ab7936f78f790fabce8000803f4
+SHA512 (rust-std-1.98.1-x86_64-unknown-linux-gnu.tar.gz) = 887cba295344102ce3a7f8f4f8b65ce9bbe141a0076e64a2aa6f96b8d04436d9a9eb08006883b32bd4f10ab80f6658f99a8f98ddecf4f1537d1949096c7cbcf3
+Size (rust-std-1.98.1-x86_64-unknown-linux-gnu.tar.gz) = 48783553 bytes
+BLAKE2s (rust-std-1.98.1-x86_64-unknown-netbsd.tar.xz) = acda9d5c22b1d44c174388e3981384d79e06facc4654855da3c632dc4279ce83
+SHA512 (rust-std-1.98.1-x86_64-unknown-netbsd.tar.xz) = 631590ca0a9dfaff42616f4b429d9ba25031c1c4f19771ab839f7d77db47e0e05483670c836e00564d1e21e1b41f6d5df185d7231cbbc41bd6d5e119f40eed4a
+Size (rust-std-1.98.1-x86_64-unknown-netbsd.tar.xz) = 28826684 bytes
+BLAKE2s (rustc-1.99.0-src.tar.xz) = b3df0967ecf6fb817f40159123290bff1add2595a42e43d9f4f316227ea9abf3
+SHA512 (rustc-1.99.0-src.tar.xz) = 64f84f9d2c9531c85bc7d4a775abfddf4c09d852e17993d8c2ad3cf94d0a62ac72228bb452e3f3964a18bb49fa47e9a97ee7ed16ed61533717ba68164abd1fbd
+Size (rustc-1.99.0-src.tar.xz) = 265258564 bytes
+SHA1 (patch-compiler_rustc__codegen__ssa_src_back_linker.rs) = f6b18a54dd8c991f6304df35a59fee3d55b46ed3
+SHA1 (patch-compiler_rustc__llvm_build.rs) = 3acef995e3038a98b29b31b9bdd43286b1ac29f7
+SHA1 (patch-compiler_rustc__target_src_spec_base_netbsd.rs) = 4db00d8abecd8f343e3c22c272a8a4e1f9228532
+SHA1 (patch-compiler_rustc__target_src_spec_mod.rs) = a465dc5c8409202df63327a911b3482a0a00d166
+SHA1 (patch-compiler_rustc__target_src_spec_targets_aarch64__be__unknown__netbsd.rs) = 620eaf74c1dd030973af53dfe4f9aa998be5b123
+SHA1 (patch-compiler_rustc__target_src_spec_targets_aarch64__unknown__netbsd.rs) = 1a02f2dd61a5f9cc4be1f66ac3404c961810c731
+SHA1 (patch-compiler_rustc__target_src_spec_targets_m68k__unknown__netbsd.rs) = c23d8ac0d06f0f56b99824a77c7e5a2ce1ee35a3
+SHA1 (patch-compiler_rustc__target_src_spec_targets_mips64el__unknown__netbsd.rs) = 9445b3c05f62d612ec03ec2ed1f71df50ee8bd16
+SHA1 (patch-compiler_rustc__target_src_spec_targets_mipsel__unknown__netbsd.rs) = 45fc28502d9b2a52e1380c5e2d4fa3d683dc425b
+SHA1 (patch-library_backtrace_src_symbolize_gimli.rs) = 9d5ef634c5a454e474ea5fee76da9bb768f5b3d9
+SHA1 (patch-library_backtrace_src_symbolize_gimli_elf.rs) = 8b18e1dbde59f3e8f20e93c7669618b2c7a13294
+SHA1 (patch-src_bootstrap_Cargo.toml) = c2329f21634e1aaca206a3edf011957bc7d62b69
+SHA1 (patch-src_bootstrap_bootstrap.py) = fb89adaaf01f558d636734db5d778af4a3c67fd6
+SHA1 (patch-src_bootstrap_src_core_build__steps_compile.rs) = e928203ed4734c93cc33c5a3f7879cf18dcecc83
+SHA1 (patch-src_bootstrap_src_core_build__steps_install.rs) = 5ecf4e371fa48bca72fa5b0adb55152c906bd813
+SHA1 (patch-src_bootstrap_src_core_builder_cargo.rs) = 295773b2b1c9ded25b4f4c1a9f80c75285fd807f
+SHA1 (patch-src_bootstrap_src_core_sanity.rs) = 83b7bff55b7593bb073301b8214485111fa3311e
+SHA1 (patch-src_bootstrap_src_lib.rs) = 735a3f6cbb3054200dd55eebce6e9acbd285f51e
+SHA1 (patch-src_llvm-project_llvm_CMakeLists.txt) = 91a46663881236016ac7db95e362232f60f7ae53
+SHA1 (patch-src_llvm-project_llvm_cmake_modules_AddLLVM.cmake) = 3b83978e65b1227d38f027e1cdbf4974d011eab9
+SHA1 (patch-src_llvm-project_llvm_include_llvm-c_DataTypes.h) = cb011fc19957883c01725797f7c85ed1b20f96f1
+SHA1 (patch-src_llvm-project_llvm_include_llvm_Analysis_ConstantFolding.h) = 75019dcb3dbca6cda33ba329dbe483101dcf48e7
+SHA1 (patch-src_llvm-project_llvm_lib_TargetParser_TargetDataLayout.cpp) = 0e256d06d29e236a9918a951e8d4f4221d47236e
+SHA1 (patch-src_tools_cargo_src_workspace_profiles.rs) = c86513da589f2dd861279fd119cf5588487f2ca1
+SHA1 (patch-src_tools_cargo_tests_testsuite_build.rs) = 333ec513b9b94750b2424a7c1b21c809e6ea25b8
+SHA1 (patch-src_tools_rust-installer_install-template.sh) = b31e2d8f9fa23beb5559c56de4b576f9b5e37d97
+SHA1 (patch-tests_assembly-llvm_targets_targets-elf.rs) = e92c0b7734008ccabc7b7fb8988f67192946d66d
+SHA1 (patch-vendor_crossbeam-utils-0.8.20_no__atomic.rs) = d9935482a4207935d1f2ddc229d4b26721268b8c
+SHA1 (patch-vendor_crossbeam-utils-0.8.21_no__atomic.rs) = 0ae1f3bbeeb5daf3d330e9674bc6d47e3db67124
+SHA1 (patch-vendor_libc-0.2.155_src_unix_bsd_netbsdlike_netbsd_mod.rs) = 36d927a0c3fd6ef8d211da5389a981e077aedc29
+SHA1 (patch-vendor_libc-0.2.155_src_unix_solarish_mod.rs) = 97505b88875aa80fa2b5589b6090237c3786e143
+SHA1 (patch-vendor_libc-0.2.168_src_unix_bsd_netbsdlike_netbsd_mod.rs) = c5cd529719daee44aead47ffd97e682ca9d9a1ae
+SHA1 (patch-vendor_libc-0.2.168_src_unix_bsd_netbsdlike_netbsd_riscv64.rs) = acbd63b911637fef336a92169a8130133eb64c8c
+SHA1 (patch-vendor_libc-0.2.168_src_unix_solarish_mod.rs) = edbb81319e5f685fd9c2ffe94138c377855a982d
+SHA1 (patch-vendor_libc-0.2.169_src_unix_bsd_netbsdlike_netbsd_mod.rs) = 02c4efefbf1e9e1bd98eb9524515677250ae7454
+SHA1 (patch-vendor_libc-0.2.169_src_unix_bsd_netbsdlike_netbsd_riscv64.rs) = c5e1c2d896d5e9d32aeb56bc3e4d9fb26be9edf0
+SHA1 (patch-vendor_libc-0.2.169_src_unix_solarish_mod.rs) = e02c56106a092b4f2e27427ea8b5d96bf437c356
+SHA1 (patch-vendor_libc-0.2.172_src_unix_bsd_netbsdlike_netbsd_riscv64.rs) = 3127715d2eb1e0ce148d67323b25dd0bc07b67ad
+SHA1 (patch-vendor_libc-0.2.172_src_unix_solarish_mod.rs) = 9365cab6fd25dd077ed56f6105cde22a4a3356dd
+SHA1 (patch-vendor_libc-0.2.183_src_unix_bsd_netbsdlike_netbsd_m68k.rs) = d17449d53d361589f6b7fd5a6f599e613f89acbe
+SHA1 (patch-vendor_libc-0.2.183_src_unix_bsd_netbsdlike_netbsd_mod.rs) = 96933ca76be17c9d906e2cdc0bf0a87c8b3ba371
+SHA1 (patch-vendor_libc-0.2.184_src_unix_bsd_netbsdlike_netbsd_m68k.rs) = 3945c099a63e40e6f6fafc024293907c61d361af
+SHA1 (patch-vendor_libc-0.2.184_src_unix_bsd_netbsdlike_netbsd_mod.rs) = 3eb25ca7be3144f0749e856032ff1f3073f2d252
+SHA1 (patch-vendor_libc-0.2.186_src_unix_bsd_netbsdlike_netbsd_m68k.rs) = f87afd051a844b5b0a4e7a9f0b2e8904ef4e8b68
+SHA1 (patch-vendor_libc-0.2.186_src_unix_bsd_netbsdlike_netbsd_mod.rs) = df252ac69c390d1931d48f446b2b892b2c954f9e
+SHA1 (patch-vendor_libc-0.2.189_src_unix_bsd_netbsdlike_netbsd_m68k.rs) = f7e6911c04902fd5e55c2284fbfff026b15a24e4
+SHA1 (patch-vendor_libc-0.2.189_src_unix_bsd_netbsdlike_netbsd_mod.rs) = 45a4092be5e7ca43467c8ac3828e2bc82c1cd0f1
+SHA1 (patch-vendor_line-index-0.1.2_src_lib.rs) = 30aa5c82630ea0e8969abb527c11640712efba1e
+SHA1 (patch-vendor_lzma-sys-0.1.20_config.h) = 4849052ddb2f04f539fd7060fc1b43cc3acf99c4
+SHA1 (patch-vendor_memchr-2.7.2_src_vector.rs) = 28007f46c3660a7f26a8dbdbbca936dfac2c216c
+SHA1 (patch-vendor_memchr-2.7.4_src_vector.rs) = 3c9f7403379e0fef98f65d4554edda44ada28cb8
+SHA1 (patch-vendor_memchr-2.7.5_src_vector.rs) = fb1a33c4150f9897c049cbea29d375b57d0bd684
+SHA1 (patch-vendor_memchr-2.7.6_src_vector.rs) = 5289c3ebf1a34409106d44eda96936f06c1312bb
+SHA1 (patch-vendor_memchr-2.8.0_src_vector.rs) = f7cb9435e46bbb8ad7c1f3ce980279e75e5fa725
+SHA1 (patch-vendor_openssl-src-111.28.2+1.1.1w_openssl_Configurations_10-main.conf) = 8fc746574f16cd3294edce99beffc3e8c03a089b
+SHA1 (patch-vendor_openssl-src-111.28.2+1.1.1w_openssl_crypto_aria_aria.c) = 1373d2e4ab609956e0e51ca3d900861caf3ee70d
+SHA1 (patch-vendor_openssl-src-111.28.2+1.1.1w_src_lib.rs) = c3260bfdd670c31845189fcb6b4ed19385a03b2a
+SHA1 (patch-vendor_openssl-src-300.5.0+3.5.0_openssl_Configurations_10-main.conf) = 49803c889864dbeccba92095b9fa6f104ff0180a
+SHA1 (patch-vendor_openssl-src-300.5.0+3.5.0_openssl_crypto_aria_aria.c) = 895b5f4d80fb714973f6d6fb1a39d89907e4976d
+SHA1 (patch-vendor_openssl-src-300.5.0+3.5.0_src_lib.rs) = 98e99556c19c055f696f0d9bfbce4aaf207b1640
+SHA1 (patch-vendor_openssl-src-300.6.1+3.6.3_openssl_Configurations_10-main.conf) = 3714c088faaa0d88ddb705769c7226d117da4590
+SHA1 (patch-vendor_openssl-src-300.6.1+3.6.3_openssl_crypto_aria_aria.c) = b481fc1eebd19cfd092817796d19046cc1094d3f
+SHA1 (patch-vendor_openssl-src-300.6.1+3.6.3_src_lib.rs) = 3f81acf234f68f306ff31f3d4f459a6057851674
+SHA1 (patch-vendor_openssl-sys-0.9.107_build_find__normal.rs) = b3de2b9137882e3612291057c1b7793a27de760f
+SHA1 (patch-vendor_openssl-sys-0.9.107_build_main.rs) = 46627c013821166688d16d97f6f8ff4ccb552241
+SHA1 (patch-vendor_openssl-sys-0.9.114_build_find__normal.rs) = 2d8918f2ceaa32438f6cdefd95e28e76be12910c
+SHA1 (patch-vendor_openssl-sys-0.9.114_build_main.rs) = db2de273c0743bc0a7e2901bb19eef5f0f6c9b27
+SHA1 (patch-vendor_openssl-sys-0.9.117_build_find__normal.rs) = 5c6140b2711d2e8d5f81c39ac1e56c0d38ec66f2
+SHA1 (patch-vendor_openssl-sys-0.9.117_build_main.rs) = 706e18b557fb7b7df76cfe5cedcf9d33e3518fd6
+SHA1 (patch-vendor_openssl-sys-0.9.92_build_find__normal.rs) = 0ed143b603eea7c0bddf39e97916608c58978202
+SHA1 (patch-vendor_openssl-sys-0.9.92_build_main.rs) = 842ad74284518fbe8ff65222f7f6f81fb6381e49
+SHA1 (patch-vendor_rustc-ap-rustc__target_src_spec_aarch64__be__unknown__netbsd.rs) = 4e86aec4c89db9a331950a12f8ec7b8aaa50eed7
+SHA1 (patch-vendor_zerocopy-0.7.35_src_lib.rs) = b4b910405172f5653db4bf3286974b9410e77fab
+SHA1 (patch-vendor_zeroize-1.8.1_src_lib.rs) = 5e6c3a04e8a4974dc8427b86753bec18fa1aa5fe
diff --git a/rust199/do-cross.mk b/rust199/do-cross.mk
new file mode 100644
index 0000000000..6e5ad44c6b
--- /dev/null
+++ b/rust199/do-cross.mk
@@ -0,0 +1,117 @@
+# $NetBSD: do-cross.mk,v 1.17 2026/04/02 19:06:34 wiz Exp $
+# Do all the NetBSD cross builds
+# Collect the bootstrap kits in dist/
+
+VERSION!= make show-var VARNAME=PKGVERSION
+V_NOREV!= make show-var VARNAME=PKGVERSION_NOREV
+
+SHORT_TARGETS+= armv7
+SHORT_TARGETS+= armv6
+SHORT_TARGETS+= sparc64
+SHORT_TARGETS+= powerpc
+SHORT_TARGETS+= arm64
+SHORT_TARGETS+= arm64_be
+SHORT_TARGETS+= i386
+SHORT_TARGETS+= riscv64
+SHORT_TARGETS+= mipsel # produces mips32 (not mips1) executables
+#SHORT_TARGETS+= m68k
+
+# Conditional local overrides of ROOT.* variables:
+.sinclude "local-roots.mk"
+
+# Root of target directories.
+# Must have dest/ (build.sh's DESTDIR) and tools/ subdirectories
+ROOT.armv7?= /u/evbarm-armv7hf
+ROOT.armv6?= /u/evbarm-armv6hf
+ROOT.sparc64?= /u/sparc64
+ROOT.powerpc?= /u/macppc
+ROOT.arm64?= /u/evbarm64
+ROOT.arm64_be?= /u/evbarm64eb
+ROOT.i386?= /u/i386
+ROOT.mipsel?= /u/mipsel
+ROOT.riscv64?= /u/riscv64
+ROOT.m68k?= /u/m68k
+
+# Mapping to GNU triple
+G_TGT.armv7= armv7--netbsdelf-eabihf
+G_TGT.armv6= armv6--netbsdelf-eabihf
+G_TGT.sparc64= sparc64--netbsd
+G_TGT.powerpc= powerpc--netbsd
+G_TGT.arm64= aarch64--netbsd
+G_TGT.arm64_be= aarch64_be--netbsd
+G_TGT.i386= i486--netbsdelf
+G_TGT.mipsel= mipsel--netbsd
+G_TGT.riscv64= riscv64--netbsd
+G_TGT.m68k= m68k--netbsdelf
+
+# Mapping to rust's TARGET specification
+TGT.armv7= armv7-unknown-netbsd-eabihf
+TGT.armv6= armv6-unknown-netbsd-eabihf
+TGT.sparc64= sparc64-unknown-netbsd
+TGT.powerpc= 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
+TGT.riscv64= riscv64gc-unknown-netbsd
+TGT.m68k= m68k-unknown-netbsd
+
+# Optional target tweak for bootstrap files
+#TT.powerpc= powerpc-unknown-netbsd90
+
+WRKDIR= ${.CURDIR}/work
+SCRIPTS= ${WRKDIR}/scripts
+
+#DEBUG= echo
+ECHO?= echo
+
+# Make list of make targets
+.for st in ${SHORT_TARGETS}
+MTGTS+= do-${st}
+.endfor
+
+.PHONY: all
+
+all: ${MTGTS}
+
+# Define the individual build targets, used above
+.for st in ${SHORT_TARGETS}
+CA.${st}= --host=${TGT.${st}}
+CA.${st}+= --target=${TGT.${st}}
+CA.${st}+= --set=target.${TGT.${st}}.cc=${SCRIPTS}/gcc-wrap
+CA.${st}+= --set=target.${TGT.${st}}.cxx=${SCRIPTS}/c++-wrap
+CA.${st}+= --set=target.${TGT.${st}}.linker=${SCRIPTS}/gcc-wrap
+CA.${st}+= --set=target.${TGT.${st}}.ar=${ROOT.${st}}/tools/bin/${G_TGT.${st}}-ar
+
+.PHONY: do-${st}
+
+do-${st}:
+ mkdir -p dist
+ @${ECHO} "=======> Cross-building rust for ${st}"
+ ${DEBUG} make -f Makefile clean
+ ${DEBUG} env \
+ CROSS_ROOT=${ROOT.${st}} \
+ GNU_CROSS_TARGET=${G_TGT.${st}} \
+ make -f Makefile \
+ ADD_CONFIGURE_ARGS="${CA.${st}}" \
+ TARGET=${TGT.${st}}
+ if [ "${TT.${st}}" != "" ]; then \
+ TT=${TT.${st}}; \
+ else \
+ TT=${TGT.${st}}; \
+ fi; \
+ distdir=${WRKDIR}/rustc-${V_NOREV}-src/build/dist; \
+ for comp in rust rust-std; do \
+ src=$${distdir}/$${comp}-${V_NOREV}-${TGT.${st}}.tar.xz; \
+ tgt=dist/$${comp}-${VERSION}-$${TT}.tar.xz; \
+ if [ ! -f "$${tgt}" ]; then \
+ ${ECHO} ln $${src} $${tgt}; \
+ ${DEBUG} ln $${src} $${tgt}; \
+ fi; \
+ done; \
+ src_comp=rust-src-${V_NOREV}.tar.xz; \
+ if [ ! -f dist/$${src_comp} ]; then \
+ ${ECHO} ln $${distdir}/$${src_comp} dist; \
+ ${DEBUG} ln $${distdir}/$${src_comp} dist; \
+ fi
+.endfor
diff --git a/rust199/files/gcc-wrap b/rust199/files/gcc-wrap
new file mode 100644
index 0000000000..48cf4af822
--- /dev/null
+++ b/rust199/files/gcc-wrap
@@ -0,0 +1,215 @@
+#! /bin/sh
+
+# Root of targets tools + dest directories
+# or unset to default to a native build.
+
+# This script assumes target tools in $root/tools
+# and target's destdir in $root/dest, the result of a NetBSD build.sh.
+# ...or the native root, when we don't cross-compile
+root=${CROSS_ROOT:-/}
+
+incadd=""
+native=false
+if [ $root = "/" ]; then
+ native=true
+else
+ # What's the tools/bin prefix (if we're cross-building)?
+ gnuarch=${GNU_CROSS_TARGET:?}
+
+ # A special hack for netbsd-8 targets.
+ # netbsd-8 has gcc 5.5, but llvm and rust needs >= 7
+ # so we build tools from -9, and try to use that, but
+ # then the include path becomes wrong, and <stdatomic.h>
+ # is no longer picked up automatically by the compiler
+ # from the target destination directory
+ case $gnuarch in
+ sparc64*) incadd="-I=/usr/include/gcc-5"
+ ;;
+
+ # immintrin & from gcc-5 not
+ # compatible with gcc7, apparently
+ i[3456]86*) incadd="-I=/usr/include/gcc-7"
+ ;;
+
+ # mips64 does soft-float
+ mips64*) madd="-msoft-float"
+ ;;
+ powerpc*) # Now needed due to bloat
+ madd="-mlongcall"
+ ;;
+ m68k-*) # needed due to exceeding 16-bit offsets
+ # ref.
+ # relocation truncated to fit: R_68K_PC16 against ...
+ madd="-mlong-jump-table-offsets"
+ ;;
+ esac
+ # We build both for -8 and -9 due to ABI differences,
+ # so can't just test $gnuarch... Yes, a vile hack.
+ if [ "$root" = "/u/macppc" ]; then
+ incadd="-I=/usr/include/gcc-5"
+ fi
+fi
+
+# Who are we a wrapper for? (Typically either gcc or c++)
+who=$(basename $0 | sed -e 's/-wrap$//')
+
+args=""
+if [ ! -z "$madd" ]; then
+ args="$args $madd"
+fi
+
+# May need to add $linkadd before first -l or fist -L
+linkadd="-Wl,--sysroot=${root}/dest"
+# (perhaps this is overly cautious, other adjustments we do
+# below may be sufficient...)
+# Lib directories to ensure we search and have in run-path
+libs="/lib /usr/lib /usr/pkg/lib"
+
+for d in $libs; do
+ if ! $native; then
+ linkadd="$linkadd -L=$d"
+ linkadd="$linkadd -Wl,-rpath-link=${root}/dest/$d"
+ fi
+ # Run-path is for when we execute on the target,
+ # so no $root prefix
+ linkadd="$linkadd -Wl,-rpath,$d"
+done
+
+# ...and add a placeholder so we can tweak RPATH with chrpath,
+# since chrpath can't extend the length of the run path
+# (This may also not be needed, we use LD_LIBRARY_PATH instead)
+placeholder="placeholder-$(date | openssl dgst -sha1 | \
+ awk '{ print $2 }')"
+linkadd="$linkadd -Wl,-rpath,/$placeholder"
+# the / is a sneaky attempt to let it past cwrapper...
+
+# More debugging
+linkadd="$linkadd -Wl,--verbose"
+
+linktweaked=false
+
+# Step through args, tweak where required
+set -- "$@"
+while [ $# -gt 0 ]; do
+ case "$1" in
+# Insert = at the front of -isystem args.
+# This is to get --sysroot prepended, so that
+# we pick up the correct set of header files.
+# (I thought this wasn't reqired, but apparently it is...)
+ -isystem)
+ shift
+ case "$1" in
+ # Apparent mis-use of -isystem:
+ */siphash/*)
+ args="$args -I $1"
+ ;;
+ *)
+ args="$args -isystem =$1"
+ ;;
+ esac
+ ;;
+# Also doctor -I directives of known paths and
+# redirect them to the --sysroot.
+ -I/usr/include)
+ args="$args -I=/usr/include"
+ ;;
+ -I/usr/include/krb5)
+ args="$args -I=/usr/include/krb5"
+ ;;
+ -I/usr/pkg/include)
+# Try to drop this...
+ if ! $native; then
+ args="$args -I=/usr/pkg/include"
+ fi
+ ;;
+ -I)
+ if [ $2 = "/usr/include" ]; then
+ args="$args -I=/usr/include"
+ shift
+ elif [ $2 = "/usr/include/krb5" ]; then
+ args="$args -I=/usr/include/krb5"
+ shift
+ elif [ $2 = "/usr/pkg/include" ]; then
+# Try to drop this too...
+ if ! $native; then
+ args="$args -I=/usr/pkg/include"
+ fi
+ shift
+ else
+ args="$args -I"
+ fi
+ ;;
+ -l*)
+ if ! $linktweaked; then
+ args="$args $linkadd"
+ linktweaked=true
+ fi
+ args="$args $1"
+ ;;
+ -L)
+ if ! $linktweaked; then
+ args="$args $linkadd"
+ linktweaked=true
+ fi
+ shift
+ tweaked=false
+ # redirect these to -Wl,--sysroot
+ for d in /lib /usr/lib /usr/pkg/lib; do
+ if [ $1 = $d ]; then
+ args="$args -L =$d"
+ tweaked=true
+ fi
+ done
+ # Not redirected? If so we need to add
+ if ! $tweaked; then
+ args="$args -L $1"
+ fi
+ ;;
+
+ -L/lib)
+ if ! $linktweaked; then
+ args="$args $linkadd"
+ linktweaked=true
+ fi
+ args="$args -L=/lib"
+ ;;
+ -L/usr/lib)
+ if ! $linktweaked; then
+ args="$args $linkadd"
+ linktweaked=true
+ fi
+ args="$args -L=/usr/lib"
+ ;;
+ -L/usr/pkg/lib)
+ if ! $linktweaked; then
+ args="$args $linkadd"
+ linktweaked=true
+ fi
+ args="$args -L=/usr/pkg/lib"
+ ;;
+ -Wl,--enable-new-dtags)
+ # ignore
+ ;;
+ *)
+ args="$args $1"
+ ;;
+ esac
+ shift
+done
+
+if $native; then
+ # Try to avoid cwrappers, which does "undocumented magic"
+ # by invoking the compiler "directly".
+ #cmd="/usr/bin/${who} $args"
+ # (however, this wrapper isn't used when buliding natively...)
+ cmd="${who} $args"
+else
+ cmd="${root}/tools/bin/${gnuarch}-${who} \
+ --sysroot=${root}/dest \
+ $incadd \
+ $args"
+fi
+
+# Cannot echo to stdout, messes up e.g. "gcc -print-prog-name=ld" output...
+#echo $cmd >> /tmp/gcc-wrap.log
+exec $cmd
diff --git a/rust199/options.mk b/rust199/options.mk
new file mode 100644
index 0000000000..51692f4f79
--- /dev/null
+++ b/rust199/options.mk
@@ -0,0 +1,131 @@
+# $NetBSD: options.mk,v 1.55 2026/06/30 15:13:10 adam Exp $
+
+PKG_OPTIONS_VAR= PKG_OPTIONS.rust
+PKG_SUPPORTED_OPTIONS+= rust-cargo-static rust-docs rust-system-libgit2
+
+.include "../../mk/bsd.fast.prefs.mk"
+
+# The bundled LLVM current has issues building on SunOS.
+.if ${OPSYS} != "SunOS"
+PKG_SUPPORTED_OPTIONS+= rust-internal-llvm
+# There may be compatibility issues with the base LLVM on e.g. NetBSD.
+. if !empty(HAVE_LLVM)
+PKG_SUGGESTED_OPTIONS+= rust-internal-llvm
+. endif
+.endif
+
+# If cross-building, always use the internal LLVM
+.if !empty(TARGET)
+PKG_SUGGESTED_OPTIONS+= rust-internal-llvm
+.endif
+
+PKG_OPTIONS_LEGACY_OPTS+= rust-llvm:rust-internal-llvm
+
+# Bundle OpenSSL and curl into the cargo binary when producing
+# bootstraps on NetBSD.
+.if ${OPSYS} == "NetBSD" && ${BUILD_TARGET} == "dist"
+PKG_SUGGESTED_OPTIONS+= rust-cargo-static
+.endif
+
+.include "../../mk/bsd.options.mk"
+
+# 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, go figure).
+.if ${MACHINE_PLATFORM:MNetBSD-10.*-sparc64}
+. if !empty(PKG_OPTIONS:Mrust-internal-llvm)
+# Require GCC 12 (from pkgsrc) to correctly build the embedded LLVM (18.x).
+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"
+# The above is seen with both in-tree gcc (10.5.0) and gcc12 from pkgsrc.
+.if ${MACHINE_PLATFORM:MNetBSD-*-powerpc}
+GCC_REQD+= 14
+.endif
+
+#
+# Use the internal copy of LLVM or the external one?
+#
+.if empty(PKG_OPTIONS:Mrust-internal-llvm)
+.include "../../lang/libunwind/buildlink3.mk"
+
+# Ref. src/bootstrap/src/core/build_steps/llvm.rs / check_llvm_version()
+# rust now (1.98.0) requires LLVM >= 21.x
+BUILDLINK_API_DEPENDS.llvm+= llvm>=21.1.0
+BUILDLINK_ABI_DEPENDS.llvm+= llvm>=21.1.0
+
+.include "../../lang/llvm/buildlink3.mk"
+CONFIGURE_ARGS+= --enable-llvm-link-shared
+CONFIGURE_ARGS+= --llvm-libunwind=system
+CONFIGURE_ARGS+= --llvm-root=${BUILDLINK_PREFIX.llvm}
+# Also turn off build of the internal LLD, as the external LLVM
+# may be older (e.g., 18) than the internal LLD (now 19.x), ref.
+# https://github.com/rust-lang/rust/issues/131291
+CONFIGURE_ARGS+= --set rust.lld=false
+.endif
+
+#
+# Use the external libgit2.
+#
+.if !empty(PKG_OPTIONS:Mrust-system-libgit2)
+.include "../../devel/libgit2/buildlink3.mk"
+CONFIGURE_ENV+= LIBGIT2_NO_VENDOR=1
+.endif
+
+# Rust bumps into NetBSD's limit of 256 TLS keys per process, at least
+# on aarch64 with "fatal runtime error: out of TLS keys, aborting"
+# (for some incomprehensible reason this isn't triggered on NetBSD/amd64 10.1)
+.if ${MACHINE_PLATFORM:MNetBSD-*-aarch64*}
+# So try to bump that per-process limit:
+MAKE_ENV+= PTHREAD_KEYS_MAX=512
+.endif
+
+#
+# Link cargo statically against "native" libraries.
+# (openssl and curl specifically).
+#
+.if !empty(PKG_OPTIONS:Mrust-cargo-static)
+CONFIGURE_ARGS+= --enable-cargo-native-static
+.else
+BUILDLINK_API_DEPENDS.nghttp2+= nghttp2>=1.41.0
+BUILDLINK_API_DEPENDS.curl+= curl>=7.67.0
+.include "../../www/curl/buildlink3.mk"
+.include "../../security/openssl/buildlink3.mk"
+.endif
+
+# Work around https://github.com/rust-lang/rust/issues/148497
+# where the linking of rust-analyzer fails because it's now too big
+# for 24-bit word-based PC-relative relocation offsets.
+# Apply on or for powerpc:
+.if ${MACHINE_PLATFORM:MNetBSD-*-powerpc} || \
+ (!empty(TARGET) && ${TARGET:Mpowerpc-*})
+CONFIGURE_ARGS+= --tools="cargo,clippy,rustdoc,rustfmt,analysis,src,wasm-component-ld"
+# rust-analyzer dropped from list
+.endif
+
+#
+# Install documentation.
+#
+.if !empty(PKG_OPTIONS:Mrust-docs)
+CONFIGURE_ARGS+= --enable-docs
+.else
+CONFIGURE_ARGS+= --disable-docs
+.endif
diff --git a/rust199/patches/patch-compiler_rustc__codegen__ssa_src_back_linker.rs b/rust199/patches/patch-compiler_rustc__codegen__ssa_src_back_linker.rs
new file mode 100644
index 0000000000..871c27f06e
--- /dev/null
+++ b/rust199/patches/patch-compiler_rustc__codegen__ssa_src_back_linker.rs
@@ -0,0 +1,27 @@
+$NetBSD: patch-compiler_rustc__codegen__ssa_src_back_linker.rs,v 1.22 2026/04/02 19:06:34 wiz Exp $
+
+Do not use @rpath on Darwin.
+Find external libunwind on Linux.
+
+--- compiler/rustc_codegen_ssa/src/back/linker.rs.orig 2026-01-24 10:12:53.935808570 +0000
++++ compiler/rustc_codegen_ssa/src/back/linker.rs
+@@ -454,7 +454,7 @@ impl<'a> GccLinker<'a> {
+ // principled solution at some point to force the compiler to pass
+ // the right `-Wl,-install_name` with an `@rpath` in it.
+ if self.sess.opts.cg.rpath || self.sess.opts.unstable_opts.osx_rpath_install_name {
+- let mut rpath = OsString::from("@rpath/");
++ let mut rpath = OsString::from("@PREFIX@/lib/");
+ rpath.push(out_filename.file_name().unwrap());
+ self.link_arg("-install_name").link_arg(rpath);
+ }
+@@ -596,6 +596,10 @@ impl<'a> Linker for GccLinker<'a> {
+ }
+
+ fn link_dylib_by_name(&mut self, name: &str, verbatim: bool, as_needed: bool) {
++ if self.sess.target.llvm_target.contains("linux") && name == "unwind" {
++ self.link_arg("-R@PREFIX@/lib");
++ self.link_arg("-L@PREFIX@/lib");
++ }
+ if self.sess.target.os == Os::Illumos && name == "c" {
+ // libc will be added via late_link_args on illumos so that it will
+ // appear last in the library search order.
diff --git a/rust199/patches/patch-compiler_rustc__llvm_build.rs b/rust199/patches/patch-compiler_rustc__llvm_build.rs
new file mode 100644
index 0000000000..096133453c
--- /dev/null
+++ b/rust199/patches/patch-compiler_rustc__llvm_build.rs
@@ -0,0 +1,50 @@
+$NetBSD: patch-compiler_rustc__llvm_build.rs,v 1.20 2025/08/25 17:51:12 wiz Exp $
+
+Fix build on NetBSD HEAD-llvm. XXX there is probably a better way to do this.
+
+Pick up -latomic tweak from
+https://github.com/rust-lang/rust/issues/104220
+and
+https://github.com/rust-lang/rust/pull/104572
+
+--- compiler/rustc_llvm/build.rs.orig 2023-10-03 02:52:17.000000000 +0000
++++ compiler/rustc_llvm/build.rs
+@@ -249,6 +249,10 @@ fn main() {
+ {
+ // 32-bit targets need to link libatomic.
+ println!("cargo:rustc-link-lib=atomic");
++ if target.contains("netbsd")
++ {
++ println!("cargo:rustc-link-lib=z");
++ }
+ } else if target.contains("windows-gnu") {
+ println!("cargo:rustc-link-lib=shell32");
+ println!("cargo:rustc-link-lib=uuid");
+@@ -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=z");
+@@ -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
+- "stdc++_p"
++ if env::var_os("PKGSRC_HAVE_LIBCPP").is_some() {
++ "c++_pic"
++ } else {
++ "stdc++_pic"
++ }
++ } else if env::var_os("PKGSRC_HAVE_LIBCPP").is_some() {
++ "c++"
+ } else if llvm_use_libcxx.is_some() {
+ "c++"
+ } else {
diff --git a/rust199/patches/patch-compiler_rustc__target_src_spec_base_netbsd.rs b/rust199/patches/patch-compiler_rustc__target_src_spec_base_netbsd.rs
new file mode 100644
index 0000000000..122dcf7de6
--- /dev/null
+++ b/rust199/patches/patch-compiler_rustc__target_src_spec_base_netbsd.rs
@@ -0,0 +1,32 @@
+$NetBSD: patch-compiler_rustc__target_src_spec_base_netbsd.rs,v 1.7 2026/04/02 19:06:34 wiz 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::{Os, RelroLevel, TargetOptions, cvs};
++use crate::spec::{Cc, Lld, LinkerFlavor, Os, RelroLevel, TargetOptions, cvs};
+
+ pub(crate) 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: Os::NetBsd,
+ dynamic_linking: true,
+ families: cvs!["unix"],
+ no_default_libraries: false,
+ has_rpath: true,
++ pre_link_args,
+ position_independent_executables: true,
+ relro_level: RelroLevel::Full,
+ has_thread_local: true,
diff --git a/rust199/patches/patch-compiler_rustc__target_src_spec_mod.rs b/rust199/patches/patch-compiler_rustc__target_src_spec_mod.rs
new file mode 100644
index 0000000000..378fa5544a
--- /dev/null
+++ b/rust199/patches/patch-compiler_rustc__target_src_spec_mod.rs
@@ -0,0 +1,22 @@
+$NetBSD: patch-compiler_rustc__target_src_spec_mod.rs,v 1.18 2026/04/02 19:06:34 wiz Exp $
+
+Add entry for NetBSD/mips64el and NetBSD/m68k
+
+--- compiler/rustc_target/src/spec/mod.rs.orig 2026-02-11 07:30:54.000000000 +0000
++++ compiler/rustc_target/src/spec/mod.rs
+@@ -1440,6 +1440,7 @@ supported_targets! {
+ ("loongarch64-unknown-linux-musl", loongarch64_unknown_linux_musl),
+ ("m68k-unknown-linux-gnu", m68k_unknown_linux_gnu),
+ ("m68k-unknown-none-elf", m68k_unknown_none_elf),
++ ("m68k-unknown-netbsd", m68k_unknown_netbsd),
+ ("csky-unknown-linux-gnuabiv2", csky_unknown_linux_gnuabiv2),
+ ("csky-unknown-linux-gnuabiv2hf", csky_unknown_linux_gnuabiv2hf),
+ ("mips-unknown-linux-gnu", mips_unknown_linux_gnu),
+@@ -1529,6 +1530,7 @@ supported_targets! {
+ ("armv7-unknown-netbsd-eabihf", armv7_unknown_netbsd_eabihf),
+ ("i586-unknown-netbsd", i586_unknown_netbsd),
+ ("i686-unknown-netbsd", i686_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),
diff --git a/rust199/patches/patch-compiler_rustc__target_src_spec_targets_aarch64__be__unknown__netbsd.rs b/rust199/patches/patch-compiler_rustc__target_src_spec_targets_aarch64__be__unknown__netbsd.rs
new file mode 100644
index 0000000000..764812dc4a
--- /dev/null
+++ b/rust199/patches/patch-compiler_rustc__target_src_spec_targets_aarch64__be__unknown__netbsd.rs
@@ -0,0 +1,17 @@
+$NetBSD: patch-compiler_rustc__target_src_spec_targets_aarch64__be__unknown__netbsd.rs,v 1.3 2025/08/25 17:51:12 wiz Exp $
+
+NetBSD aarch64 has a bug in the thread-local storage implementation,
+ref. PR#58154. Turn it off for now.
+Ideally should check whether the version has the fix or not, but
+e.g. __NetBSD_Version__ isn't easily available here that I know...
+
+--- compiler/rustc_target/src/spec/targets/aarch64_be_unknown_netbsd.rs.orig 2024-07-23 19:21:34.344805113 +0000
++++ compiler/rustc_target/src/spec/targets/aarch64_be_unknown_netbsd.rs
+@@ -18,6 +18,7 @@ pub fn target() -> Target {
+ max_atomic_width: Some(128),
+ stack_probes: StackProbeType::Inline,
+ endian: Endian::Big,
++ has_thread_local: false, // ref. NetBSD PR#58154
+ ..base::netbsd::opts()
+ },
+ }
diff --git a/rust199/patches/patch-compiler_rustc__target_src_spec_targets_aarch64__unknown__netbsd.rs b/rust199/patches/patch-compiler_rustc__target_src_spec_targets_aarch64__unknown__netbsd.rs
new file mode 100644
index 0000000000..27ae9671f2
--- /dev/null
+++ b/rust199/patches/patch-compiler_rustc__target_src_spec_targets_aarch64__unknown__netbsd.rs
@@ -0,0 +1,17 @@
+$NetBSD: patch-compiler_rustc__target_src_spec_targets_aarch64__unknown__netbsd.rs,v 1.3 2025/08/25 17:51:12 wiz Exp $
+
+NetBSD aarch64 has a bug in the thread-local storage implementation,
+ref. PR#58154. Turn it off for now.
+Ideally should check whether the version has the fix or not, but
+e.g. __NetBSD_Version__ isn't easily available here that I know...
+
+--- compiler/rustc_target/src/spec/targets/aarch64_unknown_netbsd.rs.orig 2024-07-23 19:18:44.116841966 +0000
++++ compiler/rustc_target/src/spec/targets/aarch64_unknown_netbsd.rs
+@@ -17,6 +17,7 @@ pub fn target() -> Target {
+ mcount: "__mcount".into(),
+ max_atomic_width: Some(128),
+ stack_probes: StackProbeType::Inline,
++ has_thread_local: false, // ref. NetBSD PR#58154
+ ..base::netbsd::opts()
+ },
+ }
diff --git a/rust199/patches/patch-compiler_rustc__target_src_spec_targets_m68k__unknown__netbsd.rs b/rust199/patches/patch-compiler_rustc__target_src_spec_targets_m68k__unknown__netbsd.rs
new file mode 100644
index 0000000000..0840603d4b
--- /dev/null
+++ b/rust199/patches/patch-compiler_rustc__target_src_spec_targets_m68k__unknown__netbsd.rs
@@ -0,0 +1,39 @@
+$NetBSD: patch-compiler_rustc__target_src_spec_targets_m68k__unknown__netbsd.rs,v 1.1 2026/04/02 19:06:34 wiz Exp $
+
+Add a target description for NetBSD/m68k.
+Align data_layout with new patch to llvm.
+
+--- /dev/null 2026-02-24 21:43:45.067063051 +0000
++++ compiler/rustc_target/src/spec/targets/m68k_unknown_netbsd.rs 2026-02-24 21:48:57.106967890 +0000
+@@ -0,0 +1,31 @@
++use rustc_abi::Endian;
++
++use crate::spec::{Arch, LinkSelfContainedDefault, Target, TargetMetadata, TargetOptions, base};
++
++pub(crate) fn target() -> Target {
++ let mut base = base::netbsd::opts();
++ base.cpu = "M68020".into();
++ base.max_atomic_width = Some(32);
++
++ Target {
++ llvm_target: "m68k-unknown-netbsd".into(),
++ metadata: TargetMetadata {
++ description: Some("Motorola 680x0 NetBSD".into()),
++ tier: Some(3),
++ host_tools: Some(false),
++ std: Some(true),
++ },
++ pointer_width: 32,
++ data_layout: "E-m:e-p:32:32:32-i8:8:8-i16:16:16-i32:32:32-n8:16:32-a:0:32-S32".into(),
++ arch: Arch::M68k,
++ options: TargetOptions {
++ endian: Endian::Big,
++ mcount: "_mcount".into(),
++
++ // LLD currently does not have support for M68k
++ link_self_contained: LinkSelfContainedDefault::False,
++ ..base
++ },
++ }
++}
++
diff --git a/rust199/patches/patch-compiler_rustc__target_src_spec_targets_mips64el__unknown__netbsd.rs b/rust199/patches/patch-compiler_rustc__target_src_spec_targets_mips64el__unknown__netbsd.rs
new file mode 100644
index 0000000000..718acb4411
--- /dev/null
+++ b/rust199/patches/patch-compiler_rustc__target_src_spec_targets_mips64el__unknown__netbsd.rs
@@ -0,0 +1,39 @@
+$NetBSD: patch-compiler_rustc__target_src_spec_targets_mips64el__unknown__netbsd.rs,v 1.8 2026/04/02 19:06:34 wiz 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,32 @@
++//! A target tuple for NetBSD/mips64
++
++use rustc_abi::Endian;
++
++use crate::spec::{Arch, CfgAbi, LlvmAbi, Target, TargetMetadata, TargetOptions, base};
++
++pub(crate) 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(),
++ metadata: TargetMetadata {
++ description: Some("NetBSD/mips64 with n32 ABI".into()),
++ tier: Some(3),
++ host_tools: Some(false),
++ std: Some(false),
++ },
++ pointer_width: 32,
++ data_layout: "e-m:m-p:32:32-i8:8:32-i16:16:32-i64:64-n32-S64".into(),
++ arch: Arch::Mips64,
++ options: TargetOptions {
++ cfg_abi: CfgAbi::AbiV2,
++ endian: Endian::Little,
++ features: "+soft-float,+abi=n32".into(),
++ llvm_abiname: LlvmAbi::N32,
++ mcount: "__mcount".into(),
++ ..base
++ },
++ }
++}
diff --git a/rust199/patches/patch-compiler_rustc__target_src_spec_targets_mipsel__unknown__netbsd.rs b/rust199/patches/patch-compiler_rustc__target_src_spec_targets_mipsel__unknown__netbsd.rs
new file mode 100644
index 0000000000..2ef46ce41f
--- /dev/null
+++ b/rust199/patches/patch-compiler_rustc__target_src_spec_targets_mipsel__unknown__netbsd.rs
@@ -0,0 +1,14 @@
+$NetBSD: patch-compiler_rustc__target_src_spec_targets_mipsel__unknown__netbsd.rs,v 1.3 2025/08/25 17:51:12 wiz Exp $
+
+Let's see if turning off thread local storage makes a difference...
+
+--- compiler/rustc_target/src/spec/targets/mipsel_unknown_netbsd.rs.orig 2024-08-05 20:02:56.368978562 +0000
++++ compiler/rustc_target/src/spec/targets/mipsel_unknown_netbsd.rs
+@@ -24,6 +24,7 @@ pub(crate) fn target() -> Target {
+ llvm_args: cvs!["-mno-check-zero-division"],
+ mcount: "__mcount".into(),
+ endian: Endian::Little,
++ has_thread_local: false,
+ ..base
+ },
+ }
diff --git a/rust199/patches/patch-library_backtrace_src_symbolize_gimli.rs b/rust199/patches/patch-library_backtrace_src_symbolize_gimli.rs
new file mode 100644
index 0000000000..76eba086d0
--- /dev/null
+++ b/rust199/patches/patch-library_backtrace_src_symbolize_gimli.rs
@@ -0,0 +1,14 @@
+$NetBSD: patch-library_backtrace_src_symbolize_gimli.rs,v 1.9 2025/08/25 17:51:12 wiz Exp $
+
+Add NetBSD to the family who is in the unix class.
+
+--- library/backtrace/src/symbolize/gimli.rs.orig 2006-07-24 01:21:28.000000000 +0000
++++ library/backtrace/src/symbolize/gimli.rs
+@@ -40,6 +40,7 @@ cfg_if::cfg_if! {
+ target_os = "haiku",
+ target_os = "hurd",
+ target_os = "linux",
++ target_os = "netbsd",
+ target_os = "openbsd",
+ target_os = "solaris",
+ target_os = "illumos",
diff --git a/rust199/patches/patch-library_backtrace_src_symbolize_gimli_elf.rs b/rust199/patches/patch-library_backtrace_src_symbolize_gimli_elf.rs
new file mode 100644
index 0000000000..ced576df71
--- /dev/null
+++ b/rust199/patches/patch-library_backtrace_src_symbolize_gimli_elf.rs
@@ -0,0 +1,26 @@
+$NetBSD: patch-library_backtrace_src_symbolize_gimli_elf.rs,v 1.10 2025/08/25 17:51:12 wiz 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
+@@ -395,11 +395,18 @@ fn decompress_zstd(mut input: &[u8], mut
+ Some(())
+ }
+
++#[cfg(target_os = "netbsd")]
++const DEBUG_PATH: &str = "/usr/libdata/debug";
++#[cfg(not(target_os = "netbsd"))]
+ const DEBUG_PATH: &str = "/usr/lib/debug";
+
+ fn debug_path_exists() -> bool {
+ cfg_if::cfg_if! {
+- 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);
+
diff --git a/rust199/patches/patch-src_bootstrap_Cargo.toml b/rust199/patches/patch-src_bootstrap_Cargo.toml
new file mode 100644
index 0000000000..5e7c0ffa68
--- /dev/null
+++ b/rust199/patches/patch-src_bootstrap_Cargo.toml
@@ -0,0 +1,18 @@
+$NetBSD$
+
+Treat linker-messages as warn-by-default.
+Make sure to remove this when no longer needed.
+See: https://github.com/rust-lang/rust/pull/153968
+
+--- src/bootstrap/Cargo.toml.orig 2026-08-22 20:02:17.734783376 +0000
++++ src/bootstrap/Cargo.toml
+@@ -9,6 +9,9 @@ default-run = "bootstrap"
+ build-metrics = ["dep:sysinfo", "build_helper/metrics"]
+ tracing = ["dep:tracing", "dep:tracing-chrome", "dep:tracing-subscriber", "dep:chrono"]
+
++[lints.rust]
++linker_messages = "allow"
++
+ [lib]
+ path = "src/lib.rs"
+ doctest = false
diff --git a/rust199/patches/patch-src_bootstrap_bootstrap.py b/rust199/patches/patch-src_bootstrap_bootstrap.py
new file mode 100644
index 0000000000..d7d8d0ad43
--- /dev/null
+++ b/rust199/patches/patch-src_bootstrap_bootstrap.py
@@ -0,0 +1,48 @@
+$NetBSD: patch-src_bootstrap_bootstrap.py,v 1.28 2026/01/13 20:48:23 wiz Exp $
+
+Use `uname -p` on NetBSD, as that is reliable and sensible there.
+Use @PREFIX@ and not $ORIGIN in rpath.
+
+--- src/bootstrap/bootstrap.py.orig 2025-10-28 16:34:16.000000000 +0000
++++ src/bootstrap/bootstrap.py
+@@ -330,6 +330,11 @@ def default_build_triple(verbose):
+ "GNU": "unknown-hurd",
+ }
+
++ # For NetBSD, use `uname -p`, as there it is reliable & sensible
++ if kernel == 'NetBSD':
++ cputype = subprocess.check_output(
++ ['uname', '-p']).strip().decode(default_encoding)
++
+ # Consider the direct transformation first and then the special cases
+ if kernel in kerneltype_mapper:
+ kernel = kerneltype_mapper[kernel]
+@@ -706,11 +711,11 @@ class RustBuild(object):
+ )
+ p = Pool(pool_size)
+ try:
+- # FIXME: A cheap workaround for https://github.com/rust-lang/rust/issues/125578,
+- # remove this once the issue is closed.
+- bootstrap_build_artifacts = os.path.join(self.bootstrap_out(), "debug")
+- if os.path.exists(bootstrap_build_artifacts):
+- shutil.rmtree(bootstrap_build_artifacts)
++# # FIXME: A cheap workaround for https://github.com/rust-lang/rust/issues/125578,
++# # remove this once the issue is closed.
++# bootstrap_build_artifacts = os.path.join(self.bootstrap_out(), "debug")
++# if os.path.exists(bootstrap_build_artifacts):
++# shutil.rmtree(bootstrap_build_artifacts)
+
+ p.map(unpack_component, tarballs_download_info)
+ finally:
+@@ -857,7 +862,10 @@ class RustBuild(object):
+ self.nix_deps_dir = nix_deps_dir
+
+ patchelf = "{}/bin/patchelf".format(nix_deps_dir)
+- rpath_entries = [os.path.join(os.path.realpath(nix_deps_dir), "lib")]
++ rpath_entries = [
++ "@PREFIX@/lib",
++ os.path.join(os.path.realpath(nix_deps_dir), "lib")
++ ]
+ patchelf_args = ["--add-rpath", ":".join(rpath_entries)]
+ if ".so" not in fname:
+ # Finally, set the correct .interp for binaries
diff --git a/rust199/patches/patch-src_bootstrap_src_core_build__steps_compile.rs b/rust199/patches/patch-src_bootstrap_src_core_build__steps_compile.rs
new file mode 100644
index 0000000000..291b0b70ad
--- /dev/null
+++ b/rust199/patches/patch-src_bootstrap_src_core_build__steps_compile.rs
@@ -0,0 +1,15 @@
+$NetBSD: patch-src_bootstrap_src_core_build__steps_compile.rs,v 1.5 2025/08/25 17:51:12 wiz 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
+@@ -695,7 +695,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(builder, &dst, &format!("@rpath/{}", runtime.name));
++ apple_darwin_update_library_name(builder, &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(builder, &dst);
diff --git a/rust199/patches/patch-src_bootstrap_src_core_build__steps_install.rs b/rust199/patches/patch-src_bootstrap_src_core_build__steps_install.rs
new file mode 100644
index 0000000000..2b14fb1b9e
--- /dev/null
+++ b/rust199/patches/patch-src_bootstrap_src_core_build__steps_install.rs
@@ -0,0 +1,15 @@
+$NetBSD: patch-src_bootstrap_src_core_build__steps_install.rs,v 1.5 2026/04/02 19:06:34 wiz Exp $
+
+Drop "docs" from installation (takes forever), add "rust".
+
+--- src/bootstrap/src/core/build_steps/install.rs.orig 2025-10-28 16:34:16.000000000 +0000
++++ src/bootstrap/src/core/build_steps/install.rs
+@@ -206,7 +206,7 @@ macro_rules! install {
+ install!((self, builder, _config),
+ Docs, path = "src/doc", _config.docs, IS_HOST: false, {
+ let tarball = builder.ensure(dist::Docs { host: self.target }).expect("missing docs");
+- install_sh(builder, "docs", self.build_compiler, Some(self.target), &tarball);
++ install_sh(builder, "rust", self.build_compiler, Some(self.target), &tarball);
+ };
+ Std, path = "library/std", true, IS_HOST: false, {
+ // `expect` should be safe, only None when host != build, but this
diff --git a/rust199/patches/patch-src_bootstrap_src_core_builder_cargo.rs b/rust199/patches/patch-src_bootstrap_src_core_builder_cargo.rs
new file mode 100644
index 0000000000..3695f47e3e
--- /dev/null
+++ b/rust199/patches/patch-src_bootstrap_src_core_builder_cargo.rs
@@ -0,0 +1,26 @@
+$NetBSD: patch-src_bootstrap_src_core_builder_cargo.rs,v 1.4 2026/05/07 13:16:15 wiz Exp $
+
+Find external libunwind and libLLVM in pkgsrc (not just Linux).
+Use @PREFIX@ in rpath.
+
+--- src/bootstrap/src/core/builder/cargo.rs.orig 2026-04-14 19:55:32.000000000 +0000
++++ src/bootstrap/src/core/builder/cargo.rs
+@@ -299,7 +299,7 @@ impl Cargo {
+ && !target.contains("xous")
+ {
+ self.rustflags.arg("-Clink-args=-Wl,-z,origin");
+- Some(format!("-Wl,-rpath,$ORIGIN/../{libdir}"))
++ Some(format!("-Wl,-rpath,@PREFIX@/lib"))
+ } else {
+ None
+ };
+@@ -1422,6 +1422,9 @@ impl Builder<'_> {
+ }
+ };
+
++ // added for pkgsrc libunwind or external LLVM
++ rustflags.arg("-Clink-args=-Wl,-rpath,@PREFIX@/lib,-L@PREFIX@/lib");
++
+ Cargo {
+ command: cargo,
+ args: vec![],
diff --git a/rust199/patches/patch-src_bootstrap_src_core_sanity.rs b/rust199/patches/patch-src_bootstrap_src_core_sanity.rs
new file mode 100644
index 0000000000..89140f9102
--- /dev/null
+++ b/rust199/patches/patch-src_bootstrap_src_core_sanity.rs
@@ -0,0 +1,26 @@
+$NetBSD$
+
+Add m68k-unknown-netbsd to "missing stage0" list.
+
+--- src/bootstrap/src/core/sanity.rs.orig 2026-05-25 23:21:07.000000000 +0000
++++ src/bootstrap/src/core/sanity.rs
+@@ -36,6 +36,7 @@ pub struct Finder {
+ const STAGE0_MISSING_TARGETS: &[&str] = &[
+ // just a dummy comment so the list doesn't get onelined
+ "aarch64-unknown-l4re-uclibc",
++ "m68k-unknown-netbsd",
+ ];
+
+ /// Minimum version threshold for libstdc++ required when using prebuilt LLVM
+@@ -264,7 +265,10 @@ than building it.
+ for duplicated_target in duplicated_targets {
+ println!(" {duplicated_target}");
+ }
+- std::process::exit(1);
++// For now don't make this a fatal error.
++// e.g. m68k-unknown-netbsd may be in the list for a while
++// until LLVM is fixed to not emit 16-bit PC-relative relocations only...
++// std::process::exit(1);
+ }
+
+ // Check if it's a built-in target.
diff --git a/rust199/patches/patch-src_bootstrap_src_lib.rs b/rust199/patches/patch-src_bootstrap_src_lib.rs
new file mode 100644
index 0000000000..9f8eabe566
--- /dev/null
+++ b/rust199/patches/patch-src_bootstrap_src_lib.rs
@@ -0,0 +1,40 @@
+$NetBSD: patch-src_bootstrap_src_lib.rs,v 1.10 2026/01/14 06:44:31 wiz Exp $
+
+Don't filter out optimization flags.
+FreeBSD has a particular C++ runtime library name.
+Don't assume files in ${PREFIX}/lib are readable by the building user.
+
+--- src/bootstrap/src/lib.rs.orig 2025-09-14 15:05:11.000000000 +0000
++++ src/bootstrap/src/lib.rs
+@@ -1256,7 +1256,6 @@ impl Build {
+ base.args()
+ .iter()
+ .map(|s| s.to_string_lossy().into_owned())
+- .filter(|s| !s.starts_with("-O") && !s.starts_with("/O"))
+ .collect::<Vec<String>>()
+ }
+
+@@ -1272,7 +1271,8 @@ impl Build {
+ // 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());
+ }
+
+@@ -1813,7 +1813,12 @@ impl Build {
+ // but if that fails just fall back to a slow `copy` operation.
+ } else {
+ if let Err(e) = fs::copy(&src, dst) {
+- panic!("failed to copy `{}` to `{}`: {}", src.display(), dst.display(), e)
++ if e.kind() == io::ErrorKind::PermissionDenied {
++ eprintln!("Skipping copy of `{}` to `{}`: {}", src.display(), dst.display(), e);
++ return;
++ } else {
++ panic!("failed to copy `{}` to `{}`: {}", src.display(), dst.display(), e)
++ }
+ }
+ t!(fs::set_permissions(dst, metadata.permissions()));
+
diff --git a/rust199/patches/patch-src_llvm-project_llvm_CMakeLists.txt b/rust199/patches/patch-src_llvm-project_llvm_CMakeLists.txt
new file mode 100644
index 0000000000..8d04d986cc
--- /dev/null
+++ b/rust199/patches/patch-src_llvm-project_llvm_CMakeLists.txt
@@ -0,0 +1,18 @@
+$NetBSD: patch-src_llvm-project_llvm_CMakeLists.txt,v 1.16 2026/05/07 13:16:15 wiz Exp $
+
+Don't implement sys/regset.h workaround, fix source instead.
+
+--- src/llvm-project/llvm/CMakeLists.txt.orig 2026-04-14 19:55:32.000000000 +0000
++++ src/llvm-project/llvm/CMakeLists.txt
+@@ -1288,11 +1288,6 @@ if (CMAKE_SYSTEM_NAME MATCHES "OS390")
+ include_directories(SYSTEM "${LLVM_MAIN_INCLUDE_DIR}/llvm/Support/SystemZ/zos_wrappers" )
+ endif()
+
+-if( "${CMAKE_SYSTEM_NAME}" MATCHES SunOS )
+- # special hack for Solaris to handle crazy system sys/regset.h
+- include_directories("${LLVM_MAIN_INCLUDE_DIR}/llvm/Support/Solaris")
+-endif( "${CMAKE_SYSTEM_NAME}" MATCHES SunOS )
+-
+ # Make sure we don't get -rdynamic in every binary. For those that need it,
+ # use EXPORT_SYMBOLS argument.
+ set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS "")
diff --git a/rust199/patches/patch-src_llvm-project_llvm_cmake_modules_AddLLVM.cmake b/rust199/patches/patch-src_llvm-project_llvm_cmake_modules_AddLLVM.cmake
new file mode 100644
index 0000000000..2b02fe3c05
--- /dev/null
+++ b/rust199/patches/patch-src_llvm-project_llvm_cmake_modules_AddLLVM.cmake
@@ -0,0 +1,49 @@
+$NetBSD: patch-src_llvm-project_llvm_cmake_modules_AddLLVM.cmake,v 1.16 2026/05/07 13:16:15 wiz Exp $
+
+On Darwin, use correct install-name for shared libraries.
+
+Undo some of the RPATH magic so that cross-building
+works inside pkgsrc again (indirectly eliminates $ORIGIN rpath
+handling / editing, $ORIGIN handling is partially undone by cwrappers
+in pkgsrc).
+
+--- src/llvm-project/llvm/cmake/modules/AddLLVM.cmake.orig 2023-07-12 03:33:01.000000000 +0000
++++ src/llvm-project/llvm/cmake/modules/AddLLVM.cmake
+@@ -2694,7 +2694,7 @@ function(llvm_setup_rpath name)
+ endif()
+
+ if (APPLE)
+- set(_install_name_dir INSTALL_NAME_DIR "@rpath")
++ set(_install_name_dir INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib")
+ set(_install_rpath "@loader_path/../lib${LLVM_LIBDIR_SUFFIX}" ${extra_libdir})
+ elseif("${CMAKE_SYSTEM_NAME}" MATCHES "AIX" AND BUILD_SHARED_LIBS)
+ # $ORIGIN is not interpreted at link time by aix ld.
+@@ -2703,8 +2703,7 @@ function(llvm_setup_rpath name)
+ # FIXME: update this when there is better solution.
+ set(_install_rpath "${LLVM_LIBRARY_OUTPUT_INTDIR}" "${CMAKE_INSTALL_PREFIX}/lib${LLVM_LIBDIR_SUFFIX}" ${extra_libdir})
+ elseif(UNIX)
+- set(_build_rpath "\$ORIGIN/../lib${LLVM_LIBDIR_SUFFIX}" ${extra_libdir})
+- set(_install_rpath "\$ORIGIN/../lib${LLVM_LIBDIR_SUFFIX}")
++ set(_install_rpath "\$ORIGIN/../lib${LLVM_LIBDIR_SUFFIX}" ${extra_libdir})
+ if(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR AND NOT APPLE)
+ list(APPEND _build_rpath "\$ORIGIN/../lib${LLVM_LIBDIR_SUFFIX}/${LLVM_DEFAULT_TARGET_TRIPLE}")
+ list(APPEND _install_rpath "\$ORIGIN/../lib${LLVM_LIBDIR_SUFFIX}/${LLVM_DEFAULT_TARGET_TRIPLE}")
+@@ -2722,16 +2721,9 @@ function(llvm_setup_rpath name)
+ return()
+ endif()
+
+- # Enable BUILD_WITH_INSTALL_RPATH unless CMAKE_BUILD_RPATH is set and not
+- # building for macOS or AIX, as those platforms seemingly require it.
+- # On AIX, the tool chain doesn't support modifying rpaths/libpaths for XCOFF
+- # on install at the moment, so BUILD_WITH_INSTALL_RPATH is required.
++ # Enable BUILD_WITH_INSTALL_RPATH unless CMAKE_BUILD_RPATH is set.
+ if("${CMAKE_BUILD_RPATH}" STREQUAL "")
+- if("${CMAKE_SYSTEM_NAME}" MATCHES "Darwin|AIX")
+- set_property(TARGET ${name} PROPERTY BUILD_WITH_INSTALL_RPATH ON)
+- else()
+- set_property(TARGET ${name} APPEND PROPERTY BUILD_RPATH "${_build_rpath}")
+- endif()
++ set_property(TARGET ${name} PROPERTY BUILD_WITH_INSTALL_RPATH ON)
+ endif()
+
+ set_target_properties(${name} PROPERTIES
diff --git a/rust199/patches/patch-src_llvm-project_llvm_include_llvm-c_DataTypes.h b/rust199/patches/patch-src_llvm-project_llvm_include_llvm-c_DataTypes.h
new file mode 100644
index 0000000000..8722fdfe38
--- /dev/null
+++ b/rust199/patches/patch-src_llvm-project_llvm_include_llvm-c_DataTypes.h
@@ -0,0 +1,34 @@
+$NetBSD: patch-src_llvm-project_llvm_include_llvm-c_DataTypes.h,v 1.8 2024/04/18 09:29:42 pin Exp $
+
+Don't implement sys/regset.h workaround, fix source instead.
+
+--- src/llvm-project/llvm/include/llvm-c/DataTypes.h.orig 2021-04-17 01:50:37.000000000 +0000
++++ src/llvm-project/llvm/include/llvm-c/DataTypes.h
+@@ -77,4 +77,27 @@ typedef signed int ssize_t;
+ # define UINT64_MAX 0xffffffffffffffffULL
+ #endif
+
++#if defined(__sun)
++#include <sys/regset.h>
++#undef CS
++#undef DS
++#undef ES
++#undef FS
++#undef GS
++#undef SS
++#undef EAX
++#undef ECX
++#undef EDX
++#undef EBX
++#undef ESP
++#undef EBP
++#undef ESI
++#undef EDI
++#undef EIP
++#undef UESP
++#undef EFL
++#undef ERR
++#undef TRAPNO
++#endif
++
+ #endif /* LLVM_C_DATATYPES_H */
diff --git a/rust199/patches/patch-src_llvm-project_llvm_include_llvm_Analysis_ConstantFolding.h b/rust199/patches/patch-src_llvm-project_llvm_include_llvm_Analysis_ConstantFolding.h
new file mode 100644
index 0000000000..bfde112a80
--- /dev/null
+++ b/rust199/patches/patch-src_llvm-project_llvm_include_llvm_Analysis_ConstantFolding.h
@@ -0,0 +1,18 @@
+$NetBSD: patch-src_llvm-project_llvm_include_llvm_Analysis_ConstantFolding.h,v 1.11 2026/01/13 20:48:23 wiz Exp $
+
+Fix SunOS CS conflict not handled by include/llvm-c/DataTypes.h
+
+--- src/llvm-project/llvm/include/llvm/Analysis/ConstantFolding.h.orig 2025-10-28 16:34:16.000000000 +0000
++++ src/llvm-project/llvm/include/llvm/Analysis/ConstantFolding.h
+@@ -20,6 +20,11 @@
+ #define LLVM_ANALYSIS_CONSTANTFOLDING_H
+
+ #include "llvm/Support/Compiler.h"
++
++#ifdef __sun
++#undef CS
++#endif
++
+ #include <stdint.h>
+
+ namespace llvm {
diff --git a/rust199/patches/patch-src_llvm-project_llvm_lib_TargetParser_TargetDataLayout.cpp b/rust199/patches/patch-src_llvm-project_llvm_lib_TargetParser_TargetDataLayout.cpp
new file mode 100644
index 0000000000..2a1d4fc527
--- /dev/null
+++ b/rust199/patches/patch-src_llvm-project_llvm_lib_TargetParser_TargetDataLayout.cpp
@@ -0,0 +1,74 @@
+$NetBSD$
+
+Fix alignment on NetBSD/m68k.
+This is also submitted upstream at
+https://github.com/llvm/llvm-project/pull/207602
+
+--- src/llvm-project/llvm/lib/TargetParser/TargetDataLayout.cpp.orig 2026-07-05 19:50:17.410753296 +0000
++++ src/llvm-project/llvm/lib/TargetParser/TargetDataLayout.cpp
+@@ -122,6 +122,17 @@ static std::string computeLoongArchDataL
+ return "e-m:e-p:32:32-i64:64-n32-S128";
+ }
+
++// The Linux m68k target uses the ABI used
++// by Sun Microsystems for the old a.out-based binaries: 16-bit
++// alignment of int/long/pointer.
++//
++// NetBSD/m68k on the other hand uses the SVR4 ABI, which
++// aligns int/long/pointer/objects/stack on 32-bit boundaries.
++//
++// For now we just fix this for NetBSD/m68k.
++//
++// Ref. https://github.com/llvm/llvm-project/issues/199826
++
+ static std::string computeM68kDataLayout(const Triple &TT) {
+ std::string Ret = "";
+ // M68k is Big Endian
+@@ -131,21 +142,35 @@ static std::string computeM68kDataLayout
+ Ret += "-m:e";
+
+ // M68k pointers are always 32 bit wide even for 16-bit CPUs.
+- // The ABI only specifies 16-bit alignment.
+- // On at least the 68020+ with a 32-bit bus, there is a performance benefit
+- // to having 32-bit alignment.
+- Ret += "-p:32:16:32";
+-
+- // Bytes do not require special alignment, words are word aligned and
+- // long words are word aligned at minimum.
+- Ret += "-i8:8:8-i16:16:16-i32:16:32";
++ if (! TT.isOSNetBSD()) {
++ // The ABI only specifies 16-bit alignment.
++ // On at least the 68020+ with a 32-bit bus, there is a performance benefit
++ // to having 32-bit alignment.
++ Ret += "-p:32:16:32";
++
++ // Bytes do not require special alignment, words are word aligned and
++ // long words are word aligned at minimum.
++ Ret += "-i8:8:8-i16:16:16-i32:16:32";
+
+- // FIXME no floats at the moment
++ // The registers can hold 8, 16, 32 bits
++ Ret += "-n8:16:32";
+
+- // The registers can hold 8, 16, 32 bits
+- Ret += "-n8:16:32";
++ Ret += "-a:0:16-S16";
++ } else {
++ // NetBSD/m68k aligns long/pointer/stack/objects on 32-bits,
++ // ref. comment above.
++ Ret += "-p:32:32:32";
++ // Bytes do not require special alignment,
++ // 16-bit ints are 16-bit aligned and
++ // 32-bit ints are 32-bit aligned
++ Ret += "-i8:8:8-i16:16:16-i32:32:32";
++ // The registers can hold 8, 16, 32 bits
++ Ret += "-n8:16:32";
++ // object and stack alignment is also 32 bits
++ Ret += "-a:0:32-S32";
++ }
+
+- Ret += "-a:0:16-S16";
++ // FIXME no floats at the moment
+
+ return Ret;
+ }
diff --git a/rust199/patches/patch-src_tools_cargo_src_workspace_profiles.rs b/rust199/patches/patch-src_tools_cargo_src_workspace_profiles.rs
new file mode 100644
index 0000000000..e40af8a179
--- /dev/null
+++ b/rust199/patches/patch-src_tools_cargo_src_workspace_profiles.rs
@@ -0,0 +1,17 @@
+$NetBSD$
+
+Turn off incremental builds for sparc64, ref.
+https://sources.debian.org/patches/cargo/0.29.0-1/2007_sparc64_disable_incremental_build.patch/
+
+--- src/tools/cargo/src/workspace/profiles.rs.orig 2026-10-01 18:13:16.227888121 +0000
++++ src/tools/cargo/src/workspace/profiles.rs
+@@ -732,6 +732,9 @@ impl Profile {
+ debuginfo: DebugInfo::Resolved(TomlDebugInfo::Full),
+ debug_assertions: true,
+ overflow_checks: true,
++ #[cfg(target_arch = "sparc64")]
++ incremental: false,
++ #[cfg(not(target_arch = "sparc64"))]
+ incremental: true,
+ ..Profile::default()
+ }
diff --git a/rust199/patches/patch-src_tools_cargo_tests_testsuite_build.rs b/rust199/patches/patch-src_tools_cargo_tests_testsuite_build.rs
new file mode 100644
index 0000000000..093afa591b
--- /dev/null
+++ b/rust199/patches/patch-src_tools_cargo_tests_testsuite_build.rs
@@ -0,0 +1,39 @@
+$NetBSD: patch-src_tools_cargo_tests_testsuite_build.rs,v 1.18 2025/08/25 17:51:12 wiz Exp $
+
+Don't attempt incremental operations on sparc64, ref.
+https://sources.debian.org/patches/cargo/0.29.0-1/2007_sparc64_disable_incremental_build.patch/
+
+--- src/tools/cargo/tests/testsuite/build.rs.orig 2025-01-27 23:20:59.000000000 +0000
++++ src/tools/cargo/tests/testsuite/build.rs
+@@ -41,6 +41,7 @@ i am foo
+ .run();
+ }
+
++#[cfg(not(target_arch = "sparc64"))]
+ #[cargo_test]
+ fn build_with_symlink_to_path_dependency_with_build_script_in_git() {
+ if !symlink_supported() {
+@@ -103,6 +104,7 @@ fn cargo_fail_with_no_stderr() {
+
+ /// Checks that the `CARGO_INCREMENTAL` environment variable results in
+ /// `rustc` getting `-C incremental` passed to it.
++#[cfg(not(target_arch = "sparc64"))]
+ #[cargo_test]
+ fn cargo_compile_incremental() {
+ let p = project()
+@@ -132,6 +134,7 @@ fn cargo_compile_incremental() {
+ .run();
+ }
+
++#[cfg(not(target_arch = "sparc64"))]
+ #[cargo_test]
+ fn incremental_profile() {
+ let p = project()
+@@ -175,6 +178,7 @@ fn incremental_profile() {
+ .run();
+ }
+
++#[cfg(not(target_arch = "sparc64"))]
+ #[cargo_test]
+ fn incremental_config() {
+ let p = project()
diff --git a/rust199/patches/patch-src_tools_rust-installer_install-template.sh b/rust199/patches/patch-src_tools_rust-installer_install-template.sh
new file mode 100644
index 0000000000..54aa9d1655
--- /dev/null
+++ b/rust199/patches/patch-src_tools_rust-installer_install-template.sh
@@ -0,0 +1,48 @@
+$NetBSD$
+
+No logging to 'install.log'.
+Do not create 'uninstall.sh'.
+Do not make file backups (filename.old), so these will not end up in the final package.
+
+--- src/tools/rust-installer/install-template.sh.orig 2026-05-29 09:40:07.274418028 +0000
++++ src/tools/rust-installer/install-template.sh
+@@ -6,20 +6,12 @@ set -u
+ init_logging() {
+ local _abs_libdir="$1"
+ local _logfile="$_abs_libdir/$TEMPLATE_REL_MANIFEST_DIR/install.log"
+- rm -f "$_logfile"
+- need_ok "failed to remove old installation log"
+- touch "$_logfile"
+- need_ok "failed to create installation log"
+ LOGFILE="$_logfile"
+ }
+
+ log_line() {
+ local _line="$1"
+
+- if [ -n "${LOGFILE-}" -a -e "${LOGFILE-}" ]; then
+- echo "$_line" >> "$LOGFILE"
+- # Ignore errors, which may happen e.g. after the manifest dir is deleted
+- fi
+ }
+
+ msg() {
+@@ -628,8 +620,6 @@ install_components() {
+
+ verbose_msg "copying directory $_file_install_path"
+
+- maybe_backup_path "$_file_install_path"
+-
+ run cp -R "$_src_dir/$_component/$_file" "$_file_install_path"
+ critical_need_ok "failed to copy directory"
+
+@@ -976,9 +966,6 @@ write_to_file "$TEMPLATE_RUST_INSTALLER_
+
+ critical_need_ok "failed to write installer version"
+
+-# Install the uninstaller
+-install_uninstaller "$src_dir" "$src_basename" "$abs_libdir"
+-
+ # Install each component
+ install_components "$src_dir" "$abs_libdir" "$dest_prefix" "$components"
+
diff --git a/rust199/patches/patch-tests_assembly-llvm_targets_targets-elf.rs b/rust199/patches/patch-tests_assembly-llvm_targets_targets-elf.rs
new file mode 100644
index 0000000000..84ce0e74eb
--- /dev/null
+++ b/rust199/patches/patch-tests_assembly-llvm_targets_targets-elf.rs
@@ -0,0 +1,16 @@
+$NetBSD: patch-tests_assembly-llvm_targets_targets-elf.rs,v 1.1 2025/10/18 17:14:35 he Exp $
+
+Fix test suite for mips64el-unknown-netbsd.
+
+--- tests/assembly-llvm/targets/targets-elf.rs.orig 2025-09-19 21:53:43.152938454 +0000
++++ tests/assembly-llvm/targets/targets-elf.rs
+@@ -301,6 +301,9 @@
+ //@ revisions: mips64el_unknown_linux_muslabi64
+ //@ [mips64el_unknown_linux_muslabi64] compile-flags: --target mips64el-unknown-linux-muslabi64
+ //@ [mips64el_unknown_linux_muslabi64] needs-llvm-components: mips
++//@ revisions: mips64el_unknown_netbsd
++//@ [mips64el_unknown_netbsd] compile-flags: --target mips64el_unknown_netbsd-unknown-linux-muslabi64
++//@ [mips64el_unknown_netbsd] needs-llvm-components: mips
+ //@ revisions: mips_unknown_linux_gnu
+ //@ [mips_unknown_linux_gnu] compile-flags: --target mips-unknown-linux-gnu
+ //@ [mips_unknown_linux_gnu] needs-llvm-components: mips
diff --git a/rust199/patches/patch-vendor_crossbeam-utils-0.8.20_no__atomic.rs b/rust199/patches/patch-vendor_crossbeam-utils-0.8.20_no__atomic.rs
new file mode 100644
index 0000000000..d0e3c3aad1
--- /dev/null
+++ b/rust199/patches/patch-vendor_crossbeam-utils-0.8.20_no__atomic.rs
@@ -0,0 +1,13 @@
+$NetBSD$
+
+Add NetBSD/mipsel to non-atomic targets.
+
+--- vendor/crossbeam-utils-0.8.20/no_atomic.rs.orig 2026-10-01 18:23:30.568570165 +0000
++++ vendor/crossbeam-utils-0.8.20/no_atomic.rs
+@@ -5,5 +5,6 @@ const NO_ATOMIC: &[&str] = &[
+ "bpfeb-unknown-none",
+ "bpfel-unknown-none",
+ "mipsel-sony-psx",
++ "mipsel-unknown-netbsd",
+ "msp430-none-elf",
+ ];
diff --git a/rust199/patches/patch-vendor_crossbeam-utils-0.8.21_no__atomic.rs b/rust199/patches/patch-vendor_crossbeam-utils-0.8.21_no__atomic.rs
new file mode 100644
index 0000000000..d420e6ac80
--- /dev/null
+++ b/rust199/patches/patch-vendor_crossbeam-utils-0.8.21_no__atomic.rs
@@ -0,0 +1,13 @@
+$NetBSD$
+
+Add NetBSD/mipsel to non-atomic targets.
+
+--- vendor/crossbeam-utils-0.8.21/no_atomic.rs.orig 2026-10-01 18:24:43.096581616 +0000
++++ vendor/crossbeam-utils-0.8.21/no_atomic.rs
+@@ -5,5 +5,6 @@ const NO_ATOMIC: &[&str] = &[
+ "bpfeb-unknown-none",
+ "bpfel-unknown-none",
+ "mipsel-sony-psx",
++ "mipsel-unknown-netbsd",
+ "msp430-none-elf",
+ ];
diff --git a/rust199/patches/patch-vendor_libc-0.2.155_src_unix_bsd_netbsdlike_netbsd_mod.rs b/rust199/patches/patch-vendor_libc-0.2.155_src_unix_bsd_netbsdlike_netbsd_mod.rs
new file mode 100644
index 0000000000..24c498026b
--- /dev/null
+++ b/rust199/patches/patch-vendor_libc-0.2.155_src_unix_bsd_netbsdlike_netbsd_mod.rs
@@ -0,0 +1,15 @@
+$NetBSD: patch-vendor_libc-0.2.155_src_unix_bsd_netbsdlike_netbsd_mod.rs,v 1.2 2025/08/25 17:51:12 wiz Exp $
+
+Apply https://github.com/rust-lang/libc/pull/4265/files
+to fix getmntinfo() from rust.
+
+--- vendor/libc-0.2.155/src/unix/bsd/netbsdlike/netbsd/mod.rs.orig 2025-02-14 14:04:45.438043897 +0000
++++ vendor/libc-0.2.155/src/unix/bsd/netbsdlike/netbsd/mod.rs
+@@ -3142,6 +3142,7 @@ cfg_if! {
+ if #[cfg(libc_union)] {
+ extern {
+ // these functions use statvfs:
++ #[link_name = "__getmntinfo13"]
+ pub fn getmntinfo(mntbufp: *mut *mut ::statvfs, flags: ::c_int) -> ::c_int;
+ pub fn getvfsstat(buf: *mut statvfs, bufsize: ::size_t, flags: ::c_int) -> ::c_int;
+ }
diff --git a/rust199/patches/patch-vendor_libc-0.2.155_src_unix_solarish_mod.rs b/rust199/patches/patch-vendor_libc-0.2.155_src_unix_solarish_mod.rs
new file mode 100644
index 0000000000..276db25e8c
--- /dev/null
+++ b/rust199/patches/patch-vendor_libc-0.2.155_src_unix_solarish_mod.rs
@@ -0,0 +1,15 @@
+$NetBSD: patch-vendor_libc-0.2.155_src_unix_solarish_mod.rs,v 1.5 2025/10/18 17:14:35 he Exp $
+
+Fix xattr build.
+
+--- vendor/libc-0.2.155/src/unix/solarish/mod.rs.orig 2024-08-29 18:03:17.866520790 +0000
++++ vendor/libc-0.2.155/src/unix/solarish/mod.rs
+@@ -1524,6 +1524,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;
diff --git a/rust199/patches/patch-vendor_libc-0.2.168_src_unix_bsd_netbsdlike_netbsd_mod.rs b/rust199/patches/patch-vendor_libc-0.2.168_src_unix_bsd_netbsdlike_netbsd_mod.rs
new file mode 100644
index 0000000000..b33dd8a12f
--- /dev/null
+++ b/rust199/patches/patch-vendor_libc-0.2.168_src_unix_bsd_netbsdlike_netbsd_mod.rs
@@ -0,0 +1,15 @@
+$NetBSD: patch-vendor_libc-0.2.168_src_unix_bsd_netbsdlike_netbsd_mod.rs,v 1.3 2026/01/13 20:48:23 wiz Exp $
+
+Apply https://github.com/rust-lang/libc/pull/4265/files
+to fix getmntinfo() from rust.
+
+--- vendor/libc-0.2.168/src/unix/bsd/netbsdlike/netbsd/mod.rs.orig 2025-04-05 11:35:20.818765987 +0000
++++ vendor/libc-0.2.168/src/unix/bsd/netbsdlike/netbsd/mod.rs
+@@ -2850,6 +2850,7 @@ extern "C" {
+ hint: *const c_void,
+ ) -> c_int;
+
++ #[link_name = "__getmntinfo13"]
+ pub fn getmntinfo(mntbufp: *mut *mut crate::statvfs, flags: c_int) -> c_int;
+ pub fn getvfsstat(buf: *mut statvfs, bufsize: size_t, flags: c_int) -> c_int;
+ }
diff --git a/rust199/patches/patch-vendor_libc-0.2.168_src_unix_bsd_netbsdlike_netbsd_riscv64.rs b/rust199/patches/patch-vendor_libc-0.2.168_src_unix_bsd_netbsdlike_netbsd_riscv64.rs
new file mode 100644
index 0000000000..15a6cff36f
--- /dev/null
+++ b/rust199/patches/patch-vendor_libc-0.2.168_src_unix_bsd_netbsdlike_netbsd_riscv64.rs
@@ -0,0 +1,44 @@
+$NetBSD: patch-vendor_libc-0.2.168_src_unix_bsd_netbsdlike_netbsd_riscv64.rs,v 1.1 2025/08/25 17:51:12 wiz Exp $
+
+Unbreak this module.
+
+I admit to this entirely being based on "cargo cult", but at least
+the rust compiler (cross-)builds for NetBSD/risc64 with this,
+whereas it did not earlier.
+
+--- vendor/libc-0.2.168/src/unix/bsd/netbsdlike/netbsd/riscv64.rs.orig 2025-06-28 07:45:40.263146414 +0000
++++ vendor/libc-0.2.168/src/unix/bsd/netbsdlike/netbsd/riscv64.rs
+@@ -1,4 +1,4 @@
+-use PT_FIRSTMACH;
++use crate::PT_FIRSTMACH;
+
+ use crate::prelude::*;
+
+@@ -8,21 +8,18 @@ pub type c_char = u8;
+ pub type __greg_t = u64;
+ pub type __cpu_simple_lock_nv_t = c_int;
+ pub type __gregset = [__greg_t; _NGREG];
+-pub type __fregset = [__freg; _NFREG];
+-
+-s! {
+- pub struct mcontext_t {
+- pub __gregs: __gregset,
+- pub __fregs: __fpregset,
+- __spare: [crate::__greg_t; 7],
+- }
+-}
++pub type __fregset = [__fpreg; _NFREG];
+
+ s_no_extra_traits! {
+ pub union __fpreg {
+ pub u_u64: u64,
+ pub u_d: c_double,
+ }
++ pub struct mcontext_t {
++ pub __gregs: __gregset,
++ pub __fregs: __fregset,
++ __spare: [crate::__greg_t; 7],
++ }
+ }
+
+ pub(crate) const _ALIGNBYTES: usize = mem::size_of::<c_long>() - 1;
diff --git a/rust199/patches/patch-vendor_libc-0.2.168_src_unix_solarish_mod.rs b/rust199/patches/patch-vendor_libc-0.2.168_src_unix_solarish_mod.rs
new file mode 100644
index 0000000000..ea6a93fe86
--- /dev/null
+++ b/rust199/patches/patch-vendor_libc-0.2.168_src_unix_solarish_mod.rs
@@ -0,0 +1,15 @@
+$NetBSD: patch-vendor_libc-0.2.168_src_unix_solarish_mod.rs,v 1.4 2025/10/18 17:14:35 he Exp $
+
+Fix xattr build.
+
+--- vendor/libc-0.2.168/src/unix/solarish/mod.rs.orig 2025-04-05 11:37:41.783212722 +0000
++++ vendor/libc-0.2.168/src/unix/solarish/mod.rs
+@@ -1421,6 +1421,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;
diff --git a/rust199/patches/patch-vendor_libc-0.2.169_src_unix_bsd_netbsdlike_netbsd_mod.rs b/rust199/patches/patch-vendor_libc-0.2.169_src_unix_bsd_netbsdlike_netbsd_mod.rs
new file mode 100644
index 0000000000..b4de45f7bb
--- /dev/null
+++ b/rust199/patches/patch-vendor_libc-0.2.169_src_unix_bsd_netbsdlike_netbsd_mod.rs
@@ -0,0 +1,15 @@
+$NetBSD: patch-vendor_libc-0.2.169_src_unix_bsd_netbsdlike_netbsd_mod.rs,v 1.2 2025/08/25 17:51:12 wiz Exp $
+
+Apply https://github.com/rust-lang/libc/pull/4265/files
+to fix getmntinfo() from rust.
+
+--- vendor/libc-0.2.169/src/unix/bsd/netbsdlike/netbsd/mod.rs.orig 2025-02-14 14:04:45.438043897 +0000
++++ vendor/libc-0.2.169/src/unix/bsd/netbsdlike/netbsd/mod.rs
+@@ -2850,6 +2850,7 @@ extern "C" {
+ hint: *const c_void,
+ ) -> c_int;
+
++ #[link_name = "__getmntinfo13"]
+ pub fn getmntinfo(mntbufp: *mut *mut crate::statvfs, flags: c_int) -> c_int;
+ pub fn getvfsstat(buf: *mut statvfs, bufsize: size_t, flags: c_int) -> c_int;
+ }
diff --git a/rust199/patches/patch-vendor_libc-0.2.169_src_unix_bsd_netbsdlike_netbsd_riscv64.rs b/rust199/patches/patch-vendor_libc-0.2.169_src_unix_bsd_netbsdlike_netbsd_riscv64.rs
new file mode 100644
index 0000000000..30d1f3d440
--- /dev/null
+++ b/rust199/patches/patch-vendor_libc-0.2.169_src_unix_bsd_netbsdlike_netbsd_riscv64.rs
@@ -0,0 +1,90 @@
+$NetBSD: patch-vendor_libc-0.2.169_src_unix_bsd_netbsdlike_netbsd_riscv64.rs,v 1.2 2025/08/25 17:51:12 wiz Exp $
+
+Unbreak this module.
+
+I admit to this entirely being based on "cargo cult", but at least
+the rust compiler (cross-)builds for NetBSD/risc64 with this,
+whereas it did not earlier.
+
+--- vendor/libc-0.2.169/src/unix/bsd/netbsdlike/netbsd/riscv64.rs.orig 2025-02-24 07:49:42.565876506 +0000
++++ vendor/libc-0.2.169/src/unix/bsd/netbsdlike/netbsd/riscv64.rs
+@@ -1,4 +1,4 @@
+-use PT_FIRSTMACH;
++use crate::PT_FIRSTMACH;
+
+ use crate::prelude::*;
+
+@@ -8,20 +8,66 @@ pub type c_char = u8;
+ pub type __greg_t = u64;
+ pub type __cpu_simple_lock_nv_t = c_int;
+ pub type __gregset = [__greg_t; _NGREG];
+-pub type __fregset = [__freg; _NFREG];
++pub type __fregset = [__fpreg; _NFREG];
+
+-s! {
++s_no_extra_traits! {
++ pub union __fpreg {
++ #[cfg(libc_union)]
++ pub u_u64: u64,
++ pub u_d: c_double,
++ }
+ pub struct mcontext_t {
+ pub __gregs: __gregset,
+- pub __fregs: __fpregset,
++ pub __fregs: __fregset,
+ __spare: [crate::__greg_t; 7],
+ }
+ }
+
+-s_no_extra_traits! {
+- pub union __fpreg {
+- pub u_u64: u64,
+- pub u_d: c_double,
++cfg_if! {
++ if #[cfg(feature = "extra_traits")] {
++// use ::self::fmt;
++// use ::self::hash;
++ use core::marker::Copy;
++ use core::clone::Clone;
++ #[cfg(libc_union)]
++ impl PartialEq for __fpreg {
++ fn eq(&self, other: &__fpreg) -> bool {
++ unsafe {
++ self.u_64 == other.u_64
++ || self.u_d == other.u_d
++ }
++ }
++ }
++ #[cfg(libc_union)]
++ impl Eq for __fpreg {}
++ #[cfg(libc_union)]
++ impl ::fmt::Debug for __fpreg {
++ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
++ unsafe {
++ f.debug_struct("__fpreg")
++ .field("u_u64", &self.u_64)
++ .field("u_d", &self.u_d)
++ .finish()
++ }
++ }
++ }
++ #[cfg(libc_union)]
++ impl ::hash::Hash for __fpreg {
++ fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
++ unsafe {
++ self.u_64.hash(state);
++ self.u_d.hash(state);
++ }
++ }
++ }
++ #[cfg(libc_union)]
++ impl ::Copy for __fpreg {}
++ #[cfg(libc_union)]
++ impl ::Clone for __fpreg {
++ fn clone(&self) -> __fpreg {
++ *self
++ }
++ }
+ }
+ }
+
diff --git a/rust199/patches/patch-vendor_libc-0.2.169_src_unix_solarish_mod.rs b/rust199/patches/patch-vendor_libc-0.2.169_src_unix_solarish_mod.rs
new file mode 100644
index 0000000000..f1ea8dc605
--- /dev/null
+++ b/rust199/patches/patch-vendor_libc-0.2.169_src_unix_solarish_mod.rs
@@ -0,0 +1,15 @@
+$NetBSD: patch-vendor_libc-0.2.169_src_unix_solarish_mod.rs,v 1.5 2025/10/18 17:14:35 he Exp $
+
+Fix xattr build.
+
+--- vendor/libc-0.2.169/src/unix/solarish/mod.rs.orig 2024-08-29 18:03:17.866520790 +0000
++++ vendor/libc-0.2.169/src/unix/solarish/mod.rs
+@@ -1421,6 +1421,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;
diff --git a/rust199/patches/patch-vendor_libc-0.2.172_src_unix_bsd_netbsdlike_netbsd_riscv64.rs b/rust199/patches/patch-vendor_libc-0.2.172_src_unix_bsd_netbsdlike_netbsd_riscv64.rs
new file mode 100644
index 0000000000..208337cf90
--- /dev/null
+++ b/rust199/patches/patch-vendor_libc-0.2.172_src_unix_bsd_netbsdlike_netbsd_riscv64.rs
@@ -0,0 +1,89 @@
+$NetBSD: patch-vendor_libc-0.2.172_src_unix_bsd_netbsdlike_netbsd_riscv64.rs,v 1.1 2025/08/25 17:51:13 wiz Exp $
+
+Unbreak this module.
+
+I admit to this entirely being based on "cargo cult", but at least
+the rust compiler (cross-)builds for NetBSD/risc64 with this,
+whereas it did not earlier.
+
+--- vendor/libc-0.2.172/src/unix/bsd/netbsdlike/netbsd/riscv64.rs.orig 2025-06-28 07:50:50.001313003 +0000
++++ vendor/libc-0.2.172/src/unix/bsd/netbsdlike/netbsd/riscv64.rs
+@@ -1,24 +1,70 @@
+-use PT_FIRSTMACH;
++use crate::PT_FIRSTMACH;
+
+ use crate::prelude::*;
+
+ pub type __greg_t = u64;
+ pub type __cpu_simple_lock_nv_t = c_int;
+ pub type __gregset = [__greg_t; _NGREG];
+-pub type __fregset = [__freg; _NFREG];
++pub type __fregset = [__fpreg; _NFREG];
+
+-s! {
++s_no_extra_traits! {
++ pub union __fpreg {
++ #[cfg(libc_union)]
++ pub u_u64: u64,
++ pub u_d: c_double,
++ }
+ pub struct mcontext_t {
+ pub __gregs: __gregset,
+- pub __fregs: __fpregset,
++ pub __fregs: __fregset,
+ __spare: [crate::__greg_t; 7],
+ }
+ }
+
+-s_no_extra_traits! {
+- pub union __fpreg {
+- pub u_u64: u64,
+- pub u_d: c_double,
++cfg_if! {
++ if #[cfg(feature = "extra_traits")] {
++// use ::self::fmt;
++// use ::self::hash;
++ use core::marker::Copy;
++ use core::clone::Clone;
++ #[cfg(libc_union)]
++ impl PartialEq for __fpreg {
++ fn eq(&self, other: &__fpreg) -> bool {
++ unsafe {
++ self.u_64 == other.u_64
++ || self.u_d == other.u_d
++ }
++ }
++ }
++ #[cfg(libc_union)]
++ impl Eq for __fpreg {}
++ #[cfg(libc_union)]
++ impl ::fmt::Debug for __fpreg {
++ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
++ unsafe {
++ f.debug_struct("__fpreg")
++ .field("u_u64", &self.u_64)
++ .field("u_d", &self.u_d)
++ .finish()
++ }
++ }
++ }
++ #[cfg(libc_union)]
++ impl ::hash::Hash for __fpreg {
++ fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
++ unsafe {
++ self.u_64.hash(state);
++ self.u_d.hash(state);
++ }
++ }
++ }
++ #[cfg(libc_union)]
++ impl ::Copy for __fpreg {}
++ #[cfg(libc_union)]
++ impl ::Clone for __fpreg {
++ fn clone(&self) -> __fpreg {
++ *self
++ }
++ }
+ }
+ }
+
diff --git a/rust199/patches/patch-vendor_libc-0.2.172_src_unix_solarish_mod.rs b/rust199/patches/patch-vendor_libc-0.2.172_src_unix_solarish_mod.rs
new file mode 100644
index 0000000000..293aaab7fa
--- /dev/null
+++ b/rust199/patches/patch-vendor_libc-0.2.172_src_unix_solarish_mod.rs
@@ -0,0 +1,15 @@
+$NetBSD: patch-vendor_libc-0.2.172_src_unix_solarish_mod.rs,v 1.4 2025/10/21 08:54:19 jperkin Exp $
+
+Fix xattr build.
+
+--- vendor/libc-0.2.172/src/unix/solarish/mod.rs.orig 2025-06-28 07:52:15.632394747 +0000
++++ vendor/libc-0.2.172/src/unix/solarish/mod.rs
+@@ -1421,6 +1421,8 @@ pub const EBFONT: c_int = 57;
+ pub const EOWNERDEAD: c_int = 58;
+ pub const ENOTRECOVERABLE: c_int = 59;
+ pub const ENOSTR: c_int = 60;
++// This is not supported but is required for xattr
++pub const ENOATTR: c_int = ENODATA;
+ pub const ENODATA: c_int = 61;
+ pub const ETIME: c_int = 62;
+ pub const ENOSR: c_int = 63;
diff --git a/rust199/patches/patch-vendor_libc-0.2.183_src_unix_bsd_netbsdlike_netbsd_m68k.rs b/rust199/patches/patch-vendor_libc-0.2.183_src_unix_bsd_netbsdlike_netbsd_m68k.rs
new file mode 100644
index 0000000000..7cfcdcb431
--- /dev/null
+++ b/rust199/patches/patch-vendor_libc-0.2.183_src_unix_bsd_netbsdlike_netbsd_m68k.rs
@@ -0,0 +1,17 @@
+$NetBSD: patch-vendor_libc-0.2.180_src_unix_bsd_netbsdlike_netbsd_m68k.rs,v 1.1 2026/05/07 13:16:15 wiz Exp $
+
+Add cpu-specific file for m68k on NetBSD.
+
+--- /dev/null 2026-04-16 15:19:59.503167932 +0000
++++ vendor/libc-0.2.183/src/unix/bsd/netbsdlike/netbsd/m68k.rs 2026-04-16 15:19:11.760619011 +0000
+@@ -0,0 +1,10 @@
++use crate::prelude::*;
++use crate::PT_FIRSTMACH;
++
++pub type __cpu_simple_lock_nv_t = u8;
++
++pub(crate) const _ALIGNBYTES: usize = size_of::<c_int>() - 1;
++
++pub const PT_STEP: c_int = PT_FIRSTMACH + 0;
++pub const PT_GETREGS: c_int = PT_FIRSTMACH + 1;
++pub const PT_SETREGS: c_int = PT_FIRSTMACH + 2;
diff --git a/rust199/patches/patch-vendor_libc-0.2.183_src_unix_bsd_netbsdlike_netbsd_mod.rs b/rust199/patches/patch-vendor_libc-0.2.183_src_unix_bsd_netbsdlike_netbsd_mod.rs
new file mode 100644
index 0000000000..3ca62878d2
--- /dev/null
+++ b/rust199/patches/patch-vendor_libc-0.2.183_src_unix_bsd_netbsdlike_netbsd_mod.rs
@@ -0,0 +1,16 @@
+$NetBSD: patch-vendor_libc-0.2.180_src_unix_bsd_netbsdlike_netbsd_mod.rs,v 1.1 2026/05/07 13:16:15 wiz Exp $
+
+Add m68k target.
+
+--- vendor/libc-0.2.183/src/unix/bsd/netbsdlike/netbsd/mod.rs.orig 2026-04-16 15:19:35.521206884 +0000
++++ vendor/libc-0.2.183/src/unix/bsd/netbsdlike/netbsd/mod.rs
+@@ -2442,6 +2442,9 @@ cfg_if! {
+ } else if #[cfg(target_arch = "riscv64")] {
+ mod riscv64;
+ pub use self::riscv64::*;
++ } else if #[cfg(target_arch = "m68k")] {
++ mod m68k;
++ pub use self::m68k::*;
+ } else {
+ // Unknown target_arch
+ }
diff --git a/rust199/patches/patch-vendor_libc-0.2.184_src_unix_bsd_netbsdlike_netbsd_m68k.rs b/rust199/patches/patch-vendor_libc-0.2.184_src_unix_bsd_netbsdlike_netbsd_m68k.rs
new file mode 100644
index 0000000000..3b497f33de
--- /dev/null
+++ b/rust199/patches/patch-vendor_libc-0.2.184_src_unix_bsd_netbsdlike_netbsd_m68k.rs
@@ -0,0 +1,17 @@
+$NetBSD: patch-vendor_libc-0.2.180_src_unix_bsd_netbsdlike_netbsd_m68k.rs,v 1.1 2026/05/07 13:16:15 wiz Exp $
+
+Add cpu-specific file for m68k on NetBSD.
+
+--- /dev/null 2026-04-16 15:19:59.503167932 +0000
++++ vendor/libc-0.2.184/src/unix/bsd/netbsdlike/netbsd/m68k.rs 2026-04-16 15:19:11.760619011 +0000
+@@ -0,0 +1,10 @@
++use crate::prelude::*;
++use crate::PT_FIRSTMACH;
++
++pub type __cpu_simple_lock_nv_t = u8;
++
++pub(crate) const _ALIGNBYTES: usize = size_of::<c_int>() - 1;
++
++pub const PT_STEP: c_int = PT_FIRSTMACH + 0;
++pub const PT_GETREGS: c_int = PT_FIRSTMACH + 1;
++pub const PT_SETREGS: c_int = PT_FIRSTMACH + 2;
diff --git a/rust199/patches/patch-vendor_libc-0.2.184_src_unix_bsd_netbsdlike_netbsd_mod.rs b/rust199/patches/patch-vendor_libc-0.2.184_src_unix_bsd_netbsdlike_netbsd_mod.rs
new file mode 100644
index 0000000000..888474f5fd
--- /dev/null
+++ b/rust199/patches/patch-vendor_libc-0.2.184_src_unix_bsd_netbsdlike_netbsd_mod.rs
@@ -0,0 +1,16 @@
+$NetBSD: patch-vendor_libc-0.2.180_src_unix_bsd_netbsdlike_netbsd_mod.rs,v 1.1 2026/05/07 13:16:15 wiz Exp $
+
+Add m68k target.
+
+--- vendor/libc-0.2.180/src/unix/bsd/netbsdlike/netbsd/mod.rs.orig 2026-04-16 15:19:35.521206884 +0000
++++ vendor/libc-0.2.184/src/unix/bsd/netbsdlike/netbsd/mod.rs
+@@ -2442,6 +2442,9 @@ cfg_if! {
+ } else if #[cfg(target_arch = "riscv64")] {
+ mod riscv64;
+ pub use self::riscv64::*;
++ } else if #[cfg(target_arch = "m68k")] {
++ mod m68k;
++ pub use self::m68k::*;
+ } else {
+ // Unknown target_arch
+ }
diff --git a/rust199/patches/patch-vendor_libc-0.2.186_src_unix_bsd_netbsdlike_netbsd_m68k.rs b/rust199/patches/patch-vendor_libc-0.2.186_src_unix_bsd_netbsdlike_netbsd_m68k.rs
new file mode 100644
index 0000000000..02c634ce14
--- /dev/null
+++ b/rust199/patches/patch-vendor_libc-0.2.186_src_unix_bsd_netbsdlike_netbsd_m68k.rs
@@ -0,0 +1,17 @@
+$NetBSD: patch-vendor_libc-0.2.180_src_unix_bsd_netbsdlike_netbsd_m68k.rs,v 1.1 2026/05/07 13:16:15 wiz Exp $
+
+Add cpu-specific file for m68k on NetBSD.
+
+--- /dev/null 2026-04-16 15:19:59.503167932 +0000
++++ vendor/libc-0.2.186/src/unix/bsd/netbsdlike/netbsd/m68k.rs 2026-04-16 15:19:11.760619011 +0000
+@@ -0,0 +1,10 @@
++use crate::prelude::*;
++use crate::PT_FIRSTMACH;
++
++pub type __cpu_simple_lock_nv_t = u8;
++
++pub(crate) const _ALIGNBYTES: usize = size_of::<c_int>() - 1;
++
++pub const PT_STEP: c_int = PT_FIRSTMACH + 0;
++pub const PT_GETREGS: c_int = PT_FIRSTMACH + 1;
++pub const PT_SETREGS: c_int = PT_FIRSTMACH + 2;
diff --git a/rust199/patches/patch-vendor_libc-0.2.186_src_unix_bsd_netbsdlike_netbsd_mod.rs b/rust199/patches/patch-vendor_libc-0.2.186_src_unix_bsd_netbsdlike_netbsd_mod.rs
new file mode 100644
index 0000000000..4225ee8ee5
--- /dev/null
+++ b/rust199/patches/patch-vendor_libc-0.2.186_src_unix_bsd_netbsdlike_netbsd_mod.rs
@@ -0,0 +1,16 @@
+$NetBSD: patch-vendor_libc-0.2.180_src_unix_bsd_netbsdlike_netbsd_mod.rs,v 1.1 2026/05/07 13:16:15 wiz Exp $
+
+Add m68k target.
+
+--- vendor/libc-0.2.186/src/unix/bsd/netbsdlike/netbsd/mod.rs.orig 2026-04-16 15:19:35.521206884 +0000
++++ vendor/libc-0.2.186/src/unix/bsd/netbsdlike/netbsd/mod.rs
+@@ -2442,6 +2442,9 @@ cfg_if! {
+ } else if #[cfg(target_arch = "riscv64")] {
+ mod riscv64;
+ pub use self::riscv64::*;
++ } else if #[cfg(target_arch = "m68k")] {
++ mod m68k;
++ pub use self::m68k::*;
+ } else {
+ // Unknown target_arch
+ }
diff --git a/rust199/patches/patch-vendor_libc-0.2.189_src_unix_bsd_netbsdlike_netbsd_m68k.rs b/rust199/patches/patch-vendor_libc-0.2.189_src_unix_bsd_netbsdlike_netbsd_m68k.rs
new file mode 100644
index 0000000000..03c412fd4b
--- /dev/null
+++ b/rust199/patches/patch-vendor_libc-0.2.189_src_unix_bsd_netbsdlike_netbsd_m68k.rs
@@ -0,0 +1,17 @@
+$NetBSD: patch-vendor_libc-0.2.180_src_unix_bsd_netbsdlike_netbsd_m68k.rs,v 1.1 2026/05/07 13:16:15 wiz Exp $
+
+Add cpu-specific file for m68k on NetBSD.
+
+--- /dev/null 2026-04-16 15:19:59.503167932 +0000
++++ vendor/libc-0.2.189/src/unix/bsd/netbsdlike/netbsd/m68k.rs 2026-04-16 15:19:11.760619011 +0000
+@@ -0,0 +1,10 @@
++use crate::prelude::*;
++use crate::PT_FIRSTMACH;
++
++pub type __cpu_simple_lock_nv_t = u8;
++
++pub(crate) const _ALIGNBYTES: usize = size_of::<c_int>() - 1;
++
++pub const PT_STEP: c_int = PT_FIRSTMACH + 0;
++pub const PT_GETREGS: c_int = PT_FIRSTMACH + 1;
++pub const PT_SETREGS: c_int = PT_FIRSTMACH + 2;
diff --git a/rust199/patches/patch-vendor_libc-0.2.189_src_unix_bsd_netbsdlike_netbsd_mod.rs b/rust199/patches/patch-vendor_libc-0.2.189_src_unix_bsd_netbsdlike_netbsd_mod.rs
new file mode 100644
index 0000000000..6bc04b02eb
--- /dev/null
+++ b/rust199/patches/patch-vendor_libc-0.2.189_src_unix_bsd_netbsdlike_netbsd_mod.rs
@@ -0,0 +1,16 @@
+$NetBSD$
+
+Add m68k target.
+
+--- vendor/libc-0.2.189/src/unix/bsd/netbsdlike/netbsd/mod.rs.orig 2026-10-01 18:49:00.826338650 +0000
++++ vendor/libc-0.2.189/src/unix/bsd/netbsdlike/netbsd/mod.rs
+@@ -2487,6 +2487,9 @@ cfg_if! {
+ } else if #[cfg(target_arch = "riscv64")] {
+ mod riscv64;
+ pub use self::riscv64::*;
++ } else if #[cfg(target_arch = "m68k")] {
++ mod m68k;
++ pub use self::m68k::*;
+ } else {
+ // Unknown target_arch
+ }
diff --git a/rust199/patches/patch-vendor_line-index-0.1.2_src_lib.rs b/rust199/patches/patch-vendor_line-index-0.1.2_src_lib.rs
new file mode 100644
index 0000000000..df65062259
--- /dev/null
+++ b/rust199/patches/patch-vendor_line-index-0.1.2_src_lib.rs
@@ -0,0 +1,42 @@
+$NetBSD: patch-vendor_line-index-0.1.2_src_lib.rs,v 1.2 2025/08/25 17:51:13 wiz Exp $
+
+Do not attempt use of neon extension in big-endian mode.
+
+--- vendor/line-index-0.1.2/src/lib.rs.orig 2025-02-03 07:59:39.771200202 +0000
++++ vendor/line-index-0.1.2/src/lib.rs
+@@ -235,7 +235,7 @@ fn analyze_source_file_dispatch(
+ }
+ }
+
+-#[cfg(target_arch = "aarch64")]
++#[cfg(all(target_arch = "aarch64", target_endian = "little"))]
+ fn analyze_source_file_dispatch(
+ src: &str,
+ lines: &mut Vec<TextSize>,
+@@ -347,7 +347,7 @@ unsafe fn analyze_source_file_sse2(
+ }
+
+ #[target_feature(enable = "neon")]
+-#[cfg(target_arch = "aarch64")]
++#[cfg(all(target_arch = "aarch64", target_endian = "little"))]
+ #[inline]
+ // See https://community.arm.com/arm-community-blogs/b/infrastructure-solutions-blog/posts/porting-x86-vector-bitmask-optimizations-to-arm-neon
+ //
+@@ -362,7 +362,7 @@ unsafe fn move_mask(v: std::arch::aarch6
+ }
+
+ #[target_feature(enable = "neon")]
+-#[cfg(target_arch = "aarch64")]
++#[cfg(all(target_arch = "aarch64", target_endian = "little"))]
+ unsafe fn analyze_source_file_neon(
+ src: &str,
+ lines: &mut Vec<TextSize>,
+@@ -441,7 +441,7 @@ unsafe fn analyze_source_file_neon(
+ }
+ }
+
+-#[cfg(not(any(target_arch = "x86", target_arch = "x86_64", target_arch = "aarch64")))]
++#[cfg(not(any(target_arch = "x86", target_arch = "x86_64", all(target_arch = "aarch64", target_endian = "little"))))]
+ // The target (or compiler version) does not support SSE2 ...
+ fn analyze_source_file_dispatch(
+ src: &str,
diff --git a/rust199/patches/patch-vendor_lzma-sys-0.1.20_config.h b/rust199/patches/patch-vendor_lzma-sys-0.1.20_config.h
new file mode 100644
index 0000000000..e2824c4f23
--- /dev/null
+++ b/rust199/patches/patch-vendor_lzma-sys-0.1.20_config.h
@@ -0,0 +1,25 @@
+$NetBSD: patch-vendor_lzma-sys-0.1.20_config.h,v 1.2 2025/08/25 17:51:13 wiz Exp $
+
+clock_gettime() is available also on NetBSD.
+
+This takes care of this build error:
+
+ cargo:warning=xz-5.2/src/common/mythread.h: In function 'mythread_condtime_set':
+ cargo:warning=xz-5.2/src/common/mythread.h:312:9: error: implicit declaration of function 'gettimeofday' [-Wimplicit-function-declaration]
+ cargo:warning= 312 | gettimeofday(&now, NULL);
+ cargo:warning= | ^~~~~~~~~~~~
+
+which popped up when switching powerpc to using gcc14, but strangely
+was not triggered by gcc12 or in-tree gcc.
+
+--- vendor/lzma-sys-0.1.20/config.h.orig 2025-02-11 23:15:56.129312069 +0000
++++ vendor/lzma-sys-0.1.20/config.h
+@@ -39,7 +39,7 @@
+ #define MYTHREAD_POSIX 1
+ #endif
+
+-#if defined(__sun)
++#if defined(__sun) || defined(__NetBSD__)
+ #define HAVE_CLOCK_GETTIME 1
+ #define HAVE_DECL_CLOCK_MONOTONIC 1
+ #endif
diff --git a/rust199/patches/patch-vendor_memchr-2.7.2_src_vector.rs b/rust199/patches/patch-vendor_memchr-2.7.2_src_vector.rs
new file mode 100644
index 0000000000..3f4e734a81
--- /dev/null
+++ b/rust199/patches/patch-vendor_memchr-2.7.2_src_vector.rs
@@ -0,0 +1,34 @@
+$NetBSD$
+
+Apply fix for big-endian aarch64 from
+https://github.com/BurntSushi/memchr/pull/222
+
+--- vendor/memchr-2.7.2/src/vector.rs.orig 2026-07-14 15:13:08.000000000 +0000
++++ vendor/memchr-2.7.2/src/vector.rs
+@@ -324,6 +324,7 @@ mod aarch64neon {
+ }
+
+ #[inline(always)]
++ #[cfg(target_endian = "little")]
+ unsafe fn movemask(self) -> NeonMoveMask {
+ let asu16s = vreinterpretq_u16_u8(self);
+ let mask = vshrn_n_u16(asu16s, 4);
+@@ -333,6 +334,18 @@ mod aarch64neon {
+ }
+
+ #[inline(always)]
++ #[cfg(target_endian = "big")]
++ unsafe fn movemask(self) -> NeonMoveMask {
++ // Swap the endianness of each 16-bit input.
++ let asu16s = vreinterpretq_u16_u8(vrev16q_u8(self));
++ let mask = vshrn_n_u16(asu16s, 4);
++ let asu64 = vreinterpret_u64_u8(mask);
++ // Use `swap_bytes` to swap the endianness of the 64-bit output.
++ let scalar64 = vget_lane_u64(asu64, 0).swap_bytes();
++ NeonMoveMask(scalar64 & 0x8888888888888888)
++ }
++
++ #[inline(always)]
+ unsafe fn cmpeq(self, vector2: Self) -> uint8x16_t {
+ vceqq_u8(self, vector2)
+ }
diff --git a/rust199/patches/patch-vendor_memchr-2.7.4_src_vector.rs b/rust199/patches/patch-vendor_memchr-2.7.4_src_vector.rs
new file mode 100644
index 0000000000..c4495179a3
--- /dev/null
+++ b/rust199/patches/patch-vendor_memchr-2.7.4_src_vector.rs
@@ -0,0 +1,34 @@
+$NetBSD: patch-vendor_memchr-2.7.4_src_vector.rs,v 1.3 2025/08/25 17:51:13 wiz Exp $
+
+Apply fix for big-endian aarch64 from
+https://github.com/BurntSushi/memchr/pull/222
+
+--- vendor/memchr-2.7.4/src/vector.rs.orig 2024-09-22 14:16:06.473207292 +0000
++++ vendor/memchr-2.7.4/src/vector.rs
+@@ -319,6 +319,7 @@ mod aarch64neon {
+ }
+
+ #[inline(always)]
++ #[cfg(target_endian = "little")]
+ unsafe fn movemask(self) -> NeonMoveMask {
+ let asu16s = vreinterpretq_u16_u8(self);
+ let mask = vshrn_n_u16(asu16s, 4);
+@@ -328,6 +329,18 @@ mod aarch64neon {
+ }
+
+ #[inline(always)]
++ #[cfg(target_endian = "big")]
++ unsafe fn movemask(self) -> NeonMoveMask {
++ // Swap the endianness of each 16-bit input.
++ let asu16s = vreinterpretq_u16_u8(vrev16q_u8(self));
++ let mask = vshrn_n_u16(asu16s, 4);
++ let asu64 = vreinterpret_u64_u8(mask);
++ // Use `swap_bytes` to swap the endianness of the 64-bit output.
++ let scalar64 = vget_lane_u64(asu64, 0).swap_bytes();
++ NeonMoveMask(scalar64 & 0x8888888888888888)
++ }
++
++ #[inline(always)]
+ unsafe fn cmpeq(self, vector2: Self) -> uint8x16_t {
+ vceqq_u8(self, vector2)
+ }
diff --git a/rust199/patches/patch-vendor_memchr-2.7.5_src_vector.rs b/rust199/patches/patch-vendor_memchr-2.7.5_src_vector.rs
new file mode 100644
index 0000000000..a02f6a5464
--- /dev/null
+++ b/rust199/patches/patch-vendor_memchr-2.7.5_src_vector.rs
@@ -0,0 +1,34 @@
+$NetBSD$
+
+Apply fix for big-endian aarch64 from
+https://github.com/BurntSushi/memchr/pull/222
+
+--- vendor/memchr-2.7.5/src/vector.rs.orig 2026-07-14 15:13:08.000000000 +0000
++++ vendor/memchr-2.7.5/src/vector.rs
+@@ -319,6 +319,7 @@ mod aarch64neon {
+ }
+
+ #[inline(always)]
++ #[cfg(target_endian = "little")]
+ unsafe fn movemask(self) -> NeonMoveMask {
+ let asu16s = vreinterpretq_u16_u8(self);
+ let mask = vshrn_n_u16(asu16s, 4);
+@@ -328,6 +329,18 @@ mod aarch64neon {
+ }
+
+ #[inline(always)]
++ #[cfg(target_endian = "big")]
++ unsafe fn movemask(self) -> NeonMoveMask {
++ // Swap the endianness of each 16-bit input.
++ let asu16s = vreinterpretq_u16_u8(vrev16q_u8(self));
++ let mask = vshrn_n_u16(asu16s, 4);
++ let asu64 = vreinterpret_u64_u8(mask);
++ // Use `swap_bytes` to swap the endianness of the 64-bit output.
++ let scalar64 = vget_lane_u64(asu64, 0).swap_bytes();
++ NeonMoveMask(scalar64 & 0x8888888888888888)
++ }
++
++ #[inline(always)]
+ unsafe fn cmpeq(self, vector2: Self) -> uint8x16_t {
+ vceqq_u8(self, vector2)
+ }
diff --git a/rust199/patches/patch-vendor_memchr-2.7.6_src_vector.rs b/rust199/patches/patch-vendor_memchr-2.7.6_src_vector.rs
new file mode 100644
index 0000000000..20170e2611
--- /dev/null
+++ b/rust199/patches/patch-vendor_memchr-2.7.6_src_vector.rs
@@ -0,0 +1,34 @@
+$NetBSD$
+
+Apply fix for big-endian aarch64 from
+https://github.com/BurntSushi/memchr/pull/222
+
+--- vendor/memchr-2.7.6/src/vector.rs.orig 2026-07-14 15:13:08.000000000 +0000
++++ vendor/memchr-2.7.6/src/vector.rs
+@@ -319,6 +319,7 @@ mod aarch64neon {
+ }
+
+ #[inline(always)]
++ #[cfg(target_endian = "little")]
+ unsafe fn movemask(self) -> NeonMoveMask {
+ let asu16s = vreinterpretq_u16_u8(self);
+ let mask = vshrn_n_u16(asu16s, 4);
+@@ -328,6 +329,18 @@ mod aarch64neon {
+ }
+
+ #[inline(always)]
++ #[cfg(target_endian = "big")]
++ unsafe fn movemask(self) -> NeonMoveMask {
++ // Swap the endianness of each 16-bit input.
++ let asu16s = vreinterpretq_u16_u8(vrev16q_u8(self));
++ let mask = vshrn_n_u16(asu16s, 4);
++ let asu64 = vreinterpret_u64_u8(mask);
++ // Use `swap_bytes` to swap the endianness of the 64-bit output.
++ let scalar64 = vget_lane_u64(asu64, 0).swap_bytes();
++ NeonMoveMask(scalar64 & 0x8888888888888888)
++ }
++
++ #[inline(always)]
+ unsafe fn cmpeq(self, vector2: Self) -> uint8x16_t {
+ vceqq_u8(self, vector2)
+ }
diff --git a/rust199/patches/patch-vendor_memchr-2.8.0_src_vector.rs b/rust199/patches/patch-vendor_memchr-2.8.0_src_vector.rs
new file mode 100644
index 0000000000..b31bf7998c
--- /dev/null
+++ b/rust199/patches/patch-vendor_memchr-2.8.0_src_vector.rs
@@ -0,0 +1,34 @@
+$NetBSD$
+
+Apply fix for big-endian aarch64 from
+https://github.com/BurntSushi/memchr/pull/222
+
+--- vendor/memchr-2.8.0/src/vector.rs.orig 2026-07-25 19:57:37.417022627 +0000
++++ vendor/memchr-2.8.0/src/vector.rs
+@@ -319,6 +319,7 @@ mod aarch64neon {
+ }
+
+ #[inline(always)]
++ #[cfg(target_endian = "little")]
+ unsafe fn movemask(self) -> NeonMoveMask {
+ let asu16s = vreinterpretq_u16_u8(self);
+ let mask = vshrn_n_u16(asu16s, 4);
+@@ -328,6 +329,18 @@ mod aarch64neon {
+ }
+
+ #[inline(always)]
++ #[cfg(target_endian = "big")]
++ unsafe fn movemask(self) -> NeonMoveMask {
++ // Swap the endianness of each 16-bit input.
++ let asu16s = vreinterpretq_u16_u8(vrev16q_u8(self));
++ let mask = vshrn_n_u16(asu16s, 4);
++ let asu64 = vreinterpret_u64_u8(mask);
++ // Use `swap_bytes` to swap the endianness of the 64-bit output.
++ let scalar64 = vget_lane_u64(asu64, 0).swap_bytes();
++ NeonMoveMask(scalar64 & 0x8888888888888888)
++ }
++
++ #[inline(always)]
+ unsafe fn cmpeq(self, vector2: Self) -> uint8x16_t {
+ vceqq_u8(self, vector2)
+ }
diff --git a/rust199/patches/patch-vendor_openssl-src-111.28.2+1.1.1w_openssl_Configurations_10-main.conf b/rust199/patches/patch-vendor_openssl-src-111.28.2+1.1.1w_openssl_Configurations_10-main.conf
new file mode 100644
index 0000000000..73143bcc7b
--- /dev/null
+++ b/rust199/patches/patch-vendor_openssl-src-111.28.2+1.1.1w_openssl_Configurations_10-main.conf
@@ -0,0 +1,18 @@
+$NetBSD: patch-vendor_openssl-src-111.28.2+1.1.1w_openssl_Configurations_10-main.conf,v 1.4 2025/10/18 17:14:36 he Exp $
+
+Replicate part of
+https://github.com/openssl/openssl/pull/15086
+
+--- vendor/openssl-src-111.28.2+1.1.1w/openssl/Configurations/10-main.conf.orig 2025-05-18 13:23:47.013841572 +0000
++++ vendor/openssl-src-111.28.2+1.1.1w/openssl/Configurations/10-main.conf
+@@ -943,6 +943,10 @@ my %targets = (
+ shared_cflag => "-fPIC",
+ shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
+ },
++ "NetBSD-generic32" => {
++ inherit_from => [ "BSD-generic32" ],
++ ex_libs => add(threads("-latomic")),
++ },
+ "BSD-generic64" => {
+ inherit_from => [ "BSD-generic32" ],
+ bn_ops => "SIXTY_FOUR_BIT_LONG",
diff --git a/rust199/patches/patch-vendor_openssl-src-111.28.2+1.1.1w_openssl_crypto_aria_aria.c b/rust199/patches/patch-vendor_openssl-src-111.28.2+1.1.1w_openssl_crypto_aria_aria.c
new file mode 100644
index 0000000000..9f96455bcb
--- /dev/null
+++ b/rust199/patches/patch-vendor_openssl-src-111.28.2+1.1.1w_openssl_crypto_aria_aria.c
@@ -0,0 +1,18 @@
+$NetBSD: patch-vendor_openssl-src-111.28.2+1.1.1w_openssl_crypto_aria_aria.c,v 1.1 2025/10/18 17:14:36 he Exp $
+
+Make this build if bswap32 is already defined, as for NetBSD/i586.
+
+--- vendor/openssl-src-111.28.2+1.1.1w/openssl/crypto/aria/aria.c.orig 2025-05-19 20:01:02.477323075 +0000
++++ vendor/openssl-src-111.28.2+1.1.1w/openssl/crypto/aria/aria.c
+@@ -32,9 +32,11 @@
+ #define rotl32(v, r) (((uint32_t)(v) << (r)) | ((uint32_t)(v) >> (32 - r)))
+ #define rotr32(v, r) (((uint32_t)(v) >> (r)) | ((uint32_t)(v) << (32 - r)))
+
++#ifndef bswap32
+ #define bswap32(v) \
+ (((v) << 24) ^ ((v) >> 24) ^ \
+ (((v) & 0x0000ff00) << 8) ^ (((v) & 0x00ff0000) >> 8))
++#endif
+
+ #define GET_U8_BE(X, Y) ((uint8_t)((X) >> ((3 - Y) * 8)))
+ #define GET_U32_BE(X, Y) ( \
diff --git a/rust199/patches/patch-vendor_openssl-src-111.28.2+1.1.1w_src_lib.rs b/rust199/patches/patch-vendor_openssl-src-111.28.2+1.1.1w_src_lib.rs
new file mode 100644
index 0000000000..278b50f295
--- /dev/null
+++ b/rust199/patches/patch-vendor_openssl-src-111.28.2+1.1.1w_src_lib.rs
@@ -0,0 +1,67 @@
+$NetBSD: patch-vendor_openssl-src-111.28.2+1.1.1w_src_lib.rs,v 1.5 2026/04/02 19:06:35 wiz Exp $
+
+Add the various NetBSD targets.
+
+--- vendor/openssl-src-111.28.2+1.1.1w/src/lib.rs.orig 2026-02-11 07:30:54.000000000 +0000
++++ vendor/openssl-src-111.28.2+1.1.1w/src/lib.rs
+@@ -239,6 +239,8 @@ impl Build {
+ "aarch64-unknown-freebsd" => "BSD-generic64",
+ "aarch64-unknown-linux-gnu" => "linux-aarch64",
+ "aarch64-unknown-linux-musl" => "linux-aarch64",
++ "aarch64-unknown-netbsd" => "BSD-generic64",
++ "aarch64_be-unknown-netbsd" => "BSD-generic64",
+ "aarch64-pc-windows-msvc" => "VC-WIN64-ARM",
+ "arm-linux-androideabi" => "linux-armv4",
+ "armv7-linux-androideabi" => "linux-armv4",
+@@ -249,14 +251,17 @@ impl Build {
+ "armv5te-unknown-linux-gnueabi" => "linux-armv4",
+ "armv5te-unknown-linux-musleabi" => "linux-armv4",
+ "armv6-unknown-freebsd" => "BSD-generic32",
++ "armv6-unknown-netbsd-eabihf" => "BSD-generic32",
+ "armv7-unknown-freebsd" => "BSD-generic32",
+ "armv7-unknown-linux-gnueabi" => "linux-armv4",
+ "armv7-unknown-linux-musleabi" => "linux-armv4",
+ "armv7-unknown-linux-gnueabihf" => "linux-armv4",
+ "armv7-unknown-linux-musleabihf" => "linux-armv4",
++ "armv7-unknown-netbsd-eabihf" => "BSD-generic32",
+ "asmjs-unknown-emscripten" => "gcc",
+ "i586-unknown-linux-gnu" => "linux-elf",
+ "i586-unknown-linux-musl" => "linux-elf",
++ "i586-unknown-netbsd" => "BSD-x86-elf",
+ "i686-apple-darwin" => "darwin-i386-cc",
+ "i686-linux-android" => "linux-elf",
+ "i686-pc-windows-gnu" => "mingw",
+@@ -264,8 +269,10 @@ impl Build {
+ "i686-unknown-freebsd" => "BSD-x86-elf",
+ "i686-unknown-linux-gnu" => "linux-elf",
+ "i686-unknown-linux-musl" => "linux-elf",
++ "i686-unknown-netbsd" => "BSD-x86-elf",
+ "loongarch64-unknown-linux-gnu" => "linux-generic64",
+ "loongarch64-unknown-linux-musl" => "linux-generic64",
++ "m68k-unknown-netbsd" => NetBSD-generic32,
+ "mips-unknown-linux-gnu" => "linux-mips32",
+ "mips-unknown-linux-musl" => "linux-mips32",
+ "mips64-unknown-linux-gnuabi64" => "linux64-mips64",
+@@ -274,9 +281,11 @@ impl Build {
+ "mips64el-unknown-linux-muslabi64" => "linux64-mips64",
+ "mipsel-unknown-linux-gnu" => "linux-mips32",
+ "mipsel-unknown-linux-musl" => "linux-mips32",
++ "mipsel-unknown-netbsd" => "NetBSD-generic32",
+ "powerpc-unknown-freebsd" => "BSD-generic32",
+ "powerpc-unknown-linux-gnu" => "linux-ppc",
+ "powerpc-unknown-linux-gnuspe" => "linux-ppc",
++ "powerpc-unknown-netbsd" => "NetBSD-generic32",
+ "powerpc64-unknown-freebsd" => "BSD-generic64",
+ "powerpc64-unknown-linux-gnu" => "linux-ppc64",
+ "powerpc64-unknown-linux-musl" => "linux-ppc64",
+@@ -284,8 +293,10 @@ impl Build {
+ "powerpc64le-unknown-linux-gnu" => "linux-ppc64le",
+ "powerpc64le-unknown-linux-musl" => "linux-ppc64le",
+ "riscv64gc-unknown-linux-gnu" => "linux-generic64",
++ "riscv64gc-unknown-netbsd" => "BSD-generic64",
+ "s390x-unknown-linux-gnu" => "linux64-s390x",
+ "s390x-unknown-linux-musl" => "linux64-s390x",
++ "sparc64-unknown-netbsd" => "BSD-generic64",
+ "x86_64-apple-darwin" => "darwin64-x86_64-cc",
+ "x86_64-linux-android" => "linux-x86_64",
+ "x86_64-pc-windows-gnu" => "mingw64",
diff --git a/rust199/patches/patch-vendor_openssl-src-300.5.0+3.5.0_openssl_Configurations_10-main.conf b/rust199/patches/patch-vendor_openssl-src-300.5.0+3.5.0_openssl_Configurations_10-main.conf
new file mode 100644
index 0000000000..8b8658489d
--- /dev/null
+++ b/rust199/patches/patch-vendor_openssl-src-300.5.0+3.5.0_openssl_Configurations_10-main.conf
@@ -0,0 +1,18 @@
+$NetBSD: patch-vendor_openssl-src-300.5.0+3.5.0_openssl_Configurations_10-main.conf,v 1.1 2025/10/18 17:14:36 he Exp $
+
+Replicate part of
+https://github.com/openssl/openssl/pull/15086
+
+--- vendor/openssl-src-300.5.0+3.5.0/openssl/Configurations/10-main.conf.orig 2025-05-20 09:03:49.120083364 +0000
++++ vendor/openssl-src-300.5.0+3.5.0/openssl/Configurations/10-main.conf
+@@ -1033,6 +1033,10 @@ my %targets = (
+ shared_target => "bsd-gcc-shared",
+ shared_cflag => "-fPIC",
+ },
++ "NetBSD-generic32" => {
++ inherit_from => [ "BSD-generic32" ],
++ ex_libs => add(threads("-latomic")),
++ },
+ "BSD-generic64" => {
+ inherit_from => [ "BSD-generic32" ],
+ bn_ops => "SIXTY_FOUR_BIT_LONG",
diff --git a/rust199/patches/patch-vendor_openssl-src-300.5.0+3.5.0_openssl_crypto_aria_aria.c b/rust199/patches/patch-vendor_openssl-src-300.5.0+3.5.0_openssl_crypto_aria_aria.c
new file mode 100644
index 0000000000..77c8b0f3e0
--- /dev/null
+++ b/rust199/patches/patch-vendor_openssl-src-300.5.0+3.5.0_openssl_crypto_aria_aria.c
@@ -0,0 +1,18 @@
+$NetBSD: patch-vendor_openssl-src-300.5.0+3.5.0_openssl_crypto_aria_aria.c,v 1.1 2025/10/18 17:14:36 he Exp $
+
+Make this build also if bswap32 is already defined, as for NetBSD/i586.
+
+--- vendor/openssl-src-300.5.0+3.5.0/openssl/crypto/aria/aria.c.orig 2025-05-19 20:04:00.808387729 +0000
++++ vendor/openssl-src-300.5.0+3.5.0/openssl/crypto/aria/aria.c
+@@ -32,9 +32,11 @@
+ #define rotl32(v, r) (((uint32_t)(v) << (r)) | ((uint32_t)(v) >> (32 - r)))
+ #define rotr32(v, r) (((uint32_t)(v) >> (r)) | ((uint32_t)(v) << (32 - r)))
+
++#ifndef bswap32
+ #define bswap32(v) \
+ (((v) << 24) ^ ((v) >> 24) ^ \
+ (((v) & 0x0000ff00) << 8) ^ (((v) & 0x00ff0000) >> 8))
++#endif
+
+ #define GET_U8_BE(X, Y) ((uint8_t)((X) >> ((3 - Y) * 8)))
+ #define GET_U32_BE(X, Y) ( \
diff --git a/rust199/patches/patch-vendor_openssl-src-300.5.0+3.5.0_src_lib.rs b/rust199/patches/patch-vendor_openssl-src-300.5.0+3.5.0_src_lib.rs
new file mode 100644
index 0000000000..11a1eaf2db
--- /dev/null
+++ b/rust199/patches/patch-vendor_openssl-src-300.5.0+3.5.0_src_lib.rs
@@ -0,0 +1,30 @@
+$NetBSD: patch-vendor_openssl-src-300.5.0+3.5.0_src_lib.rs,v 1.2 2026/04/02 19:06:35 wiz Exp $
+
+Make this build on NetBSD for arm6, mipsel and m68k as well.
+
+--- vendor/openssl-src-300.5.0+3.5.0/src/lib.rs.orig 2026-02-11 07:30:54.000000000 +0000
++++ vendor/openssl-src-300.5.0+3.5.0/src/lib.rs
+@@ -321,6 +321,7 @@ impl Build {
+ "armv5te-unknown-linux-gnueabi" => "linux-armv4",
+ "armv5te-unknown-linux-musleabi" => "linux-armv4",
+ "armv6-unknown-freebsd" => "BSD-generic32",
++ "armv6-unknown-netbsd-eabihf" => "BSD-generic32",
+ "armv6-alpine-linux-musleabihf" => "linux-armv6",
+ "armv7-unknown-freebsd" => "BSD-armv4",
+ "armv7-unknown-linux-gnueabi" => "linux-armv4",
+@@ -348,6 +349,7 @@ impl Build {
+ "i686-uwp-windows-msvc" => "VC-WIN32-UWP",
+ "loongarch64-unknown-linux-gnu" => "linux-generic64",
+ "loongarch64-unknown-linux-musl" => "linux-generic64",
++ "m68k-unknown-netbsd" => "NetBSD-generic32",
+ "mips-unknown-linux-gnu" => "linux-mips32",
+ "mips-unknown-linux-musl" => "linux-mips32",
+ "mips64-unknown-linux-gnuabi64" => "linux64-mips64",
+@@ -356,6 +358,7 @@ impl Build {
+ "mips64el-unknown-linux-muslabi64" => "linux64-mips64",
+ "mipsel-unknown-linux-gnu" => "linux-mips32",
+ "mipsel-unknown-linux-musl" => "linux-mips32",
++ "mipsel-unknown-netbsd" => "NetBSD-generic32",
+ "powerpc-unknown-freebsd" => "BSD-ppc",
+ "powerpc-unknown-linux-gnu" => "linux-ppc",
+ "powerpc-unknown-linux-gnuspe" => "linux-ppc",
diff --git a/rust199/patches/patch-vendor_openssl-src-300.6.1+3.6.3_openssl_Configurations_10-main.conf b/rust199/patches/patch-vendor_openssl-src-300.6.1+3.6.3_openssl_Configurations_10-main.conf
new file mode 100644
index 0000000000..458926fa76
--- /dev/null
+++ b/rust199/patches/patch-vendor_openssl-src-300.6.1+3.6.3_openssl_Configurations_10-main.conf
@@ -0,0 +1,18 @@
+$NetBSD: patch-vendor_openssl-src-300.5.4+3.5.4_openssl_Configurations_10-main.conf,v 1.1 2026/04/02 19:06:35 wiz Exp $
+
+Replicate part of
+https://github.com/openssl/openssl/pull/15086
+
+--- vendor/openssl-src-300.6.1+3.6.3/openssl/Configurations/10-main.conf.orig 2025-11-02 17:12:27.865420544 +0000
++++ vendor/openssl-src-300.6.1+3.6.3/openssl/Configurations/10-main.conf
+@@ -1033,6 +1033,10 @@ my %targets = (
+ shared_target => "bsd-gcc-shared",
+ shared_cflag => "-fPIC",
+ },
++ "NetBSD-generic32" => {
++ inherit_from => [ "BSD-generic32" ],
++ ex_libs => add(threads("-latomic")),
++ },
+ "BSD-generic64" => {
+ inherit_from => [ "BSD-generic32" ],
+ bn_ops => "SIXTY_FOUR_BIT_LONG",
diff --git a/rust199/patches/patch-vendor_openssl-src-300.6.1+3.6.3_openssl_crypto_aria_aria.c b/rust199/patches/patch-vendor_openssl-src-300.6.1+3.6.3_openssl_crypto_aria_aria.c
new file mode 100644
index 0000000000..fb2c86b28b
--- /dev/null
+++ b/rust199/patches/patch-vendor_openssl-src-300.6.1+3.6.3_openssl_crypto_aria_aria.c
@@ -0,0 +1,17 @@
+$NetBSD: patch-vendor_openssl-src-300.5.4+3.5.4_openssl_crypto_aria_aria.c,v 1.1 2026/04/02 19:06:35 wiz Exp $
+
+Make this build also if bswap32 is already defined, as for NetBSD/i586.
+
+--- vendor/openssl-src-300.6.1+3.6.3/openssl/crypto/aria/aria.c.orig 2025-11-02 17:14:42.569500518 +0000
++++ vendor/openssl-src-300.6.1+3.6.3/openssl/crypto/aria/aria.c
+@@ -32,8 +32,10 @@
+ #define rotl32(v, r) (((uint32_t)(v) << (r)) | ((uint32_t)(v) >> (32 - r)))
+ #define rotr32(v, r) (((uint32_t)(v) >> (r)) | ((uint32_t)(v) << (32 - r)))
+
++#ifndef bswap32
+ #define bswap32(v) \
+ (((v) << 24) ^ ((v) >> 24) ^ (((v) & 0x0000ff00) << 8) ^ (((v) & 0x00ff0000) >> 8))
++#endif
+
+ #define GET_U8_BE(X, Y) ((uint8_t)((X) >> ((3 - Y) * 8)))
+ #define GET_U32_BE(X, Y) ( \
diff --git a/rust199/patches/patch-vendor_openssl-src-300.6.1+3.6.3_src_lib.rs b/rust199/patches/patch-vendor_openssl-src-300.6.1+3.6.3_src_lib.rs
new file mode 100644
index 0000000000..7a0cc36e43
--- /dev/null
+++ b/rust199/patches/patch-vendor_openssl-src-300.6.1+3.6.3_src_lib.rs
@@ -0,0 +1,30 @@
+$NetBSD: patch-vendor_openssl-src-300.5.4+3.5.4_src_lib.rs,v 1.1 2026/04/02 19:06:35 wiz Exp $
+
+Make this build on NetBSD for armv6, mipsel and m68k as well.
+
+--- vendor/openssl-src-300.6.1+3.6.3/src/lib.rs.orig 2026-02-11 07:30:54.000000000 +0000
++++ vendor/openssl-src-300.6.1+3.6.3/src/lib.rs
+@@ -326,6 +326,7 @@ impl Build {
+ "armv5te-unknown-linux-gnueabi" => "linux-armv4",
+ "armv5te-unknown-linux-musleabi" => "linux-armv4",
+ "armv6-unknown-freebsd" => "BSD-generic32",
++ "armv6-unknown-netbsd-eabihf" => "BSD-generic32",
+ "armv6-alpine-linux-musleabihf" => "linux-armv6",
+ "armv7-unknown-freebsd" => "BSD-armv4",
+ "armv7-unknown-linux-gnueabi" => "linux-armv4",
+@@ -353,6 +354,7 @@ impl Build {
+ "i686-uwp-windows-msvc" => "VC-WIN32-UWP",
+ "loongarch64-unknown-linux-gnu" => "linux-generic64",
+ "loongarch64-unknown-linux-musl" => "linux-generic64",
++ "m68k-unknown-netbsd" => "NetBSD-generic32",
+ "mips-unknown-linux-gnu" => "linux-mips32",
+ "mips-unknown-linux-musl" => "linux-mips32",
+ "mips64-unknown-linux-gnuabi64" => "linux64-mips64",
+@@ -361,6 +363,7 @@ impl Build {
+ "mips64el-unknown-linux-muslabi64" => "linux64-mips64",
+ "mipsel-unknown-linux-gnu" => "linux-mips32",
+ "mipsel-unknown-linux-musl" => "linux-mips32",
++ "mipsel-unknown-netbsd" => "NetBSD-generic32",
+ "powerpc-unknown-freebsd" => "BSD-ppc",
+ "powerpc-unknown-linux-gnu" => "linux-ppc",
+ "powerpc-unknown-linux-gnuspe" => "linux-ppc",
diff --git a/rust199/patches/patch-vendor_openssl-sys-0.9.107_build_find__normal.rs b/rust199/patches/patch-vendor_openssl-sys-0.9.107_build_find__normal.rs
new file mode 100644
index 0000000000..ec68e07374
--- /dev/null
+++ b/rust199/patches/patch-vendor_openssl-sys-0.9.107_build_find__normal.rs
@@ -0,0 +1,30 @@
+$NetBSD: patch-vendor_openssl-sys-0.9.107_build_find__normal.rs,v 1.1 2025/08/25 17:51:13 wiz Exp $
+
+Add hack for Darwin when homebrew is installed.
+
+--- vendor/openssl-sys-0.9.107/build/find_normal.rs.orig 2025-06-28 08:24:16.945712755 +0000
++++ vendor/openssl-sys-0.9.107/build/find_normal.rs
+@@ -72,23 +72,6 @@ fn resolve_with_wellknown_location(dir:
+ fn find_openssl_dir(target: &str) -> OsString {
+ let host = env::var("HOST").unwrap();
+
+- if host == target && target.ends_with("-apple-darwin") {
+- let homebrew_dir = match target {
+- "aarch64-apple-darwin" => "/opt/homebrew",
+- _ => "/usr/local",
+- };
+-
+- if let Some(dir) = resolve_with_wellknown_homebrew_location(homebrew_dir) {
+- return dir.into();
+- } else if let Some(dir) = resolve_with_wellknown_location("/opt/pkg") {
+- // pkgsrc
+- return dir.into();
+- } else if let Some(dir) = resolve_with_wellknown_location("/opt/local") {
+- // MacPorts
+- return dir.into();
+- }
+- }
+-
+ try_pkg_config();
+ try_vcpkg();
+
diff --git a/rust199/patches/patch-vendor_openssl-sys-0.9.107_build_main.rs b/rust199/patches/patch-vendor_openssl-sys-0.9.107_build_main.rs
new file mode 100644
index 0000000000..1af0475acb
--- /dev/null
+++ b/rust199/patches/patch-vendor_openssl-sys-0.9.107_build_main.rs
@@ -0,0 +1,23 @@
+$NetBSD: patch-vendor_openssl-sys-0.9.107_build_main.rs,v 1.1 2025/08/25 17:51:13 wiz Exp $
+
+Patterned after Linux and Android, on 32-bit NetBSD ports
+include -latomic. Parts of this inspired by
+https://github.com/sfackler/rust-openssl/commit/a0a1d1d29263abb7c47fc2e58cef8dab13762a45
+
+--- vendor/openssl-sys-0.9.107/build/main.rs.orig 2025-06-28 08:26:57.774420907 +0000
++++ vendor/openssl-sys-0.9.107/build/main.rs
+@@ -269,6 +269,14 @@ fn main() {
+ println!("cargo:rustc-link-lib=atomic");
+ }
+
++ // Patterned of the above, make sure we include -latomic
++ // on ilp32 NetBSD ports (yes, this only tests the "p32" part).
++ if env::var("CARGO_CFG_TARGET_OS").unwrap() == "netbsd"
++ && env::var("CARGO_CFG_TARGET_POINTER_WIDTH").unwrap() == "32"
++ {
++ println!("cargo:rustc-link-lib=atomic");
++ }
++
+ if kind == "static" && target.contains("windows") {
+ println!("cargo:rustc-link-lib=dylib=gdi32");
+ println!("cargo:rustc-link-lib=dylib=user32");
diff --git a/rust199/patches/patch-vendor_openssl-sys-0.9.114_build_find__normal.rs b/rust199/patches/patch-vendor_openssl-sys-0.9.114_build_find__normal.rs
new file mode 100644
index 0000000000..35b4afac95
--- /dev/null
+++ b/rust199/patches/patch-vendor_openssl-sys-0.9.114_build_find__normal.rs
@@ -0,0 +1,30 @@
+$NetBSD: patch-vendor_openssl-sys-0.9.111_build_find__normal.rs,v 1.1 2026/04/02 19:06:35 wiz Exp $
+
+Add hack for Darwin when homebrew is installed.
+
+--- vendor/openssl-sys-0.9.114/build/find_normal.rs.orig 2026-01-25 08:56:08.257782732 +0000
++++ vendor/openssl-sys-0.9.114/build/find_normal.rs
+@@ -72,23 +72,6 @@ fn resolve_with_wellknown_location(dir:
+ fn find_openssl_dir(target: &str) -> OsString {
+ let host = env::var("HOST").unwrap();
+
+- if host == target && target.ends_with("-apple-darwin") {
+- let homebrew_dir = match target {
+- "aarch64-apple-darwin" => "/opt/homebrew",
+- _ => "/usr/local",
+- };
+-
+- if let Some(dir) = resolve_with_wellknown_homebrew_location(homebrew_dir) {
+- return dir.into();
+- } else if let Some(dir) = resolve_with_wellknown_location("/opt/pkg") {
+- // pkgsrc
+- return dir.into();
+- } else if let Some(dir) = resolve_with_wellknown_location("/opt/local") {
+- // MacPorts
+- return dir.into();
+- }
+- }
+-
+ try_pkg_config();
+ try_vcpkg();
+
diff --git a/rust199/patches/patch-vendor_openssl-sys-0.9.114_build_main.rs b/rust199/patches/patch-vendor_openssl-sys-0.9.114_build_main.rs
new file mode 100644
index 0000000000..0787fe42e5
--- /dev/null
+++ b/rust199/patches/patch-vendor_openssl-sys-0.9.114_build_main.rs
@@ -0,0 +1,23 @@
+$NetBSD: patch-vendor_openssl-sys-0.9.111_build_main.rs,v 1.1 2026/04/02 19:06:35 wiz Exp $
+
+Patterned after Linux and Android, on 32-bit NetBSD ports
+include -latomic. Parts of this inspired by
+https://github.com/sfackler/rust-openssl/commit/a0a1d1d29263abb7c47fc2e58cef8dab13762a45
+
+--- vendor/openssl-sys-0.9.114/build/main.rs.orig 2026-01-25 08:57:28.677889187 +0000
++++ vendor/openssl-sys-0.9.114/build/main.rs
+@@ -279,6 +279,14 @@ fn main() {
+ println!("cargo:rustc-link-lib=atomic");
+ }
+
++ // Patterned of the above, make sure we include -latomic
++ // on ilp32 ports (yes, this only tests the "p32" part).
++ if env::var("CARGO_CFG_TARGET_OS").unwrap() == "netbsd"
++ && env::var("CARGO_CFG_TARGET_POINTER_WIDTH").unwrap() == "32"
++ {
++ println!("cargo:rustc-link-lib=atomic");
++ }
++
+ if kind == "static" && target.contains("windows") {
+ println!("cargo:rustc-link-lib=dylib=gdi32");
+ println!("cargo:rustc-link-lib=dylib=user32");
diff --git a/rust199/patches/patch-vendor_openssl-sys-0.9.117_build_find__normal.rs b/rust199/patches/patch-vendor_openssl-sys-0.9.117_build_find__normal.rs
new file mode 100644
index 0000000000..102990f8dd
--- /dev/null
+++ b/rust199/patches/patch-vendor_openssl-sys-0.9.117_build_find__normal.rs
@@ -0,0 +1,30 @@
+$NetBSD$
+
+Add hack for Darwin when homebrew is installed.
+
+--- vendor/openssl-sys-0.9.117/build/find_normal.rs.orig 2026-08-23 11:12:56.193404020 +0000
++++ vendor/openssl-sys-0.9.117/build/find_normal.rs
+@@ -72,23 +72,6 @@ fn resolve_with_wellknown_location(dir:
+ fn find_openssl_dir(target: &str) -> OsString {
+ let host = env::var("HOST").unwrap();
+
+- if host == target && target.ends_with("-apple-darwin") {
+- let homebrew_dir = match target {
+- "aarch64-apple-darwin" => "/opt/homebrew",
+- _ => "/usr/local",
+- };
+-
+- if let Some(dir) = resolve_with_wellknown_homebrew_location(homebrew_dir) {
+- return dir.into();
+- } else if let Some(dir) = resolve_with_wellknown_location("/opt/pkg") {
+- // pkgsrc
+- return dir.into();
+- } else if let Some(dir) = resolve_with_wellknown_location("/opt/local") {
+- // MacPorts
+- return dir.into();
+- }
+- }
+-
+ try_pkg_config();
+ try_vcpkg();
+
diff --git a/rust199/patches/patch-vendor_openssl-sys-0.9.117_build_main.rs b/rust199/patches/patch-vendor_openssl-sys-0.9.117_build_main.rs
new file mode 100644
index 0000000000..4395e8f86e
--- /dev/null
+++ b/rust199/patches/patch-vendor_openssl-sys-0.9.117_build_main.rs
@@ -0,0 +1,23 @@
+$NetBSD$
+
+Patterned after Linux and Android, on 32-bit NetBSD ports
+include -latomic. Parts of this inspired by
+https://github.com/sfackler/rust-openssl/commit/a0a1d1d29263abb7c47fc2e58cef8dab13762a45
+
+--- vendor/openssl-sys-0.9.117/build/main.rs.orig 2026-08-23 11:13:40.786771844 +0000
++++ vendor/openssl-sys-0.9.117/build/main.rs
+@@ -283,6 +283,14 @@ fn main() {
+ println!("cargo:rustc-link-lib=atomic");
+ }
+
++ // Patterned of the above, make sure we include -latomic
++ // on ilp32 ports (yes, this only tests the "p32" part).
++ if env::var("CARGO_CFG_TARGET_OS").unwrap() == "netbsd"
++ && env::var("CARGO_CFG_TARGET_POINTER_WIDTH").unwrap() == "32"
++ {
++ println!("cargo:rustc-link-lib=atomic");
++ }
++
+ if kind == "static" && target.contains("windows") {
+ println!("cargo:rustc-link-lib=dylib=gdi32");
+ println!("cargo:rustc-link-lib=dylib=user32");
diff --git a/rust199/patches/patch-vendor_openssl-sys-0.9.92_build_find__normal.rs b/rust199/patches/patch-vendor_openssl-sys-0.9.92_build_find__normal.rs
new file mode 100644
index 0000000000..eadb21f4b0
--- /dev/null
+++ b/rust199/patches/patch-vendor_openssl-sys-0.9.92_build_find__normal.rs
@@ -0,0 +1,30 @@
+$NetBSD: patch-vendor_openssl-sys-0.9.92_build_find__normal.rs,v 1.4 2025/10/18 17:14:36 he Exp $
+
+Add hack for Darwin when homebrew is installed.
+
+--- vendor/openssl-sys-0.9.92/build/find_normal.rs.orig 2025-09-19 21:56:18.930723780 +0000
++++ vendor/openssl-sys-0.9.92/build/find_normal.rs
+@@ -72,23 +72,6 @@ fn resolve_with_wellknown_location(dir:
+ fn find_openssl_dir(target: &str) -> OsString {
+ let host = env::var("HOST").unwrap();
+
+- if host == target && target.ends_with("-apple-darwin") {
+- let homebrew_dir = match target {
+- "aarch64-apple-darwin" => "/opt/homebrew",
+- _ => "/usr/local",
+- };
+-
+- if let Some(dir) = resolve_with_wellknown_homebrew_location(homebrew_dir) {
+- return dir.into();
+- } else if let Some(dir) = resolve_with_wellknown_location("/opt/pkg") {
+- // pkgsrc
+- return dir.into();
+- } else if let Some(dir) = resolve_with_wellknown_location("/opt/local") {
+- // MacPorts
+- return dir.into();
+- }
+- }
+-
+ try_pkg_config();
+ try_vcpkg();
+
diff --git a/rust199/patches/patch-vendor_openssl-sys-0.9.92_build_main.rs b/rust199/patches/patch-vendor_openssl-sys-0.9.92_build_main.rs
new file mode 100644
index 0000000000..09c1b546a4
--- /dev/null
+++ b/rust199/patches/patch-vendor_openssl-sys-0.9.92_build_main.rs
@@ -0,0 +1,23 @@
+$NetBSD: patch-vendor_openssl-sys-0.9.92_build_main.rs,v 1.4 2025/10/18 17:14:37 he Exp $
+
+Patterned after Linux and Android, on 32-bit NetBSD ports
+include -latomic. Parts of this inspired by
+https://github.com/sfackler/rust-openssl/commit/a0a1d1d29263abb7c47fc2e58cef8dab13762a45
+
+--- vendor/openssl-sys-0.9.92/build/main.rs.orig 2025-09-19 21:57:47.732695298 +0000
++++ vendor/openssl-sys-0.9.92/build/main.rs
+@@ -115,6 +115,14 @@ fn main() {
+ println!("cargo:rustc-link-lib={}={}", kind, lib);
+ }
+
++ // Patterned of the above, make sure we include -latomic
++ // on NetBSD ilp32 ports (yes, this only tests the "p32" part).
++ if env::var("CARGO_CFG_TARGET_OS").unwrap() == "netbsd"
++ && env::var("CARGO_CFG_TARGET_POINTER_WIDTH").unwrap() == "32"
++ {
++ println!("cargo:rustc-link-lib=atomic");
++ }
++
+ if kind == "static" && target.contains("windows") {
+ println!("cargo:rustc-link-lib=dylib=gdi32");
+ println!("cargo:rustc-link-lib=dylib=user32");
diff --git a/rust199/patches/patch-vendor_rustc-ap-rustc__target_src_spec_aarch64__be__unknown__netbsd.rs b/rust199/patches/patch-vendor_rustc-ap-rustc__target_src_spec_aarch64__be__unknown__netbsd.rs
new file mode 100644
index 0000000000..6c90dec84c
--- /dev/null
+++ b/rust199/patches/patch-vendor_rustc-ap-rustc__target_src_spec_aarch64__be__unknown__netbsd.rs
@@ -0,0 +1,27 @@
+$NetBSD: patch-vendor_rustc-ap-rustc__target_src_spec_aarch64__be__unknown__netbsd.rs,v 1.9 2024/04/18 09:29:43 pin Exp $
+
+Add aarch64_be NetBSD target.
+
+--- /dev/null 2021-04-26 00:02:43.147970692 +0200
++++ vendor/rustc-ap-rustc_target/src/spec/aarch64_be_unknown_netbsd.rs 2021-04-26 00:07:44.657579025 +0200
+@@ -0,0 +1,20 @@
++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(128);
++ base.unsupported_abis = super::arm_base::unsupported_abis();
++
++ Target {
++ llvm_target: "aarch64_be-unknown-netbsd".to_string(),
++ pointer_width: 64,
++ data_layout: "E-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128".to_string(),
++ arch: "aarch64".to_string(),
++ options: TargetOptions {
++ mcount: "__mcount".to_string(),
++ endian: Endian::Big,
++ ..base
++ },
++ }
++}
diff --git a/rust199/patches/patch-vendor_zerocopy-0.7.35_src_lib.rs b/rust199/patches/patch-vendor_zerocopy-0.7.35_src_lib.rs
new file mode 100644
index 0000000000..02ae82da04
--- /dev/null
+++ b/rust199/patches/patch-vendor_zerocopy-0.7.35_src_lib.rs
@@ -0,0 +1,25 @@
+$NetBSD: patch-vendor_zerocopy-0.7.35_src_lib.rs,v 1.3 2025/08/25 17:51:14 wiz Exp $
+
+Attempt at skipping SIMD / neon on big-endian aarch64,
+ref. https://github.com/rust-lang/rust/issues/129819.
+
+--- vendor/zerocopy-0.7.35/src/lib.rs.orig 2024-08-31 21:15:29.602997509 +0000
++++ vendor/zerocopy-0.7.35/src/lib.rs
+@@ -3727,7 +3727,7 @@ mod simd {
+ powerpc64, powerpc64, vector_bool_long, vector_double, vector_signed_long, vector_unsigned_long
+ );
+ simd_arch_mod!(
+- #[cfg(target_arch = "aarch64")]
++ #[cfg(all(target_arch = "aarch64", target_endian = "little"))]
+ aarch64, aarch64, float32x2_t, float32x4_t, float64x1_t, float64x2_t, int8x8_t, int8x8x2_t,
+ int8x8x3_t, int8x8x4_t, int8x16_t, int8x16x2_t, int8x16x3_t, int8x16x4_t, int16x4_t,
+ int16x8_t, int32x2_t, int32x4_t, int64x1_t, int64x2_t, poly8x8_t, poly8x8x2_t, poly8x8x3_t,
+@@ -8020,7 +8020,7 @@ mod tests {
+ vector_signed_long,
+ vector_unsigned_long
+ );
+- #[cfg(target_arch = "aarch64")]
++ #[cfg(all(target_arch = "aarch64", target_endian = "little"))]
+ #[rustfmt::skip]
+ test_simd_arch_mod!(
+ aarch64, float32x2_t, float32x4_t, float64x1_t, float64x2_t, int8x8_t, int8x8x2_t,
diff --git a/rust199/patches/patch-vendor_zeroize-1.8.1_src_lib.rs b/rust199/patches/patch-vendor_zeroize-1.8.1_src_lib.rs
new file mode 100644
index 0000000000..17e4970d08
--- /dev/null
+++ b/rust199/patches/patch-vendor_zeroize-1.8.1_src_lib.rs
@@ -0,0 +1,15 @@
+$NetBSD: patch-vendor_zeroize-1.8.1_src_lib.rs,v 1.2 2025/08/25 17:51:14 wiz Exp $
+
+Don't try to use the NEON-specific module in big-endian mode.
+
+--- vendor/zeroize-1.8.1/src/lib.rs.orig 2025-04-06 07:17:23.864281079 +0000
++++ vendor/zeroize-1.8.1/src/lib.rs
+@@ -245,7 +245,7 @@ extern crate std;
+ #[cfg(feature = "zeroize_derive")]
+ pub use zeroize_derive::{Zeroize, ZeroizeOnDrop};
+
+-#[cfg(target_arch = "aarch64")]
++#[cfg(all(target_arch = "aarch64", target_endian = "little"))]
+ mod aarch64;
+ #[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
+ mod x86;
diff --git a/rust199/platform.mk b/rust199/platform.mk
new file mode 100644
index 0000000000..c4c2911399
--- /dev/null
+++ b/rust199/platform.mk
@@ -0,0 +1,34 @@
+# $NetBSD: platform.mk,v 1.35 2026/03/17 07:02:08 nia Exp $
+
+# This file encodes whether a given platform has support for rust.
+
+# Platforms where rust ought to work but does not require a link to an
+# open PR.
+
+.if !defined(PLATFORM_SUPPORTS_RUST)
+
+# 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-8].*)
+RUST_PLATFORMS+= ${rust_os}-*-${rust_arch}
+. endif
+. 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
+. endif
+.endfor
+PLATFORM_SUPPORTS_RUST?= no
+
+.endif # !defined(PLATFORM_SUPPORTS_RUST)
diff --git a/rust199/rust.mk b/rust199/rust.mk
new file mode 100644
index 0000000000..5903baec65
--- /dev/null
+++ b/rust199/rust.mk
@@ -0,0 +1,68 @@
+# $NetBSD: rust.mk,v 1.20 2026/04/04 18:48:49 tnn Exp $
+#
+# This file determines the type of rust package to use.
+#
+# It should be included by rust-dependent packages that don't use
+# cargo.mk.
+#
+# === User-settable variables ===
+#
+# RUST_TYPE
+# The preferred type of Rust release to use - either build from source,
+# or use a binary installation.
+#
+# Official Rust binaries are only published for certain platforms. The
+# "bin" option uses the lang/rust-bin package, whereas "native" uses
+# binaries installed on the host system. If using "native" with a rustup
+# installation, you will probably also need to set RUSTUP_HOME in your
+# MAKE_ENV pointing to the 'rustup show home' directory. This is due to
+# pkgsrc overwriting the HOME environment variable during build.
+#
+# Possible values: src bin native
+# Default: "src", except on 32-bit arm where it's "bin"
+#
+# === Package-settable variables ===
+#
+# RUST_REQ
+# The minimum version of Rust required by the package.
+#
+# Default: 1.85.0
+#
+# RUST_RUNTIME
+# Whether rust is a runtime dependency.
+# Usually it is only needed to build.
+#
+# Possible values: yes no
+# Default: no
+
+.include "../../mk/bsd.fast.prefs.mk"
+.include "platform.mk"
+
+RUST_REQ?= 1.85.0
+RUST_RUNTIME?= no
+
+.if ${MACHINE_PLATFORM:M*-*-earm*}
+RUST_TYPE?= bin
+.else
+RUST_TYPE?= src
+.endif
+
+.if ${RUST_TYPE} == "bin"
+. if ${RUST_RUNTIME} == "no"
+BUILDLINK_DEPMETHOD.rust-bin?= build
+. endif
+BUILDLINK_API_DEPENDS.rust-bin+= rust-bin>=${RUST_REQ}
+. include "${RUST_DIR}-bin/buildlink3.mk"
+.endif
+
+.if ${RUST_TYPE} == "src"
+. if ${RUST_RUNTIME} == "no"
+BUILDLINK_DEPMETHOD.rust?= build
+. endif
+BUILDLINK_API_DEPENDS.rust+= rust>=${RUST_REQ}
+. include "${RUST_DIR}/buildlink3.mk"
+.endif
+
+.if ${OPSYS} == "NetBSD"
+ALL_ENV+= PTHREAD_KEYS_MAX=512
+.endif
Home |
Main Index |
Thread Index |
Old Index