Sun Mar 3 14:53:33 2024 UTC (105d)
rust: Upgrade to version 1.75.0.

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

Upstream changes:

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

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

Compiler
--------

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

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

Libraries
---------

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

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

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

These APIs are now stable in const contexts:

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

Cargo
-----

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

Rustdoc
-------

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

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

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


(he)
diff -r1.302 -r1.303 pkgsrc/lang/rust/Makefile
diff -r1.34 -r1.35 pkgsrc/lang/rust/options.mk
diff -r1.20 -r1.21 pkgsrc/lang/rust/platform.mk
diff -r1.15 -r1.16 pkgsrc/lang/rust/patches/patch-compiler_rustc__llvm_build.rs
diff -r1.15 -r1.16 pkgsrc/lang/rust/patches/patch-compiler_rustc__target_src_spec_mod.rs
diff -r0 -r1.1 pkgsrc/lang/rust/patches/patch-compiler_rustc__target_src_spec_base_netbsd.rs
diff -r0 -r1.1 pkgsrc/lang/rust/patches/patch-compiler_rustc__target_src_spec_targets_mips64el__unknown__netbsd.rs
diff -r0 -r1.1 pkgsrc/lang/rust/patches/patch-src_bootstrap_src_core_build__steps_compile.rs
diff -r0 -r1.1 pkgsrc/lang/rust/patches/patch-src_bootstrap_src_core_build__steps_llvm.rs
diff -r0 -r1.1 pkgsrc/lang/rust/patches/patch-src_bootstrap_src_core_builder.rs
diff -r0 -r1.1 pkgsrc/lang/rust/patches/patch-src_bootstrap_src_lib.rs
diff -r0 -r1.1 pkgsrc/lang/rust/patches/patch-vendor_libc-0.2.148_src_unix_bsd_netbsdlike+netbsd_mips.rs
diff -r0 -r1.1 pkgsrc/lang/rust/patches/patch-vendor_libc-0.2.148_src_unix_bsd_netbsdlike_netbsd_mod.rs
diff -r0 -r1.1 pkgsrc/lang/rust/patches/patch-vendor_libc-0.2.148_src_unix_bsd_netbsdlike_netbsd_riscv64.rs
diff -r0 -r1.1 pkgsrc/lang/rust/patches/patch-vendor_libc-0.2.148_src_unix_solarish_mod.rs
diff -r0 -r1.1 pkgsrc/lang/rust/patches/patch-vendor_libc-0.2.149_src_unix_bsd_netbsdlike_netbsd_mips.rs
diff -r0 -r1.1 pkgsrc/lang/rust/patches/patch-vendor_libc-0.2.149_src_unix_bsd_netbsdlike_netbsd_mod.rs
diff -r0 -r1.1 pkgsrc/lang/rust/patches/patch-vendor_libc-0.2.149_src_unix_bsd_netbsdlike_netbsd_riscv64.rs
diff -r0 -r1.1 pkgsrc/lang/rust/patches/patch-vendor_libc-0.2.149_src_unix_solarish_mod.rs
diff -r1.10 -r0 pkgsrc/lang/rust/patches/patch-compiler_rustc__target_src_spec_i586__unknown__netbsd.rs
diff -r1.3 -r0 pkgsrc/lang/rust/patches/patch-compiler_rustc__target_src_spec_mips64el__unknown__netbsd.rs
diff -r1.3 -r0 pkgsrc/lang/rust/patches/patch-src_bootstrap_llvm.rs
diff -r1.3 -r0 pkgsrc/lang/rust/patches/patch-vendor_libc-0.2.138_src_unix_bsd_netbsdlike_netbsd_mips.rs
diff -r1.3 -r0 pkgsrc/lang/rust/patches/patch-vendor_libc-0.2.138_src_unix_bsd_netbsdlike_netbsd_riscv64.rs
diff -r1.3 -r0 pkgsrc/lang/rust/patches/patch-vendor_libc_src_unix_bsd_netbsdlike_netbsd_riscv64.rs
diff -r1.4 -r0 pkgsrc/lang/rust/patches/patch-compiler_rustc__target_src_spec_mipsel__unknown__netbsd.rs
diff -r1.4 -r0 pkgsrc/lang/rust/patches/patch-vendor_libc_src_unix_bsd_netbsdlike_netbsd_mips.rs
diff -r1.9 -r0 pkgsrc/lang/rust/patches/patch-compiler_rustc__target_src_spec_netbsd__base.rs
diff -r1.9 -r0 pkgsrc/lang/rust/patches/patch-vendor_libc_src_unix_bsd_netbsdlike_netbsd_mod.rs
diff -r1.6 -r1.7 pkgsrc/lang/rust/patches/patch-library_backtrace_src_symbolize_gimli_elf.rs
diff -r1.21 -r1.22 pkgsrc/lang/rust/patches/patch-src_bootstrap_bootstrap.py
diff -r1.29 -r0 pkgsrc/lang/rust/patches/patch-src_bootstrap_builder.rs
diff -r1.14 -r0 pkgsrc/lang/rust/patches/patch-src_bootstrap_compile.rs
diff -r1.21 -r0 pkgsrc/lang/rust/patches/patch-src_bootstrap_lib.rs
diff -r1.12 -r1.13 pkgsrc/lang/rust/patches/patch-src_tools_rust-installer_install-template.sh
diff -r1.12 -r1.13 pkgsrc/lang/rust/patches/patch-vendor_target-lexicon_src_targets.rs
diff -r1.5 -r0 pkgsrc/lang/rust/patches/patch-vendor_libc-0.2.138_src_unix_bsd_netbsdlike_netbsd_mod.rs
diff -r1.2 -r0 pkgsrc/lang/rust/patches/patch-vendor_libc-0.2.140_src_unix_bsd_netbsdlike_netbsd_mips.rs
diff -r1.2 -r0 pkgsrc/lang/rust/patches/patch-vendor_libc-0.2.140_src_unix_bsd_netbsdlike_netbsd_mod.rs
diff -r1.2 -r0 pkgsrc/lang/rust/patches/patch-vendor_libc-0.2.140_src_unix_bsd_netbsdlike_netbsd_riscv64.rs
diff -r1.1 -r0 pkgsrc/lang/rust/patches/patch-vendor_libc-0.2.140_src_unix_solarish_mod.rs
diff -r1.13 -r1.14 pkgsrc/lang/rust/patches/patch-vendor_libc_src_unix_solarish_mod.rs
Sun Mar 3 23:53:33 2024
Thu Jan 1 09:00:00 1970
pkgsrc/lang/rust/patches/patch-src_bootstrap_src_core_build__steps_llvm.rs,v

anoncvs not yet been updated
Sun Mar 3 23:53:33 2024
Thu Jan 1 09:00:00 1970
pkgsrc/lang/rust/patches/patch-vendor_libc-0.2.149_src_unix_bsd_netbsdlike_netbsd_mips.rs,v

anoncvs not yet been updated
Sun Mar 3 23:53:33 2024
Thu Jan 1 09:00:00 1970
pkgsrc/lang/rust/patches/patch-vendor_libc-0.2.149_src_unix_bsd_netbsdlike_netbsd_mod.rs,v

anoncvs not yet been updated
Sun Mar 3 23:53:33 2024
Thu Jan 1 09:00:00 1970
pkgsrc/lang/rust/patches/patch-vendor_libc-0.2.149_src_unix_bsd_netbsdlike_netbsd_riscv64.rs,v

anoncvs not yet been updated
Sun Mar 3 23:53:33 2024
Thu Jan 1 09:00:00 1970
pkgsrc/lang/rust/patches/patch-vendor_libc-0.2.149_src_unix_solarish_mod.rs,v

anoncvs not yet been updated
Sun Mar 3 23:53:33 2024
Mon Jun 26 19:39:01 2023
pkgsrc/lang/rust/patches/patch-compiler_rustc__target_src_spec_i586__unknown__netbsd.rs,v

anoncvs not yet been updated
Sun Mar 3 23:53:33 2024
Mon Jun 26 19:39:01 2023
pkgsrc/lang/rust/patches/patch-compiler_rustc__target_src_spec_mips64el__unknown__netbsd.rs,v

anoncvs not yet been updated
Sun Mar 3 23:53:33 2024
Mon Jul 10 21:01:24 2023
pkgsrc/lang/rust/patches/patch-src_bootstrap_llvm.rs,v

anoncvs not yet been updated
Sun Mar 3 23:53:33 2024
Mon Jun 26 19:39:01 2023
pkgsrc/lang/rust/patches/patch-vendor_libc-0.2.138_src_unix_bsd_netbsdlike_netbsd_mips.rs,v

anoncvs not yet been updated
Sun Mar 3 23:53:33 2024
Mon Jul 10 21:01:24 2023
pkgsrc/lang/rust/patches/patch-vendor_libc-0.2.138_src_unix_bsd_netbsdlike_netbsd_riscv64.rs,v

anoncvs not yet been updated
Sun Mar 3 23:53:33 2024
Mon Jul 10 21:01:24 2023
pkgsrc/lang/rust/patches/patch-vendor_libc_src_unix_bsd_netbsdlike_netbsd_riscv64.rs,v

anoncvs not yet been updated
Sun Mar 3 23:53:33 2024
Mon Jun 26 19:39:01 2023
pkgsrc/lang/rust/patches/patch-compiler_rustc__target_src_spec_mipsel__unknown__netbsd.rs,v

anoncvs not yet been updated
Sun Mar 3 23:53:33 2024
Mon Jun 26 19:39:01 2023
pkgsrc/lang/rust/patches/patch-vendor_libc_src_unix_bsd_netbsdlike_netbsd_mips.rs,v

anoncvs not yet been updated
Sun Mar 3 23:53:33 2024
Mon Jun 26 19:39:01 2023
pkgsrc/lang/rust/patches/patch-compiler_rustc__target_src_spec_netbsd__base.rs,v

anoncvs not yet been updated
Sun Mar 3 23:53:33 2024
Mon Jul 10 21:01:24 2023
pkgsrc/lang/rust/patches/patch-vendor_libc_src_unix_bsd_netbsdlike_netbsd_mod.rs,v

anoncvs not yet been updated
Sun Mar 3 23:53:33 2024
Mon Jun 26 19:39:01 2023
pkgsrc/lang/rust/patches/patch-src_bootstrap_builder.rs,v

anoncvs not yet been updated
Sun Mar 3 23:53:33 2024
Mon Jun 26 19:39:01 2023
pkgsrc/lang/rust/patches/patch-src_bootstrap_compile.rs,v

anoncvs not yet been updated
Sun Mar 3 23:53:33 2024
Mon Jun 26 19:39:01 2023
pkgsrc/lang/rust/patches/patch-src_bootstrap_lib.rs,v

anoncvs not yet been updated
Sun Mar 3 23:53:33 2024
Mon Jul 10 21:01:24 2023
pkgsrc/lang/rust/patches/patch-vendor_libc-0.2.138_src_unix_bsd_netbsdlike_netbsd_mod.rs,v

anoncvs not yet been updated
Sun Mar 3 23:53:33 2024
Thu Jan 1 09:00:00 1970
pkgsrc/lang/rust/patches/patch-vendor_libc-0.2.140_src_unix_bsd_netbsdlike_netbsd_mips.rs,v

anoncvs not yet been updated
Sun Mar 3 23:53:33 2024
Thu Jan 1 09:00:00 1970
pkgsrc/lang/rust/patches/patch-vendor_libc-0.2.140_src_unix_bsd_netbsdlike_netbsd_mod.rs,v

anoncvs not yet been updated
Sun Mar 3 23:53:33 2024
Thu Jan 1 09:00:00 1970
pkgsrc/lang/rust/patches/patch-vendor_libc-0.2.140_src_unix_bsd_netbsdlike_netbsd_riscv64.rs,v

anoncvs not yet been updated
Sun Mar 3 23:53:33 2024
Thu Jan 1 09:00:00 1970
pkgsrc/lang/rust/patches/patch-vendor_libc-0.2.140_src_unix_solarish_mod.rs,v

anoncvs not yet been updated

cvs diff -r1.302 -r1.303 pkgsrc/lang/rust/Makefile (switch to unified diff)

--- pkgsrc/lang/rust/Makefile 2024/01/15 15:15:01 1.302
+++ pkgsrc/lang/rust/Makefile 2024/03/03 14:53:32 1.303
@@ -1,718 +1,707 @@ @@ -1,718 +1,707 @@
1# $NetBSD: Makefile,v 1.302 2024/01/15 15:15:01 jperkin Exp $ 1# $NetBSD: Makefile,v 1.303 2024/03/03 14:53:32 he Exp $
2 2
3DISTNAME= rustc-1.74.1-src 3DISTNAME= rustc-1.75.0-src
4PKGNAME= ${DISTNAME:S/rustc/rust/:S/-src//} 4PKGNAME= ${DISTNAME:S/rustc/rust/:S/-src//}
5CATEGORIES= lang 5CATEGORIES= lang
6PKGREVISION= 1 
7MASTER_SITES= https://static.rust-lang.org/dist/ 6MASTER_SITES= https://static.rust-lang.org/dist/
8 7
9MAINTAINER= pkgsrc-users@NetBSD.org 8MAINTAINER= pkgsrc-users@NetBSD.org
10HOMEPAGE= https://www.rust-lang.org/ 9HOMEPAGE= https://www.rust-lang.org/
11COMMENT= Safe, concurrent, practical language 10COMMENT= Safe, concurrent, practical language
12LICENSE= mit OR apache-2.0 11LICENSE= mit OR apache-2.0
13 12
14CONFLICTS+= rust-bin-[0-9]* 13CONFLICTS+= rust-bin-[0-9]*
15 14
16# LLVM uses -std=c++17 15# LLVM uses -std=c++17
17USE_CXX_FEATURES+= c++17 16USE_CXX_FEATURES+= c++17
18 
19USE_GCC_RUNTIME= yes 17USE_GCC_RUNTIME= yes
20USE_LANGUAGES= c c++17 18USE_LANGUAGES= c c++
21USE_LIBTOOL= yes 19USE_LIBTOOL= yes
22USE_TOOLS+= bash grep gmake perl:build pkg-config 20USE_TOOLS+= bash grep gmake perl:build pkg-config
23 21
24# The NetBSD bootstraps are built for NetBSD 8 (because rust doesn't 22# The NetBSD bootstraps are built for NetBSD 8 (because rust doesn't
25# build on 7). Mark earlier versions as broken. 23# build on 7). Mark earlier versions as broken.
26BROKEN_ON_PLATFORM+= NetBSD-[1-7].*-* 24BROKEN_ON_PLATFORM+= NetBSD-[1-7].*-*
27# Bootstrap is built for NetBSD 9.x on these platforms: 25# Bootstrap is built for NetBSD 9.x on these platforms:
28BROKEN_ON_PLATFORM+= NetBSD-8.*-*arm* 26BROKEN_ON_PLATFORM+= NetBSD-8.*-*arm*
29BROKEN_ON_PLATFORM+= NetBSD-8.*-aarch64 27BROKEN_ON_PLATFORM+= NetBSD-8.*-aarch64
30BROKEN_ON_PLATFORM+= NetBSD-8.*-sparc64 28BROKEN_ON_PLATFORM+= NetBSD-8.*-sparc64
31BROKEN_ON_PLATFORM+= NetBSD-8.*-powerpc 29BROKEN_ON_PLATFORM+= NetBSD-8.*-powerpc
32BROKEN_ON_PLATFORM+= NetBSD-8.*-i386 30BROKEN_ON_PLATFORM+= NetBSD-8.*-i386
33 31
34HAS_CONFIGURE= yes 32HAS_CONFIGURE= yes
35PYTHON_FOR_BUILD_ONLY= yes 33PYTHON_FOR_BUILD_ONLY= yes
36CONFIG_SHELL= ${PYTHONBIN} 34CONFIG_SHELL= ${PYTHONBIN}
37CONFIGURE_SCRIPT= src/bootstrap/configure.py 35CONFIGURE_SCRIPT= src/bootstrap/configure.py
38CONFIGURE_ARGS+= --prefix=${PREFIX} 36CONFIGURE_ARGS+= --prefix=${PREFIX}
39CONFIGURE_ARGS+= --mandir=${PREFIX}/${PKGMANDIR} 37CONFIGURE_ARGS+= --mandir=${PREFIX}/${PKGMANDIR}
40CONFIGURE_ARGS+= --sysconfdir=${PKG_SYSCONFDIR} 38CONFIGURE_ARGS+= --sysconfdir=${PKG_SYSCONFDIR}
41CONFIGURE_ARGS+= --python=${PYTHONBIN} 39CONFIGURE_ARGS+= --python=${PYTHONBIN}
42CONFIGURE_ARGS+= --release-channel=stable 40CONFIGURE_ARGS+= --release-channel=stable
43CONFIGURE_ARGS+= --local-rust-root=${RUST_BOOTSTRAP_PATH} 41CONFIGURE_ARGS+= --local-rust-root=${RUST_BOOTSTRAP_PATH}
44CONFIGURE_ARGS+= --enable-extended # Build and install cargo too. 42CONFIGURE_ARGS+= --enable-extended # Build and install cargo too.
45CONFIGURE_ARGS+= --enable-rpath 43CONFIGURE_ARGS+= --enable-rpath
46CONFIGURE_ARGS+= --disable-codegen-tests 44CONFIGURE_ARGS+= --disable-codegen-tests
47CONFIGURE_ARGS+= --disable-compiler-docs 45CONFIGURE_ARGS+= --disable-compiler-docs
48CONFIGURE_ARGS+= --disable-llvm-static-stdcpp 46CONFIGURE_ARGS+= --disable-llvm-static-stdcpp
49CONFIGURE_ARGS+= --disable-ninja 47CONFIGURE_ARGS+= --disable-ninja
50CONFIGURE_ARGS+= --dist-compression-formats=xz 48CONFIGURE_ARGS+= --dist-compression-formats=xz
51 49
52# Include (optional) settings to cross-build rust 50# Include (optional) settings to cross-build rust
53.include "cross.mk" 51.include "cross.mk"
54 52
55# optional from do-cross.mk 53# optional from do-cross.mk
56CONFIGURE_ARGS+= ${ADD_CONFIGURE_ARGS} 54CONFIGURE_ARGS+= ${ADD_CONFIGURE_ARGS}
57 55
58# Getting RPATH with $ORIGIN into bootstrap may be troublesome, so 56# Getting RPATH with $ORIGIN into bootstrap may be troublesome, so
59# uncommenting the LD_LIBRARY_PATH setting may be required to run 57# uncommenting the LD_LIBRARY_PATH setting may be required to run
60# the bootstrap 58# the bootstrap
61PKGSRC_MAKE_ENV+= LD_LIBRARY_PATH=${RUST_BOOTSTRAP_PATH:Q}/lib 59PKGSRC_MAKE_ENV+= LD_LIBRARY_PATH=${RUST_BOOTSTRAP_PATH:Q}/lib
62 60
63# This should allow us to perform "offline" builds (so cargo doesn't fetch 61# This should allow us to perform "offline" builds (so cargo doesn't fetch
64# dependencies during the build stage) but this isn't hooked up yet. 62# dependencies during the build stage) but this isn't hooked up yet.
65CONFIGURE_ARGS+= --enable-vendor 63CONFIGURE_ARGS+= --enable-vendor
66 64
67# cargo defaults to using the number of available CPUs 65# cargo defaults to using the number of available CPUs
68MAKE_ENV+= CARGO_BUILD_JOBS=${_MAKE_JOBS_N} 66MAKE_ENV+= CARGO_BUILD_JOBS=${_MAKE_JOBS_N}
69 67
70# Rust builds some bundled components with strict version requirements, ensure 68# Rust builds some bundled components with strict version requirements, ensure
71# that any conflicting packages pulled in via dependencies are not buildlinked. 69# that any conflicting packages pulled in via dependencies are not buildlinked.
72BUILDLINK_FILES_CMD.libssh2= ${TRUE} 70BUILDLINK_FILES_CMD.libssh2= ${TRUE}
73BUILDLINK_FILES_CMD.xz= ${TRUE} 71BUILDLINK_FILES_CMD.xz= ${TRUE}
74MAKE_ENV+= LZMA_API_STATIC=1 72MAKE_ENV+= LZMA_API_STATIC=1
75 73
76# MacOS X 10.7 is the oldest supported version. See 74# MacOS X 10.7 is the oldest supported version. See
77# ${WRKSRC}/src/bootstrap/lib.rs 75# ${WRKSRC}/src/bootstrap/lib.rs
78MAKE_ENV.Darwin+= MACOSX_DEPLOYMENT_TARGET="10.7" 76MAKE_ENV.Darwin+= MACOSX_DEPLOYMENT_TARGET="10.7"
79 77
80CFLAGS.SunOS+= -D_POSIX_PTHREAD_SEMANTICS 78CFLAGS.SunOS+= -D_POSIX_PTHREAD_SEMANTICS
81MAKE_ENV.SunOS+= AR=gar 79MAKE_ENV.SunOS+= AR=gar
82 80
83# Debugging of crate resolution 81# Debugging of crate resolution
84# Annoyingly, this makes the powerpc build succeed... 82# Annoyingly, this makes the powerpc build succeed...
85#MAKE_ENV+= RUSTC_LOG=rustc_metadata 83#MAKE_ENV+= RUSTC_LOG=rustc_metadata
86 84
87UNLIMIT_RESOURCES+= cputime stacksize datasize virtualsize 85UNLIMIT_RESOURCES+= cputime stacksize datasize virtualsize
88 86
89TEST_TARGET= check 87TEST_TARGET= check
90 88
91# bin/* lib/*, but names vary 89# bin/* lib/*, but names vary
92CHECK_RELRO_SUPPORTED= no 90CHECK_RELRO_SUPPORTED= no
93CHECK_SSP_SUPPORTED= no 91CHECK_SSP_SUPPORTED= no
94 92
95.include "../../mk/bsd.prefs.mk" 93.include "../../mk/bsd.prefs.mk"
96 94
97# Allow overriding MAKE_JOBS_SAFE 95# Allow overriding MAKE_JOBS_SAFE
98# some may chose to mostly build faster, 96# some may chose to mostly build faster,
99# and deal with any failures due to deadlocks 97# and deal with any failures due to deadlocks
100.if !empty(rust.MAKE_JOBS_SAFE) 98.if !empty(rust.MAKE_JOBS_SAFE)
101. if ${rust.MAKE_JOBS_SAFE:tl} == "yes" 99. if ${rust.MAKE_JOBS_SAFE:tl} == "yes"
102MAKE_JOBS_SAFE= yes 100MAKE_JOBS_SAFE= yes
103. endif 101. endif
104.endif 102.endif
105 103
106.if !empty(rust.BUILD_TARGET) 104.if !empty(rust.BUILD_TARGET)
107BUILD_TARGET= ${rust.BUILD_TARGET} 105BUILD_TARGET= ${rust.BUILD_TARGET}
108.endif 106.endif
109 107
110.if !empty(TARGET) 108.if !empty(TARGET)
111# Use "dist" build target for cross compile of bootstrap 109# Use "dist" build target for cross compile of bootstrap
112BUILD_TARGET?= dist 110BUILD_TARGET?= dist
113.else 111.else
114BUILD_TARGET?= build 112BUILD_TARGET?= build
115.endif 113.endif
116 114
117.if ${MACHINE_PLATFORM:MNetBSD-*-powerpc} || \ 115.if ${MACHINE_PLATFORM:MNetBSD-*-powerpc} || \
118 ${MACHINE_PLATFORM:MNetBSD-*-earmv[67]hf} || \ 116 ${MACHINE_PLATFORM:MNetBSD-*-earmv[67]hf} || \
119 ${MACHINE_PLATFORM:MNetBSD-*-mipsel} || \ 117 ${MACHINE_PLATFORM:MNetBSD-*-mipsel} || \
120 !empty(TARGET:Marmv[67]-unknown-netbsd-eabihf) || \ 118 !empty(TARGET:Marmv[67]-unknown-netbsd-eabihf) || \
121 !empty(TARGET:Mmipsel-unknown-netbsd) 119 !empty(TARGET:Mmipsel-unknown-netbsd)
122# Bootstrapping on NetBSD/powerpc requires no debug-info from rustc 120# Bootstrapping on NetBSD/powerpc requires no debug-info from rustc
123# (both for amd64->powerpc built and powerpc->powerpc built bootstrap bits) 121# (both for amd64->powerpc built and powerpc->powerpc built bootstrap bits)
124# Also try to downsize the armv[67] build. 122# Also try to downsize the armv[67] build.
125CONFIGURE_ARGS+= --disable-debug 123CONFIGURE_ARGS+= --disable-debug
126CONFIGURE_ARGS+= --disable-debug-assertions 124CONFIGURE_ARGS+= --disable-debug-assertions
127CONFIGURE_ARGS+= --disable-llvm-release-debuginfo 125CONFIGURE_ARGS+= --disable-llvm-release-debuginfo
128CONFIGURE_ARGS+= --debuginfo-level=0 126CONFIGURE_ARGS+= --debuginfo-level=0
129CONFIGURE_ARGS+= --debuginfo-level-rustc=0 127CONFIGURE_ARGS+= --debuginfo-level-rustc=0
130CONFIGURE_ARGS+= --debuginfo-level-std=0 128CONFIGURE_ARGS+= --debuginfo-level-std=0
131CONFIGURE_ARGS+= --debuginfo-level-tools=0 129CONFIGURE_ARGS+= --debuginfo-level-tools=0
132CONFIGURE_ARGS+= --debuginfo-level-tests=0 130CONFIGURE_ARGS+= --debuginfo-level-tests=0
133.endif 131.endif
134 132
135# Only build the ARM target on/for this host, due to resource constraints 133# Only build the ARM target on/for this host, due to resource constraints
136.if ${MACHINE_PLATFORM:MNetBSD-*-earmv[67]hf} 134.if ${MACHINE_PLATFORM:MNetBSD-*-earmv[67]hf}
137CONFIGURE_ARGS+= --set llvm.targets="ARM" 135CONFIGURE_ARGS+= --set llvm.targets="ARM"
138.endif 136.endif
139# When cross-building for ARM on X86, X86 needs to go along due 137# When cross-building for ARM on X86, X86 needs to go along due
140# to 2-stage build process 138# to 2-stage build process
141.if !empty(TARGET:Marmv[67]-unknown-netbsd-eabihf) 139.if !empty(TARGET:Marmv[67]-unknown-netbsd-eabihf)
142CONFIGURE_ARGS+= --set llvm.targets="ARM;X86" 140CONFIGURE_ARGS+= --set llvm.targets="ARM;X86"
143.endif 141.endif
144# Same for mips: 142# Same for mips:
145.if ${MACHINE_PLATFORM:MNetBSD-*-mipsel} 143.if ${MACHINE_PLATFORM:MNetBSD-*-mipsel}
146CONFIGURE_ARGS+= --set llvm.targets="Mips" 144CONFIGURE_ARGS+= --set llvm.targets="Mips"
147.endif 145.endif
148.if !empty(TARGET:Mmipsel-unknown-netbsd) 146.if !empty(TARGET:Mmipsel-unknown-netbsd)
149CONFIGURE_ARGS+= --set llvm.targets="Mips;X86" 147CONFIGURE_ARGS+= --set llvm.targets="Mips;X86"
150.endif 148.endif
151 149
152CHECK_INTERPRETER_SKIP+= lib/rustlib/src/rust/library/backtrace/ci/android-sdk.sh 150CHECK_INTERPRETER_SKIP+= lib/rustlib/src/rust/library/backtrace/ci/android-sdk.sh
153CHECK_INTERPRETER_SKIP+= lib/rustlib/src/rust/library/backtrace/ci/debuglink.sh 151CHECK_INTERPRETER_SKIP+= lib/rustlib/src/rust/library/backtrace/ci/debuglink.sh
154CHECK_INTERPRETER_SKIP+= lib/rustlib/src/rust/library/backtrace/ci/run.sh 152CHECK_INTERPRETER_SKIP+= lib/rustlib/src/rust/library/backtrace/ci/run.sh
155CHECK_INTERPRETER_SKIP+= lib/rustlib/src/rust/library/backtrace/ci/run-docker.sh 153CHECK_INTERPRETER_SKIP+= lib/rustlib/src/rust/library/backtrace/ci/run-docker.sh
156CHECK_INTERPRETER_SKIP+= lib/rustlib/src/rust/library/core/src/unicode/printable.py 154CHECK_INTERPRETER_SKIP+= lib/rustlib/src/rust/library/core/src/unicode/printable.py
157CHECK_INTERPRETER_SKIP+= lib/rustlib/src/rust/library/stdarch/ci/build-std-detect.sh 155CHECK_INTERPRETER_SKIP+= lib/rustlib/src/rust/library/stdarch/ci/build-std-detect.sh
158CHECK_INTERPRETER_SKIP+= lib/rustlib/src/rust/library/stdarch/ci/dox.sh 156CHECK_INTERPRETER_SKIP+= lib/rustlib/src/rust/library/stdarch/ci/dox.sh
159CHECK_INTERPRETER_SKIP+= lib/rustlib/src/rust/library/stdarch/ci/run-docker.sh 157CHECK_INTERPRETER_SKIP+= lib/rustlib/src/rust/library/stdarch/ci/run-docker.sh
160CHECK_INTERPRETER_SKIP+= lib/rustlib/src/rust/library/stdarch/ci/run.sh 158CHECK_INTERPRETER_SKIP+= lib/rustlib/src/rust/library/stdarch/ci/run.sh
161CHECK_INTERPRETER_SKIP+= lib/rustlib/src/rust/library/stdarch/ci/style.sh 159CHECK_INTERPRETER_SKIP+= lib/rustlib/src/rust/library/stdarch/ci/style.sh
162 160
163CHECK_PORTABILITY_SKIP+= tests/run-make/dump-ice-to-disk/check.sh 161CHECK_PORTABILITY_SKIP+= tests/run-make/dump-ice-to-disk/check.sh
164 162
165.if ${OPSYS} == "NetBSD" 163.if ${OPSYS} == "NetBSD"
166# This block contains information about known trouble on NetBSD and workarounds. 164# This block contains information about known trouble on NetBSD and workarounds.
167 165
168# Parallel builds failed on NetBSD due to dynamic linker locking bugs. 166# Parallel builds failed on NetBSD due to dynamic linker locking bugs.
169# \todo Explain if the build is believed to be sound if not parallel, 167# \todo Explain if the build is believed to be sound if not parallel,
170# or if a non-parallel build is merely more likely to work. 168# or if a non-parallel build is merely more likely to work.
171# 169#
172# See toolchain/54192 at 170# See toolchain/54192 at
173# http://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=54192 171# http://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=54192
174# which was fixed in -current on 2020-04-19: 172# which was fixed in -current on 2020-04-19:
175# http://mail-index.netbsd.org/source-changes/2020/04/16/msg116256.html 173# http://mail-index.netbsd.org/source-changes/2020/04/16/msg116256.html
176# http://mail-index.netbsd.org/source-changes/2020/04/19/msg116337.html 174# http://mail-index.netbsd.org/source-changes/2020/04/19/msg116337.html
177# These were pulled up to netbsd-9 on 2020-05-13: 175# These were pulled up to netbsd-9 on 2020-05-13:
178# http://releng.netbsd.org/cgi-bin/req-9.cgi?show=907 176# http://releng.netbsd.org/cgi-bin/req-9.cgi?show=907
179# This has not been pulled up to netbsd-8 177# This has not been pulled up to netbsd-8
180# \todo Explain if it's not applicable, shouldn't be pulled up, should be 178# \todo Explain if it's not applicable, shouldn't be pulled up, should be
181# but hasn't, is too hard, etc. 179# but hasn't, is too hard, etc.
182# 180#
183# On pkgbuild for 2020Q1 9.0_RELEASE amd64, rust did not build despite 181# On pkgbuild for 2020Q1 9.0_RELEASE amd64, rust did not build despite
184# MAKE_JOBS_SAFE=no, but setting MAKE_JOBS=1 resulted in success. (No 182# MAKE_JOBS_SAFE=no, but setting MAKE_JOBS=1 resulted in success. (No
185# PR is open for this.) \todo Understand and fix. 183# PR is open for this.) \todo Understand and fix.
186# 184#
187# If we aren't on 9-current, and are on 8.x or 9.x, avoid parallel. 185# If we aren't on 9-current, and are on 8.x or 9.x, avoid parallel.
188# Release 9.x and 9.1 or later is OK. 186# Release 9.x and 9.1 or later is OK.
189. if ${OPSYS} == "NetBSD" && 090999 < ${OPSYS_VERSION} && ${OPSYS_VERSION} < 090900 187. if ${OPSYS} == "NetBSD" && 090999 < ${OPSYS_VERSION} && ${OPSYS_VERSION} < 090900
190MAKE_JOBS_SAFE?= no 188MAKE_JOBS_SAFE?= no
191. endif 189. endif
192 190
193# Open PRs 191# Open PRs
194# 192#
195# Broken package with PREFIX not /usr/pkg: 193# Broken package with PREFIX not /usr/pkg:
196# http://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=54453 194# http://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=54453
197# 195#
198 196
199.endif 197.endif
200 198
201# 199#
202# Under NetBSD, do not use DT_RUNPATH 200# Under NetBSD, do not use DT_RUNPATH
203# 201#
204BUILDLINK_TRANSFORM.NetBSD+= rm:-Wl,--enable-new-dtags 202BUILDLINK_TRANSFORM.NetBSD+= rm:-Wl,--enable-new-dtags
205 203
206# 204#
207# Somewhere in the LLVM build "-arch x86_64" is passed on macOS/arm64 which 205# Somewhere in the LLVM build "-arch x86_64" is passed on macOS/arm64 which
208# breaks linking, see https://github.com/rust-lang/rust/issues/81790. Until 206# breaks linking, see https://github.com/rust-lang/rust/issues/81790. Until
209# this can be located (proving difficult!) we just force it. 207# this can be located (proving difficult!) we just force it.
210# 208#
211.if ${MACHINE_PLATFORM:MDarwin-*-aarch64} 209.if ${MACHINE_PLATFORM:MDarwin-*-aarch64}
212BUILDLINK_TRANSFORM+= opt:x86_64:arm64 210BUILDLINK_TRANSFORM+= opt:x86_64:arm64
213.endif 211.endif
214 212
215# 213#
216# Rust unfortunately requires itself to build. On platforms which aren't 214# Rust unfortunately requires itself to build. On platforms which aren't
217# supported by upstream (where they offer binary bootstraps), or where we do 215# supported by upstream (where they offer binary bootstraps), or where we do
218# not trust random binaries from the Internet, we need to build and provide our 216# not trust random binaries from the Internet, we need to build and provide our
219# own bootstrap. See the stage0-bootstrap below for more details. 217# own bootstrap. See the stage0-bootstrap below for more details.
220# 218#
221DISTFILES:= ${DEFAULT_DISTFILES} 219DISTFILES:= ${DEFAULT_DISTFILES}
222 220
223.if ${MACHINE_PLATFORM:MDarwin-*-aarch64} || make(distinfo) || make (makesum) || make(mdi) 221.if ${MACHINE_PLATFORM:MDarwin-*-aarch64} || make(distinfo) || make (makesum) || make(mdi)
224RUST_STAGE0_VER= 1.73.0 222RUST_STAGE0_VER= 1.74.1
225RUST_ARCH:= aarch64-apple-darwin 223RUST_ARCH:= aarch64-apple-darwin
226RUST_STAGE0:= rust-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.gz 224RUST_STAGE0:= rust-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.gz
227RUST_STD_STAGE0:= rust-std-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.gz 225RUST_STD_STAGE0:= rust-std-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.gz
228DISTFILES:= ${DISTFILES} ${RUST_STAGE0} ${RUST_STD_STAGE0} 226DISTFILES:= ${DISTFILES} ${RUST_STAGE0} ${RUST_STD_STAGE0}
229.endif 227.endif
230.if ${MACHINE_PLATFORM:MDarwin-*-x86_64} || make(distinfo) || make (makesum) || make(mdi) 228.if ${MACHINE_PLATFORM:MDarwin-*-x86_64} || make(distinfo) || make (makesum) || make(mdi)
231RUST_STAGE0_VER= 1.73.0 229RUST_STAGE0_VER= 1.74.1
232RUST_ARCH:= x86_64-apple-darwin 230RUST_ARCH:= x86_64-apple-darwin
233RUST_STAGE0:= rust-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.gz 231RUST_STAGE0:= rust-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.gz
234RUST_STD_STAGE0:= rust-std-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.gz 232RUST_STD_STAGE0:= rust-std-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.gz
235DISTFILES:= ${DISTFILES} ${RUST_STAGE0} ${RUST_STD_STAGE0} 233DISTFILES:= ${DISTFILES} ${RUST_STAGE0} ${RUST_STD_STAGE0}
236.endif 234.endif
237.if ${MACHINE_PLATFORM:MLinux-*-aarch64} || make(distinfo) || make (makesum) || make(mdi) 235.if ${MACHINE_PLATFORM:MLinux-*-aarch64} || make(distinfo) || make (makesum) || make(mdi)
238RUST_STAGE0_VER= 1.73.0 236RUST_STAGE0_VER= 1.74.1
239RUST_ARCH:= aarch64-unknown-linux-gnu 237RUST_ARCH:= aarch64-unknown-linux-gnu
240RUST_STAGE0:= rust-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.gz 238RUST_STAGE0:= rust-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.gz
241RUST_STD_STAGE0:= rust-std-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.gz 239RUST_STD_STAGE0:= rust-std-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.gz
242DISTFILES:= ${DISTFILES} ${RUST_STAGE0} ${RUST_STD_STAGE0} 240DISTFILES:= ${DISTFILES} ${RUST_STAGE0} ${RUST_STD_STAGE0}
243.endif 241.endif
244.if ${MACHINE_PLATFORM:MLinux-*-earmv6hf} || make(distinfo) || make (makesum) || make(mdi) 242.if ${MACHINE_PLATFORM:MLinux-*-earmv6hf} || make(distinfo) || make (makesum) || make(mdi)
245RUST_STAGE0_VER= 1.73.0 243RUST_STAGE0_VER= 1.74.1
246RUST_ARCH:= arm-unknown-linux-gnueabihf 244RUST_ARCH:= arm-unknown-linux-gnueabihf
247RUST_STAGE0:= rust-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.gz 245RUST_STAGE0:= rust-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.gz
248RUST_STD_STAGE0:= rust-std-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.gz 246RUST_STD_STAGE0:= rust-std-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.gz
249DISTFILES:= ${DISTFILES} ${RUST_STAGE0} ${RUST_STD_STAGE0} 247DISTFILES:= ${DISTFILES} ${RUST_STAGE0} ${RUST_STD_STAGE0}
250.endif 248.endif
251.if ${MACHINE_PLATFORM:MLinux-*-earmv7hf} || make(distinfo) || make (makesum) || make(mdi) 249.if ${MACHINE_PLATFORM:MLinux-*-earmv7hf} || make(distinfo) || make (makesum) || make(mdi)
252RUST_STAGE0_VER= 1.73.0 250RUST_STAGE0_VER= 1.74.1
253RUST_ARCH:= armv7-unknown-linux-gnueabihf 251RUST_ARCH:= armv7-unknown-linux-gnueabihf
254RUST_STAGE0:= rust-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.gz 252RUST_STAGE0:= rust-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.gz
255RUST_STD_STAGE0:= rust-std-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.gz 253RUST_STD_STAGE0:= rust-std-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.gz
256DISTFILES:= ${DISTFILES} ${RUST_STAGE0} ${RUST_STD_STAGE0} 254DISTFILES:= ${DISTFILES} ${RUST_STAGE0} ${RUST_STD_STAGE0}
257.endif 255.endif
258.if ${MACHINE_PLATFORM:MLinux-*-i386} || make(distinfo) || make (makesum) || make(mdi) 256.if ${MACHINE_PLATFORM:MLinux-*-i386} || make(distinfo) || make (makesum) || make(mdi)
259RUST_STAGE0_VER= 1.73.0 257RUST_STAGE0_VER= 1.74.1
260RUST_ARCH:= i686-unknown-linux-gnu 258RUST_ARCH:= i686-unknown-linux-gnu
261RUST_STAGE0:= rust-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.gz 259RUST_STAGE0:= rust-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.gz
262RUST_STD_STAGE0:= rust-std-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.gz 260RUST_STD_STAGE0:= rust-std-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.gz
263DISTFILES:= ${DISTFILES} ${RUST_STAGE0} ${RUST_STD_STAGE0} 261DISTFILES:= ${DISTFILES} ${RUST_STAGE0} ${RUST_STD_STAGE0}
264.endif 262.endif
265.if ${MACHINE_PLATFORM:MLinux-*-x86_64} || make(distinfo) || make (makesum) || make(mdi) 263.if ${MACHINE_PLATFORM:MLinux-*-x86_64} || make(distinfo) || make (makesum) || make(mdi)
266RUST_STAGE0_VER= 1.73.0 264RUST_STAGE0_VER= 1.74.1
267RUST_ARCH:= x86_64-unknown-linux-gnu 265RUST_ARCH:= x86_64-unknown-linux-gnu
268RUST_STAGE0:= rust-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.gz 266RUST_STAGE0:= rust-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.gz
269RUST_STD_STAGE0:= rust-std-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.gz 267RUST_STD_STAGE0:= rust-std-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.gz
270DISTFILES:= ${DISTFILES} ${RUST_STAGE0} ${RUST_STD_STAGE0} 268DISTFILES:= ${DISTFILES} ${RUST_STAGE0} ${RUST_STD_STAGE0}
271.endif 269.endif
272# 270#
273# The SunOS target defaults to illumos as that's what the current bootstraps 271# The SunOS target defaults to illumos as that's what the current bootstraps
274# are built on. If you wish to target Oracle Solaris you'll need to create an 272# are built on. If you wish to target Oracle Solaris you'll need to create an
275# x86_64-sun-solaris bootstrap and comment out the overrides. 273# x86_64-sun-solaris bootstrap and comment out the overrides.
276# 274#
277.if ${MACHINE_PLATFORM:MSunOS-*-x86_64} || make(distinfo) || make (makesum) || make(mdi) 275.if ${MACHINE_PLATFORM:MSunOS-*-x86_64} || make(distinfo) || make (makesum) || make(mdi)
278RUST_STAGE0_VER= 1.73.0 276RUST_STAGE0_VER= 1.74.1
279RUST_ARCH:= x86_64-unknown-illumos 277RUST_ARCH:= x86_64-unknown-illumos
280RUST_STAGE0:= rust-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.gz 278RUST_STAGE0:= rust-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.gz
281SITES.${RUST_STAGE0}= https://us-central.manta.mnx.io/pkgsrc/public/pkg-bootstraps/ 279SITES.${RUST_STAGE0}= https://us-central.manta.mnx.io/pkgsrc/public/pkg-bootstraps/
282DISTFILES:= ${DISTFILES} ${RUST_STAGE0} 280DISTFILES:= ${DISTFILES} ${RUST_STAGE0}
283RUST_BOOTSTRAP_PATH?= ${WRKDIR}/rust-${RUST_STAGE0_VER}-${RUST_ARCH} 281RUST_BOOTSTRAP_PATH?= ${WRKDIR}/rust-${RUST_STAGE0_VER}-${RUST_ARCH}
284# Override default "x86_64-sun-solaris" selection 282# Override default "x86_64-sun-solaris" selection
285CONFIGURE_ARGS+= --set=target.${RUST_ARCH}.llvm-config=${LLVM_CONFIG_PATH} 283CONFIGURE_ARGS+= --set=target.${RUST_ARCH}.llvm-config=${LLVM_CONFIG_PATH}
286CONFIGURE_ARGS+= --build=${RUST_ARCH} 284CONFIGURE_ARGS+= --build=${RUST_ARCH}
287CONFIGURE_ARGS+= --host=${RUST_ARCH} 285CONFIGURE_ARGS+= --host=${RUST_ARCH}
288CONFIGURE_ARGS+= --target=${RUST_ARCH} 286CONFIGURE_ARGS+= --target=${RUST_ARCH}
289.endif 287.endif
290.if ${MACHINE_PLATFORM:MFreeBSD-*-x86_64} || make(distinfo) || make (makesum) || make(mdi) 288.if ${MACHINE_PLATFORM:MFreeBSD-*-x86_64} || make(distinfo) || make (makesum) || make(mdi)
291RUST_STAGE0_VER= 1.73.0 289RUST_STAGE0_VER= 1.74.1
292RUST_ARCH:= x86_64-unknown-freebsd 290RUST_ARCH:= x86_64-unknown-freebsd
293RUST_STAGE0:= rust-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.gz 291RUST_STAGE0:= rust-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.gz
294RUST_STD_STAGE0:= rust-std-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.gz 292RUST_STD_STAGE0:= rust-std-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.gz
295DISTFILES:= ${DISTFILES} ${RUST_STAGE0} ${RUST_STD_STAGE0} 293DISTFILES:= ${DISTFILES} ${RUST_STAGE0} ${RUST_STD_STAGE0}
296.endif 294.endif
297.if ${MACHINE_PLATFORM:MNetBSD-*-i386} || make(distinfo) || make (makesum) || make(mdi) 295.if ${MACHINE_PLATFORM:MNetBSD-*-i386} || make(distinfo) || make (makesum) || make(mdi)
298RUST_STAGE0_VER= 1.73.0 296RUST_STAGE0_VER= 1.74.1
299RUST_ARCH= i586-unknown-netbsd 297RUST_ARCH= i586-unknown-netbsd
300RUST_STAGE0:= rust-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.xz 298RUST_STAGE0:= rust-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.xz
301RUST_STD_STAGE0:= rust-std-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.xz 299RUST_STD_STAGE0:= rust-std-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.xz
302SITES.${RUST_STAGE0}= ${MASTER_SITE_LOCAL:=rust/} 300SITES.${RUST_STAGE0}= ${MASTER_SITE_LOCAL:=rust/}
303SITES.${RUST_STD_STAGE0}= ${MASTER_SITE_LOCAL:=rust/} 301SITES.${RUST_STD_STAGE0}= ${MASTER_SITE_LOCAL:=rust/}
304DISTFILES:= ${DISTFILES} ${RUST_STAGE0} ${RUST_STD_STAGE0} 302DISTFILES:= ${DISTFILES} ${RUST_STAGE0} ${RUST_STD_STAGE0}
305# Setting this changes it for every distfile, which doesn't match what is 303# Setting this changes it for every distfile, which doesn't match what is
306# currently in distinfo. 304# currently in distinfo.
307#DIST_SUBDIR= ${PKGNAME} 305#DIST_SUBDIR= ${PKGNAME}
308# For atomic ops 306# For atomic ops
309CFLAGS+= -march=i586 307CFLAGS+= -march=i586
310CONFIGURE_ARGS+= --build=${RUST_ARCH} 308CONFIGURE_ARGS+= --build=${RUST_ARCH}
311pre-build: pre-build-fix-paxctl 309pre-build: pre-build-fix-paxctl
312.PHONY: pre-build-fix-paxctl 310.PHONY: pre-build-fix-paxctl
313pre-build-fix-paxctl: 311pre-build-fix-paxctl:
314 ${TOOLS_PLATFORM.paxctl} +am ${WRKDIR}/rust-bootstrap/bin/cargo 312 ${TOOLS_PLATFORM.paxctl} +am ${WRKDIR}/rust-bootstrap/bin/cargo
315 ${TOOLS_PLATFORM.paxctl} +am ${WRKDIR}/rust-bootstrap/bin/rustc 313 ${TOOLS_PLATFORM.paxctl} +am ${WRKDIR}/rust-bootstrap/bin/rustc
316.endif 314.endif
317.if ${MACHINE_PLATFORM:MNetBSD-*-x86_64} || make(distinfo) || make (makesum) || make(mdi) 315.if ${MACHINE_PLATFORM:MNetBSD-*-x86_64} || make(distinfo) || make (makesum) || make(mdi)
318RUST_STAGE0_VER= 1.73.0 316RUST_STAGE0_VER= 1.74.1
319RUST_ARCH= x86_64-unknown-netbsd 317RUST_ARCH= x86_64-unknown-netbsd
320RUST_STAGE0:= rust-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.xz 318RUST_STAGE0:= rust-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.xz
321RUST_STD_STAGE0:= rust-std-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.xz 319RUST_STD_STAGE0:= rust-std-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.xz
322DISTFILES:= ${DISTFILES} ${RUST_STAGE0} ${RUST_STD_STAGE0} 320DISTFILES:= ${DISTFILES} ${RUST_STAGE0} ${RUST_STD_STAGE0}
323.endif 321.endif
324.if ${MACHINE_PLATFORM:MNetBSD-*-powerpc} || make(distinfo) || make (makesum) || make(mdi) 322.if ${MACHINE_PLATFORM:MNetBSD-*-powerpc} || make(distinfo) || make (makesum) || make(mdi)
325RUST_STAGE0_VER= 1.73.0 323RUST_STAGE0_VER= 1.74.1
326RUST_ARCH= powerpc-unknown-netbsd-nb1 324RUST_ARCH= powerpc-unknown-netbsd
327 325
328# Cross-built against NetBSD 9.0 326# Cross-built against NetBSD 9.0
329RUST_STAGE0:= rust-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.xz 327RUST_STAGE0:= rust-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.xz
330RUST_STD_STAGE0:= rust-std-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.xz 328RUST_STD_STAGE0:= rust-std-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.xz
331DISTFILES:= ${DISTFILES} ${RUST_STAGE0} ${RUST_STD_STAGE0} 329DISTFILES:= ${DISTFILES} ${RUST_STAGE0} ${RUST_STD_STAGE0}
332SITES.${RUST_STAGE0}= ${MASTER_SITE_LOCAL:=rust/} 330SITES.${RUST_STAGE0}= ${MASTER_SITE_LOCAL:=rust/}
333SITES.${RUST_STD_STAGE0}= ${MASTER_SITE_LOCAL:=rust/} 331SITES.${RUST_STD_STAGE0}= ${MASTER_SITE_LOCAL:=rust/}
334 332
335.endif 333.endif
336.if ${MACHINE_PLATFORM:MNetBSD-*-aarch64} || make(distinfo) || make (makesum) || make(mdi) 334.if ${MACHINE_PLATFORM:MNetBSD-*-aarch64} || make(distinfo) || make (makesum) || make(mdi)
337RUST_STAGE0_VER= 1.73.0 335RUST_STAGE0_VER= 1.74.1
338RUST_ARCH= aarch64-unknown-netbsd 336RUST_ARCH= aarch64-unknown-netbsd
339RUST_STAGE0:= rust-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.xz 337RUST_STAGE0:= rust-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.xz
340RUST_STD_STAGE0:= rust-std-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.xz 338RUST_STD_STAGE0:= rust-std-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.xz
341DISTFILES:= ${DISTFILES} ${RUST_STAGE0} ${RUST_STD_STAGE0} 339DISTFILES:= ${DISTFILES} ${RUST_STAGE0} ${RUST_STD_STAGE0}
342SITES.${RUST_STAGE0}= ${MASTER_SITE_LOCAL:=rust/} 340SITES.${RUST_STAGE0}= ${MASTER_SITE_LOCAL:=rust/}
343SITES.${RUST_STD_STAGE0}= ${MASTER_SITE_LOCAL:=rust/} 341SITES.${RUST_STD_STAGE0}= ${MASTER_SITE_LOCAL:=rust/}
344.endif 342.endif
345.if ${MACHINE_PLATFORM:MNetBSD-*-aarch64eb} || make(distinfo) || make (makesum) || make(mdi) 343.if ${MACHINE_PLATFORM:MNetBSD-*-aarch64eb} || make(distinfo) || make (makesum) || make(mdi)
346RUST_STAGE0_VER= 1.73.0 344RUST_STAGE0_VER= 1.74.1
347RUST_ARCH= aarch64_be-unknown-netbsd 345RUST_ARCH= aarch64_be-unknown-netbsd
348RUST_STAGE0:= rust-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.xz 346RUST_STAGE0:= rust-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.xz
349RUST_STD_STAGE0:= rust-std-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.xz 347RUST_STD_STAGE0:= rust-std-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.xz
350DISTFILES:= ${DISTFILES} ${RUST_STAGE0} ${RUST_STD_STAGE0} 348DISTFILES:= ${DISTFILES} ${RUST_STAGE0} ${RUST_STD_STAGE0}
351SITES.${RUST_STAGE0}= ${MASTER_SITE_LOCAL:=rust/} 349SITES.${RUST_STAGE0}= ${MASTER_SITE_LOCAL:=rust/}
352SITES.${RUST_STD_STAGE0}= ${MASTER_SITE_LOCAL:=rust/} 350SITES.${RUST_STD_STAGE0}= ${MASTER_SITE_LOCAL:=rust/}
353.endif 351.endif
354.if ${MACHINE_PLATFORM:MNetBSD-*-sparc64} || make(distinfo) || make (makesum) || make(mdi) 352.if ${MACHINE_PLATFORM:MNetBSD-*-sparc64} || make(distinfo) || make (makesum) || make(mdi)
355RUST_STAGE0_VER= 1.73.0 353RUST_STAGE0_VER= 1.74.1
356RUST_ARCH= sparc64-unknown-netbsd 354RUST_ARCH= sparc64-unknown-netbsd
357RUST_STAGE0:= rust-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.xz 355RUST_STAGE0:= rust-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.xz
358RUST_STD_STAGE0:= rust-std-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.xz 356RUST_STD_STAGE0:= rust-std-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.xz
359DISTFILES:= ${DISTFILES} ${RUST_STAGE0} ${RUST_STD_STAGE0} 357DISTFILES:= ${DISTFILES} ${RUST_STAGE0} ${RUST_STD_STAGE0}
360SITES.${RUST_STAGE0}= ${MASTER_SITE_LOCAL:=rust/} 358SITES.${RUST_STAGE0}= ${MASTER_SITE_LOCAL:=rust/}
361SITES.${RUST_STD_STAGE0}= ${MASTER_SITE_LOCAL:=rust/} 359SITES.${RUST_STD_STAGE0}= ${MASTER_SITE_LOCAL:=rust/}
362.endif 360.endif
363.if ${MACHINE_PLATFORM:MNetBSD-*-earmv7hf} || make(distinfo) || make (makesum) || make(mdi) 361.if ${MACHINE_PLATFORM:MNetBSD-*-earmv7hf} || make(distinfo) || make (makesum) || make(mdi)
364RUST_ARCH= armv7-unknown-netbsd-eabihf 362RUST_ARCH= armv7-unknown-netbsd-eabihf
365RUST_STAGE0_VER= 1.73.0 363RUST_STAGE0_VER= 1.74.1
366RUST_STAGE0:= rust-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.xz 364RUST_STAGE0:= rust-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.xz
367RUST_STD_STAGE0:= rust-std-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.xz 365RUST_STD_STAGE0:= rust-std-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.xz
368DISTFILES:= ${DISTFILES} ${RUST_STAGE0} ${RUST_STD_STAGE0} 366DISTFILES:= ${DISTFILES} ${RUST_STAGE0} ${RUST_STD_STAGE0}
369SITES.${RUST_STAGE0}= ${MASTER_SITE_LOCAL:=rust/} 367SITES.${RUST_STAGE0}= ${MASTER_SITE_LOCAL:=rust/}
370SITES.${RUST_STD_STAGE0}= ${MASTER_SITE_LOCAL:=rust/} 368SITES.${RUST_STD_STAGE0}= ${MASTER_SITE_LOCAL:=rust/}
371.endif 369.endif
372.if ${MACHINE_PLATFORM:MNetBSD-*-earmv6hf} || make(distinfo) || make (makesum) || make(mdi) 370.if ${MACHINE_PLATFORM:MNetBSD-*-earmv6hf} || make(distinfo) || make (makesum) || make(mdi)
373RUST_ARCH= armv6-unknown-netbsd-eabihf 371RUST_ARCH= armv6-unknown-netbsd-eabihf
374RUST_STAGE0_VER= 1.73.0 372RUST_STAGE0_VER= 1.74.1
375RUST_STAGE0:= rust-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.xz 373RUST_STAGE0:= rust-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.xz
376RUST_STD_STAGE0:= rust-std-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.xz 374RUST_STD_STAGE0:= rust-std-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.xz
377DISTFILES:= ${DISTFILES} ${RUST_STAGE0} ${RUST_STD_STAGE0} 375DISTFILES:= ${DISTFILES} ${RUST_STAGE0} ${RUST_STD_STAGE0}
378SITES.${RUST_STAGE0}= ${MASTER_SITE_LOCAL:=rust/} 376SITES.${RUST_STAGE0}= ${MASTER_SITE_LOCAL:=rust/}
379SITES.${RUST_STD_STAGE0}= ${MASTER_SITE_LOCAL:=rust/} 377SITES.${RUST_STD_STAGE0}= ${MASTER_SITE_LOCAL:=rust/}
380.endif 378.endif
381.if ${MACHINE_PLATFORM:MNetBSD-*-mipsel} || make(distinfo) || make (makesum) || make(mdi) 379.if ${MACHINE_PLATFORM:MNetBSD-*-mipsel} || make(distinfo) || make (makesum) || make(mdi)
382RUST_ARCH= mipsel-unknown-netbsd 380RUST_ARCH= mipsel-unknown-netbsd
383RUST_STAGE0_VER= 1.73.0 381RUST_STAGE0_VER= 1.74.1
384RUST_STAGE0:= rust-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.xz 382RUST_STAGE0:= rust-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.xz
385RUST_STD_STAGE0:= rust-std-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.xz 383RUST_STD_STAGE0:= rust-std-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.xz
386DISTFILES:= ${DISTFILES} ${RUST_STAGE0} ${RUST_STD_STAGE0} 384DISTFILES:= ${DISTFILES} ${RUST_STAGE0} ${RUST_STD_STAGE0}
387SITES.${RUST_STAGE0}= ${MASTER_SITE_LOCAL:=rust/} 385SITES.${RUST_STAGE0}= ${MASTER_SITE_LOCAL:=rust/}
388SITES.${RUST_STD_STAGE0}= ${MASTER_SITE_LOCAL:=rust/} 386SITES.${RUST_STD_STAGE0}= ${MASTER_SITE_LOCAL:=rust/}
389.endif 387.endif
390.if ${MACHINE_PLATFORM:MNetBSD-*-riscv64} || make(distinfo) || make (makesum) || make(mdi) 388.if ${MACHINE_PLATFORM:MNetBSD-*-riscv64} || make(distinfo) || make (makesum) || make(mdi)
391RUST_ARCH= riscv64gc-unknown-netbsd 389RUST_ARCH= riscv64gc-unknown-netbsd
392RUST_STAGE0_VER= 1.73.0 390RUST_STAGE0_VER= 1.74.1
393RUST_STAGE0:= rust-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.xz 391RUST_STAGE0:= rust-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.xz
394RUST_STD_STAGE0:= rust-std-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.xz 392RUST_STD_STAGE0:= rust-std-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.xz
395DISTFILES:= ${DISTFILES} ${RUST_STAGE0} ${RUST_STD_STAGE0} 393DISTFILES:= ${DISTFILES} ${RUST_STAGE0} ${RUST_STD_STAGE0}
396SITES.${RUST_STAGE0}= ${MASTER_SITE_LOCAL:=rust/} 394SITES.${RUST_STAGE0}= ${MASTER_SITE_LOCAL:=rust/}
397SITES.${RUST_STD_STAGE0}= ${MASTER_SITE_LOCAL:=rust/} 395SITES.${RUST_STD_STAGE0}= ${MASTER_SITE_LOCAL:=rust/}
398.endif 396.endif
399 397
400# You may override RUST_BOOTSTRAP_PATH and RUST_ARCH in mk.conf 398# You may override RUST_BOOTSTRAP_PATH and RUST_ARCH in mk.conf
401# if you have a local bootstrap compiler. 399# if you have a local bootstrap compiler.
402.if !defined(RUST_ARCH) && !defined(RUST_BOOTSTRAP_PATH) 400.if !defined(RUST_ARCH) && !defined(RUST_BOOTSTRAP_PATH)
403NOT_FOR_PLATFORM+= ${MACHINE_PLATFORM} 401NOT_FOR_PLATFORM+= ${MACHINE_PLATFORM}
404.else 402.else
405RUST_BOOTSTRAP_PATH?= ${WRKDIR}/rust-bootstrap 403RUST_BOOTSTRAP_PATH?= ${WRKDIR}/rust-bootstrap
406.endif 404.endif
407 405
408.if ${OPSYS} == "SunOS" 406.if ${OPSYS} == "SunOS"
409TOOL_DEPENDS+= coreutils>=0:../../sysutils/coreutils 407TOOL_DEPENDS+= coreutils>=0:../../sysutils/coreutils
410TOOL_DEPENDS+= gzip>=0:../../archivers/gzip 408TOOL_DEPENDS+= gzip>=0:../../archivers/gzip
411TOOLS_CREATE+= md5sum 409TOOLS_CREATE+= md5sum
412TOOLS_PATH.md5sum= ${PREFIX}/bin/gmd5sum 410TOOLS_PATH.md5sum= ${PREFIX}/bin/gmd5sum
413TOOLS_PLATFORM.gzcat= ${PREFIX}/bin/gzip -cd 411TOOLS_PLATFORM.gzcat= ${PREFIX}/bin/gzip -cd
414.endif 412.endif
415 413
416SUBST_CLASSES+= rpath 414SUBST_CLASSES+= prefix
417SUBST_STAGE.rpath= pre-configure 415SUBST_STAGE.prefix= pre-configure
418SUBST_FILES.rpath+= compiler/rustc_codegen_ssa/src/back/linker.rs 416SUBST_FILES.prefix+= compiler/rustc_codegen_ssa/src/back/linker.rs
419SUBST_FILES.rpath+= compiler/rustc_target/src/spec/netbsd_base.rs 417SUBST_FILES.prefix+= compiler/rustc_target/src/spec/base/netbsd.rs
420SUBST_FILES.rpath+= src/bootstrap/builder.rs 418SUBST_FILES.prefix+= src/bootstrap/src/core/build_steps/compile.rs
421SUBST_FILES.rpath+= src/bootstrap/compile.rs 419SUBST_FILES.prefix+= src/bootstrap/src/core/builder.rs
422SUBST_VARS.rpath= PREFIX 420SUBST_FILES.prefix+= src/bootstrap/bootstrap.py
 421SUBST_VARS.prefix= PREFIX
423 422
424# 423#
425# Generate list of subst entries for various .cargo-checksum.json files. These 424# Generate list of subst entries for various .cargo-checksum.json files. These
426# are all handled together in one big substitution to simplify things rather 425# are all handled together in one big substitution to simplify things rather
427# than one substitution entry per file, but are kept separate below to ease 426# than one substitution entry per file, but are kept separate below to ease
428# updating and verification. 427# updating and verification.
429# 428#
430 429
431CKSUM_CRATES+= vendor/cc-1.0.73 
432CKSUMS+= 38970d678de0efb4b5e2978265daa8a613a1db35fc42e669621b03fc56d5b138 
433CKSUMS+= 65de0d6593a4256e5fcaf898f9468d71bab672c70a2dfab3dcb8514e9b72819c 
434 
435CKSUM_CRATES+= vendor/cc 
436CKSUMS+= 17a4659710aa290c4ed9c23063c7b202c5bcf2a84de33aa1f01fc6fded69a1f8 
437CKSUMS+= a19bcb1a561d4ba5846f8f89fcfe6f05a3cb2e79baf8f21f53f0fba012db1b7f 
438 
439CKSUM_CRATES+= vendor/libc 430CKSUM_CRATES+= vendor/libc
 431
 432CKSUM_CRATES+= vendor/libc-0.2.146
440CKSUMS+= 55ce4624745e31ad226b47fde177a46176a89da3fa5030663673a115102471f9 433CKSUMS+= 55ce4624745e31ad226b47fde177a46176a89da3fa5030663673a115102471f9
441CKSUMS+= 09ab15cd50245f4ced230b7919657ab170e06443bb0ed4baf4449d3472f5f656 434CKSUMS+= 09ab15cd50245f4ced230b7919657ab170e06443bb0ed4baf4449d3472f5f656
442CKSUMS+= 90dd33ef20dc3be8aef5bd152a6a06e7ab34f9527b3978487b593aaa16a907bd 435CKSUMS+= 90dd33ef20dc3be8aef5bd152a6a06e7ab34f9527b3978487b593aaa16a907bd
443CKSUMS+= ec1cb2b8522ce7d35c9fce2f5b17a1a7e28cae9836f1cf11e267f222b72dff60 436CKSUMS+= ec1cb2b8522ce7d35c9fce2f5b17a1a7e28cae9836f1cf11e267f222b72dff60
 437
 438CKSUM_CRATES+= vendor/libc-0.2.149
 439CKSUMS+= 1f1beb74c33bd3ad6a5d7aae2afdacf0ccbad0f9dacda2894d2cfdc2414174ae
 440CKSUMS+= 80f3168251556b3eb918056aa9563db07383f61e69a262f3af390b542fd757bb
444CKSUMS+= b1660c631a599a3355116e7485b88ab2f8f2929c2e37851a763431387b902f14 441CKSUMS+= b1660c631a599a3355116e7485b88ab2f8f2929c2e37851a763431387b902f14
445CKSUMS+= 990d1c6c01db31b9e5541128e4987b114f39c6808d94a5f8f048f492cfb96d78 442CKSUMS+= 990d1c6c01db31b9e5541128e4987b114f39c6808d94a5f8f048f492cfb96d78
446 443
447CKSUM_CRATES+= vendor/libc-0.2.138 444CKSUM_CRATES+= vendor/cc-1.0.73
448CKSUMS+= 107a4aa396b8383c66e0ace2f941450b4b69146558cdc4d9fbe33eeab51760f1 445CKSUMS+= 38970d678de0efb4b5e2978265daa8a613a1db35fc42e669621b03fc56d5b138
449CKSUMS+= 4be83bef456569d59405edf134e7fe8eff78f3fe35f1efd60e15405d5c822725 446CKSUMS+= 65de0d6593a4256e5fcaf898f9468d71bab672c70a2dfab3dcb8514e9b72819c
450 
451CKSUM_CRATES+= vendor/libc-0.2.140 
452CKSUMS+= 4493317993af390d8aafc2cb7ace4c349dfc9d2451fd666844f04a4fa1f47442 
453CKSUMS+= 537a01c3cd5507f493616193991e1135c7896aae3fc92d98ec9facbfe243d980 
454CKSUMS+= 6442ed05eb390d44a03daa9800af1030f2ee3e61db98675262c227b28de51937 
455CKSUMS+= ec554c837999c718786debfcfe2241984193751fcd52156323b418d96319aa95 
456 447
457CKSUM_CRATES+= vendor/libc-0.2.146 448CKSUM_CRATES+= vendor/cc
458#CKSUMS+= 6442ed05eb390d44a03daa9800af1030f2ee3e61db98675262c227b28de51937 449CKSUMS+= 17a4659710aa290c4ed9c23063c7b202c5bcf2a84de33aa1f01fc6fded69a1f8
459#CKSUMS+= ec554c837999c718786debfcfe2241984193751fcd52156323b418d96319aa95 450CKSUMS+= a19bcb1a561d4ba5846f8f89fcfe6f05a3cb2e79baf8f21f53f0fba012db1b7f
460#CKSUMS+= 6a60a542639528a0a34b9c9a7298973ec2cf1449c59546b7b30dcef6c51874dd 
461#CKSUMS+= ec1cb2b8522ce7d35c9fce2f5b17a1a7e28cae9836f1cf11e267f222b72dff60 
462 451
463CKSUM_CRATES+= vendor/lzma-sys 452CKSUM_CRATES+= vendor/lzma-sys
464CKSUMS+= 6fd5e9245db34c6f557b8bfcaf03db82fc88c3b06dbfbb5f03b2bcd138983ef9 453CKSUMS+= 6fd5e9245db34c6f557b8bfcaf03db82fc88c3b06dbfbb5f03b2bcd138983ef9
465CKSUMS+= 5e252578b5d266f6a4c8dc9f71ca7a91536ccb8c5c7d7753b82f12ec886459ef 454CKSUMS+= 5e252578b5d266f6a4c8dc9f71ca7a91536ccb8c5c7d7753b82f12ec886459ef
466 455
467CKSUM_CRATES+= vendor/stacker 456CKSUM_CRATES+= vendor/stacker
468CKSUMS+= 59ca847887cf19387119d18c57f08d5a8520d714876ca0142b8f1c001ecde06b 457CKSUMS+= 59ca847887cf19387119d18c57f08d5a8520d714876ca0142b8f1c001ecde06b
469CKSUMS+= 03be8ae293b713fe6e9703e4809dd68caaec992bae6777914ffddae8da2a9bc7 458CKSUMS+= 03be8ae293b713fe6e9703e4809dd68caaec992bae6777914ffddae8da2a9bc7
470 459
471CKSUM_CRATES+= vendor/crossbeam-utils 460CKSUM_CRATES+= vendor/crossbeam-utils
472CKSUMS+= 5f75132808d9e8d6e266fe77f9e20bbc35855a1c37a5dbc0940b3e989bca1a94 461CKSUMS+= 5f75132808d9e8d6e266fe77f9e20bbc35855a1c37a5dbc0940b3e989bca1a94
473CKSUMS+= 3d7c747108434546837b1c5664111c9146fcbfb2e084c95f8ce0be970d652421 462CKSUMS+= 3d7c747108434546837b1c5664111c9146fcbfb2e084c95f8ce0be970d652421
474 463
475CKSUM_CRATES+= vendor/crossbeam-utils-0.8.14 464CKSUM_CRATES+= vendor/crossbeam-utils-0.8.14
476CKSUMS+= 3314524d2afa0360c947455a6e6566fb54ebf909c99479ca3b7435741fd3293e 465CKSUMS+= 3314524d2afa0360c947455a6e6566fb54ebf909c99479ca3b7435741fd3293e
477CKSUMS+= eaef167dea04efa811cf0d53de98feac6063ec2196eccd315d345ef86c551aaa 466CKSUMS+= eaef167dea04efa811cf0d53de98feac6063ec2196eccd315d345ef86c551aaa
478 467
479CKSUM_CRATES+= vendor/crossbeam-epoch 468CKSUM_CRATES+= vendor/crossbeam-epoch
480CKSUMS+= 5f75132808d9e8d6e266fe77f9e20bbc35855a1c37a5dbc0940b3e989bca1a94 469CKSUMS+= 5f75132808d9e8d6e266fe77f9e20bbc35855a1c37a5dbc0940b3e989bca1a94
481CKSUMS+= 3d7c747108434546837b1c5664111c9146fcbfb2e084c95f8ce0be970d652421 470CKSUMS+= 3d7c747108434546837b1c5664111c9146fcbfb2e084c95f8ce0be970d652421
482 471
483CKSUM_CRATES+= vendor/openssl-sys 472CKSUM_CRATES+= vendor/openssl-sys
484CKSUMS+= b2cbaa5bfac5e7d5550aa0eb8e5c65a9f7e86a3692b759fb13330ef6e3b26b30 473CKSUMS+= b2cbaa5bfac5e7d5550aa0eb8e5c65a9f7e86a3692b759fb13330ef6e3b26b30
485CKSUMS+= b303bf9ceae9fcffa4a0420ea858675d827fc2d75c358f8236e44274d58be1a0 474CKSUMS+= b303bf9ceae9fcffa4a0420ea858675d827fc2d75c358f8236e44274d58be1a0
486CKSUMS+= 33f814dba4ac9942266157cbe3dc8eadf5e477090370a92c36c53f916fa45d48 475CKSUMS+= 33f814dba4ac9942266157cbe3dc8eadf5e477090370a92c36c53f916fa45d48
487CKSUMS+= 4f14cac64c027b3bea07908bae58184b31f6da6326f8ba5a6935d726ab2e1d20 476CKSUMS+= 4f14cac64c027b3bea07908bae58184b31f6da6326f8ba5a6935d726ab2e1d20
488 477
489CKSUM_CRATES+= vendor/openssl-src 478CKSUM_CRATES+= vendor/openssl-src
490CKSUMS+= 683c9ed1a7953f7f9da43412010de95ba733860a18bc28a4fc3cbcc6ac93c4d7 479CKSUMS+= 683c9ed1a7953f7f9da43412010de95ba733860a18bc28a4fc3cbcc6ac93c4d7
491CKSUMS+= d83220880699d6a4d9a4e265d19b7896ca4dc7235e3e2f546c5fa06222bdc258 480CKSUMS+= d83220880699d6a4d9a4e265d19b7896ca4dc7235e3e2f546c5fa06222bdc258
492CKSUMS+= 090744f85cf99a9b8412c23fca1eabb61eb45d830f0f9f0e7309be2572c1e827 481CKSUMS+= 090744f85cf99a9b8412c23fca1eabb61eb45d830f0f9f0e7309be2572c1e827
493CKSUMS+= ead7bdeee121f1357b99741b175a564c8b7026f694cbc388aae2a86b3bae913f 482CKSUMS+= ead7bdeee121f1357b99741b175a564c8b7026f694cbc388aae2a86b3bae913f
494 483
495CKSUM_CRATES+= vendor/nix 484CKSUM_CRATES+= vendor/nix
496CKSUMS+= c3e13a2edea54d190a4b051f62efc97953c00b5051a9fda0e39e3bc732a31939 485CKSUMS+= c3e13a2edea54d190a4b051f62efc97953c00b5051a9fda0e39e3bc732a31939
497CKSUMS+= 263bd7ace66a4cfee3de18532f61c187327fcbd564666b4f97c4b01ae6885d98 486CKSUMS+= 263bd7ace66a4cfee3de18532f61c187327fcbd564666b4f97c4b01ae6885d98
498 487
499SUBST_CLASSES+= cksum 488SUBST_CLASSES+= cksum
500SUBST_STAGE.cksum= pre-configure 489SUBST_STAGE.cksum= pre-configure
501.for crate in ${CKSUM_CRATES} 490.for crate in ${CKSUM_CRATES}
502SUBST_FILES.cksum+= ${crate}/.cargo-checksum.json 491SUBST_FILES.cksum+= ${crate}/.cargo-checksum.json
503.endfor 492.endfor
504.for from to in ${CKSUMS} 493.for from to in ${CKSUMS}
505SUBST_SED.cksum+= -e 's,${from},${to},g' 494SUBST_SED.cksum+= -e 's,${from},${to},g'
506.endfor 495.endfor
507 496
508post-extract: 497post-extract:
509 set -e; \ 498 set -e; \
510 if ${TEST} -e ${WRKDIR}/rust-${RUST_STAGE0_VER}-${RUST_ARCH}/install.sh \ 499 if ${TEST} -e ${WRKDIR}/rust-${RUST_STAGE0_VER}-${RUST_ARCH}/install.sh \
511 -a ! -e ${RUST_BOOTSTRAP_PATH}/bin/rustc; then \ 500 -a ! -e ${RUST_BOOTSTRAP_PATH}/bin/rustc; then \
512 cd ${WRKDIR}/rust-${RUST_STAGE0_VER}-${RUST_ARCH}; \ 501 cd ${WRKDIR}/rust-${RUST_STAGE0_VER}-${RUST_ARCH}; \
513 env ${MAKE_ENV} ${TOOLS_BASH} \ 502 env ${MAKE_ENV} ${TOOLS_BASH} \
514 ./install.sh --prefix=${RUST_BOOTSTRAP_PATH}; \ 503 ./install.sh --prefix=${RUST_BOOTSTRAP_PATH}; \
515 cd ${WRKDIR}/rust-std-${RUST_STAGE0_VER}-${RUST_ARCH}; \ 504 cd ${WRKDIR}/rust-std-${RUST_STAGE0_VER}-${RUST_ARCH}; \
516 env ${MAKE_ENV} ${TOOLS_BASH} \ 505 env ${MAKE_ENV} ${TOOLS_BASH} \
517 ./install.sh --prefix=${RUST_BOOTSTRAP_PATH}; \ 506 ./install.sh --prefix=${RUST_BOOTSTRAP_PATH}; \
518 fi 507 fi
519.if ${OPSYS} == "NetBSD" 508.if ${OPSYS} == "NetBSD"
520 SDIR=${WRKDIR}/scripts; \ 509 SDIR=${WRKDIR}/scripts; \
521 ${MKDIR} $${SDIR}; \ 510 ${MKDIR} $${SDIR}; \
522 cd $${SDIR}; \ 511 cd $${SDIR}; \
523 ${RM} -f c++-wrap; \ 512 ${RM} -f c++-wrap; \
524 ${RM} -f clang++-wrap; \ 513 ${RM} -f clang++-wrap; \
525 ${RM} -f clang-wrap; \ 514 ${RM} -f clang-wrap; \
526 ${RM} -f ar-wrap; \ 515 ${RM} -f ar-wrap; \
527 ${CP} ${.CURDIR}/files/gcc-wrap .; \ 516 ${CP} ${.CURDIR}/files/gcc-wrap .; \
528 ${CHMOD} +x gcc-wrap; \ 517 ${CHMOD} +x gcc-wrap; \
529 ${LN} -s gcc-wrap c++-wrap; \ 518 ${LN} -s gcc-wrap c++-wrap; \
530 ${LN} -s gcc-wrap clang++-wrap; \ 519 ${LN} -s gcc-wrap clang++-wrap; \
531 ${LN} -s gcc-wrap clang-wrap; \ 520 ${LN} -s gcc-wrap clang-wrap; \
532 ${LN} -s gcc-wrap ar-wrap 521 ${LN} -s gcc-wrap ar-wrap
533.endif 522.endif
534 523
535.if ${OPSYS} == "FreeBSD" 524.if ${OPSYS} == "FreeBSD"
536MAKE_ENV+= OPENSSL_DIR=${SSLBASE} 525MAKE_ENV+= OPENSSL_DIR=${SSLBASE}
537.endif 526.endif
538 527
539.if ${OPSYS} == "NetBSD" && !empty(PKGSRC_COMPILER:Mclang) && !exists(/lib/libgcc_s.so) 528.if ${OPSYS} == "NetBSD" && !empty(PKGSRC_COMPILER:Mclang) && !exists(/lib/libgcc_s.so)
540BUILDLINK_TRANSFORM+= rm:-lgcc_s 529BUILDLINK_TRANSFORM+= rm:-lgcc_s
541MAKE_ENV+= PKGSRC_HAVE_LIBCPP=yes 530MAKE_ENV+= PKGSRC_HAVE_LIBCPP=yes
542 531
543pre-build: provide-libgcc-for-bootstrap 532pre-build: provide-libgcc-for-bootstrap
544.PHONY: provide-libgcc-for-bootstrap 533.PHONY: provide-libgcc-for-bootstrap
545provide-libgcc-for-bootstrap: 534provide-libgcc-for-bootstrap:
546. if exists(${FILESDIR}/libgcc_s.so.1) 535. if exists(${FILESDIR}/libgcc_s.so.1)
547 cp ${FILESDIR}/libgcc_s.so.1 ${RUST_BOOTSTRAP_PATH}/lib/. 536 cp ${FILESDIR}/libgcc_s.so.1 ${RUST_BOOTSTRAP_PATH}/lib/.
548. endif 537. endif
549.endif 538.endif
550 539
551# 540#
552# These are essentially copies of the "all", "test", and "install" Makefile 541# These are essentially copies of the "all", "test", and "install" Makefile
553# targets, but are duplicated here so that we can specify -j. 542# targets, but are duplicated here so that we can specify -j.
554# 543#
555do-build: 544do-build:
556 ${RUN}${_ULIMIT_CMD} \ 545 ${RUN}${_ULIMIT_CMD} \
557 cd ${WRKSRC} && \ 546 cd ${WRKSRC} && \
558 ${SETENV} ${MAKE_ENV} \ 547 ${SETENV} ${MAKE_ENV} \
559 sh -c "if [ \"${BUILD_TARGET}\" = \"dist\" ]; then \ 548 sh -c "if [ \"${BUILD_TARGET}\" = \"dist\" ]; then \
560 unset DESTDIR; \ 549 unset DESTDIR; \
561 ${PYTHONBIN} ./x.py -v \ 550 ${PYTHONBIN} ./x.py -v \
562 ${BUILD_TARGET} -j ${_MAKE_JOBS_N}; \ 551 ${BUILD_TARGET} -j ${_MAKE_JOBS_N}; \
563 else \ 552 else \
564 ${PYTHONBIN} ./x.py -v \ 553 ${PYTHONBIN} ./x.py -v \
565 ${BUILD_TARGET} --stage 2 -j ${_MAKE_JOBS_N} && \ 554 ${BUILD_TARGET} --stage 2 -j ${_MAKE_JOBS_N} && \
566 ${PYTHONBIN} ./x.py -v \ 555 ${PYTHONBIN} ./x.py -v \
567 doc --stage 2 -j ${_MAKE_JOBS_N}; \ 556 doc --stage 2 -j ${_MAKE_JOBS_N}; \
568 fi" 557 fi"
569 558
570do-test: 559do-test:
571 ${RUN}${_ULIMIT_CMD} \ 560 ${RUN}${_ULIMIT_CMD} \
572 cd ${WRKSRC} && \ 561 cd ${WRKSRC} && \
573 ${SETENV} ${MAKE_ENV} \ 562 ${SETENV} ${MAKE_ENV} \
574 ${PYTHONBIN} ./x.py -v test -j ${_MAKE_JOBS_N} 563 ${PYTHONBIN} ./x.py -v test -j ${_MAKE_JOBS_N}
575 564
576do-install: 565do-install:
577 ${RUN}${_ULIMIT_CMD} \ 566 ${RUN}${_ULIMIT_CMD} \
578 cd ${WRKSRC} && \ 567 cd ${WRKSRC} && \
579 ${SETENV} ${MAKE_ENV} ${INSTALL_ENV} \ 568 ${SETENV} ${MAKE_ENV} ${INSTALL_ENV} \
580 ${PYTHONBIN} ./x.py -v install -j ${_MAKE_JOBS_N} 569 ${PYTHONBIN} ./x.py -v install -j ${_MAKE_JOBS_N}
581 570
582SUBST_CLASSES+= destdir 571SUBST_CLASSES+= destdir
583SUBST_STAGE.destdir= post-install 572SUBST_STAGE.destdir= post-install
584SUBST_FILES.destdir= ${DESTDIR}${PREFIX}/lib/rustlib/manifest-* 573SUBST_FILES.destdir= ${DESTDIR}${PREFIX}/lib/rustlib/manifest-*
585SUBST_SED.destdir= -e 's|file:${DESTDIR}${PREFIX}|file:${PREFIX}|' 574SUBST_SED.destdir= -e 's|file:${DESTDIR}${PREFIX}|file:${PREFIX}|'
586 575
587GENERATE_PLIST+= ${FIND} ${DESTDIR}${PREFIX} \( -type f -o -type l \) -print | \ 576GENERATE_PLIST+= ${FIND} ${DESTDIR}${PREFIX} \( -type f -o -type l \) -print | \
588 ${SED} -e 's,${DESTDIR}${PREFIX}/,,' | ${SORT} ; 577 ${SED} -e 's,${DESTDIR}${PREFIX}/,,' | ${SORT} ;
589 578
590# Create a relocatable stage2 bootstrap from the bits we just built that can be 579# Create a relocatable stage2 bootstrap from the bits we just built that can be
591# used to build the next version of rust. Currently only tested on SmartOS. 580# used to build the next version of rust. Currently only tested on SmartOS.
592# 581#
593# Use the alternate BOOTSTRAP_NAME when creating a nightly release. 582# Use the alternate BOOTSTRAP_NAME when creating a nightly release.
594# 583#
595#BOOTSTRAP_NAME= ${PKGNAME_NOREV:C/rust/rust-nightly/}-${RUST_ARCH} 584#BOOTSTRAP_NAME= ${PKGNAME_NOREV:C/rust/rust-nightly/}-${RUST_ARCH}
596BOOTSTRAP_NAME= ${PKGNAME_NOREV}-${RUST_ARCH} 585BOOTSTRAP_NAME= ${PKGNAME_NOREV}-${RUST_ARCH}
597BOOTSTRAP_TMPDIR= ${WRKDIR}/${BOOTSTRAP_NAME} 586BOOTSTRAP_TMPDIR= ${WRKDIR}/${BOOTSTRAP_NAME}
598USE_TOOLS+= gtar 587USE_TOOLS+= gtar
599 588
600# The NetBSD part is so far untested, because I could not convince 589# The NetBSD part is so far untested, because I could not convince
601# the rust build to use the gcc wrapper when building natively, 590# the rust build to use the gcc wrapper when building natively,
602# so that I could get a placeholder in the RPATH, because chrpath 591# so that I could get a placeholder in the RPATH, because chrpath
603# cannot extend the length of the RPATH... 592# cannot extend the length of the RPATH...
604ELFEDIT?= /usr/bin/elfedit 593ELFEDIT?= /usr/bin/elfedit
605 594
606.PHONY: stage0-bootstrap 595.PHONY: stage0-bootstrap
607stage0-bootstrap: install 596stage0-bootstrap: install
608 ${RM} -rf ${BOOTSTRAP_TMPDIR} 597 ${RM} -rf ${BOOTSTRAP_TMPDIR}
609 ${MKDIR} ${BOOTSTRAP_TMPDIR} 598 ${MKDIR} ${BOOTSTRAP_TMPDIR}
610.if ${OPSYS} == "NetBSD" 599.if ${OPSYS} == "NetBSD"
611 (cd ${BOOTSTRAP_TMPDIR}; \ 600 (cd ${BOOTSTRAP_TMPDIR}; \
612 DISTDIR=${WRKSRC}/bild/dist; \ 601 DISTDIR=${WRKSRC}/bild/dist; \
613 VER_ARCH=${PKGVERSION}-${RUST_ARCH}; \ 602 VER_ARCH=${PKGVERSION}-${RUST_ARCH}; \
614 RUSTC=rustc-$${VER_ARCH}; \ 603 RUSTC=rustc-$${VER_ARCH}; \
615 RUSTC_FILE=$${RUSTC}.tar.gz; \ 604 RUSTC_FILE=$${RUSTC}.tar.gz; \
616 RUST_STD=rust-std-$${VER_ARCH}; \ 605 RUST_STD=rust-std-$${VER_ARCH}; \
617 RUST_STD_FILE=$${RUST_STD}.tar.gz; \ 606 RUST_STD_FILE=$${RUST_STD}.tar.gz; \
618 ${GTAR} -xzf $${DISTDIR}/$${RUSTC_FILE}; \ 607 ${GTAR} -xzf $${DISTDIR}/$${RUSTC_FILE}; \
619 (cd ${RUSTC}; \ 608 (cd ${RUSTC}; \
620 RPATH='/usr/pkg/lib:/lib:/usr/lib:$$ORIGIN/../lib'; \ 609 RPATH='/usr/pkg/lib:/lib:/usr/lib:$$ORIGIN/../lib'; \
621 for f in rls-preview/bin/rls rustc/bin/rustc rustc/bin/rustdoc; do \ 610 for f in rls-preview/bin/rls rustc/bin/rustc rustc/bin/rustdoc; do \
622 chrpath -r $$RPATH $$f; \ 611 chrpath -r $$RPATH $$f; \
623 done; \ 612 done; \
624 RPATH='/usr/pkg/lib:/lib:/usr/lib:$$ORIGIN'; \ 613 RPATH='/usr/pkg/lib:/lib:/usr/lib:$$ORIGIN'; \
625 for f in rustc/lib/*.so*; do \ 614 for f in rustc/lib/*.so*; do \
626 chrpath -r $$RPATH $$f; \ 615 chrpath -r $$RPATH $$f; \
627 done; \ 616 done; \
628 RPATH='/usr/pkg/lib:/lib:/usr/lib:$$ORIGIN:$$ORIGIN/../../..'; \ 617 RPATH='/usr/pkg/lib:/lib:/usr/lib:$$ORIGIN:$$ORIGIN/../../..'; \
629 for f in rustc/lib/rustlib/*/*/*.so*; do \ 618 for f in rustc/lib/rustlib/*/*/*.so*; do \
630 chrpath -r $$RPATH $$f; \ 619 chrpath -r $$RPATH $$f; \
631 done;); \ 620 done;); \
632 ${GTAR} -czf $${RUSTC_FILE} $${RUSTC}; \ 621 ${GTAR} -czf $${RUSTC_FILE} $${RUSTC}; \
633 ${CP} $${DISTDIR}/$${RUST_STD_FILE} .; \ 622 ${CP} $${DISTDIR}/$${RUST_STD_FILE} .; \
634 ${ECHO} "Fixed stage0 bootstrap in ${BOOTSTRAP_TMPDIR}:"; \ 623 ${ECHO} "Fixed stage0 bootstrap in ${BOOTSTRAP_TMPDIR}:"; \
635 ${ECHO} "$${RUSTC_FILE}"; \ 624 ${ECHO} "$${RUSTC_FILE}"; \
636 ${ECHO} "$${RUST_STD_FILE}"; \ 625 ${ECHO} "$${RUST_STD_FILE}"; \
637 ) 626 )
638.endif 627.endif
639.if ${OS_VARIANT} == "SmartOS" 628.if ${OS_VARIANT} == "SmartOS"
640 ${CP} -R ${DESTDIR}/${PREFIX}/bin ${BOOTSTRAP_TMPDIR}/ 629 ${CP} -R ${DESTDIR}/${PREFIX}/bin ${BOOTSTRAP_TMPDIR}/
641 ${CP} -R ${DESTDIR}/${PREFIX}/lib ${BOOTSTRAP_TMPDIR}/ 630 ${CP} -R ${DESTDIR}/${PREFIX}/lib ${BOOTSTRAP_TMPDIR}/
642 ${MKDIR} ${BOOTSTRAP_TMPDIR}/lib/pkgsrc 631 ${MKDIR} ${BOOTSTRAP_TMPDIR}/lib/pkgsrc
643 set -e; \ 632 set -e; \
644 for lib in libgcc_s.so.1 libstdc++.so.6; do \ 633 for lib in libgcc_s.so.1 libstdc++.so.6; do \
645 ${CP} `${PKG_CC} -print-file-name=$${lib}` \ 634 ${CP} `${PKG_CC} -print-file-name=$${lib}` \
646 ${BOOTSTRAP_TMPDIR}/lib/pkgsrc/; \ 635 ${BOOTSTRAP_TMPDIR}/lib/pkgsrc/; \
647 done; \ 636 done; \
648 for lib in libLLVM-16.so libcrypto.so.3 libcurl.so.4 \ 637 for lib in libLLVM-16.so libcrypto.so.3 libcurl.so.4 \
649 libssl.so.3 libz.so.1 libzstd.so.1; do \ 638 libssl.so.3 libz.so.1 libzstd.so.1; do \
650 ${CP} ${PREFIX}/lib/$${lib} ${BOOTSTRAP_TMPDIR}/lib/pkgsrc/; \ 639 ${CP} ${PREFIX}/lib/$${lib} ${BOOTSTRAP_TMPDIR}/lib/pkgsrc/; \
651 done; \ 640 done; \
652 for lib in libiconv.so.2 libidn2.so.0 libintl.so.8 liblber.so.2 \ 641 for lib in libiconv.so.2 libidn2.so.0 libintl.so.8 liblber.so.2 \
653 libldap.so.2 libnghttp2.so.14 libsasl2.so.3 \ 642 libldap.so.2 libnghttp2.so.14 libsasl2.so.3 \
654 libssh2.so.1 libunistring.so.5; do \ 643 libssh2.so.1 libunistring.so.5; do \
655 ${CP} ${PREFIX}/lib/$${lib} ${BOOTSTRAP_TMPDIR}/lib/pkgsrc/; \ 644 ${CP} ${PREFIX}/lib/$${lib} ${BOOTSTRAP_TMPDIR}/lib/pkgsrc/; \
656 done; \ 645 done; \
657 for f in ${BOOTSTRAP_TMPDIR}/bin/*; do \ 646 for f in ${BOOTSTRAP_TMPDIR}/bin/*; do \
658 /bin/file -b "$$f" | grep ^ELF >/dev/null || continue; \ 647 /bin/file -b "$$f" | grep ^ELF >/dev/null || continue; \
659 ${ELFEDIT} -e 'dyn:runpath $$ORIGIN/../lib:$$ORIGIN/../lib/pkgsrc' $$f; \ 648 ${ELFEDIT} -e 'dyn:runpath $$ORIGIN/../lib:$$ORIGIN/../lib/pkgsrc' $$f; \
660 done; \ 649 done; \
661 for f in ${BOOTSTRAP_TMPDIR}/lib/pkgsrc/*.so*; do \ 650 for f in ${BOOTSTRAP_TMPDIR}/lib/pkgsrc/*.so*; do \
662 ${ELFEDIT} -e 'dyn:runpath $$ORIGIN' $$f; \ 651 ${ELFEDIT} -e 'dyn:runpath $$ORIGIN' $$f; \
663 done; \ 652 done; \
664 for f in ${BOOTSTRAP_TMPDIR}/lib/*.so*; do \ 653 for f in ${BOOTSTRAP_TMPDIR}/lib/*.so*; do \
665 ${ELFEDIT} -e 'dyn:runpath $$ORIGIN:$$ORIGIN/pkgsrc' $$f; \ 654 ${ELFEDIT} -e 'dyn:runpath $$ORIGIN:$$ORIGIN/pkgsrc' $$f; \
666 done; \ 655 done; \
667 for f in ${BOOTSTRAP_TMPDIR}/lib/rustlib/*/*/*.so*; do \ 656 for f in ${BOOTSTRAP_TMPDIR}/lib/rustlib/*/*/*.so*; do \
668 ${ELFEDIT} -e 'dyn:runpath $$ORIGIN:$$ORIGIN/../../..:$$ORIGIN/../../../pkgsrc' $$f; \ 657 ${ELFEDIT} -e 'dyn:runpath $$ORIGIN:$$ORIGIN/../../..:$$ORIGIN/../../../pkgsrc' $$f; \
669 done; \ 658 done; \
670 cd ${WRKDIR}; ${GTAR} -zcf ${BOOTSTRAP_NAME}.tar.gz ${BOOTSTRAP_NAME} 659 cd ${WRKDIR}; ${GTAR} -zcf ${BOOTSTRAP_NAME}.tar.gz ${BOOTSTRAP_NAME}
671 @${ECHO} "" 660 @${ECHO} ""
672 @${ECHO} "Verify correct library paths using the following:" 661 @${ECHO} "Verify correct library paths using the following:"
673 @${ECHO} "" 662 @${ECHO} ""
674 @${ECHO} " cd ${BOOTSTRAP_TMPDIR}" 663 @${ECHO} " cd ${BOOTSTRAP_TMPDIR}"
675 @${ECHO} " find . -type f | xargs ldd 2>/dev/null | egrep 'not.found|${PREFIX}'" 664 @${ECHO} " find . -type f | xargs ldd 2>/dev/null | egrep 'not.found|${PREFIX}'"
676 @${ECHO} "" 665 @${ECHO} ""
677 @${ECHO} "If there is no output then this bootstrap kit is ready to go:" 666 @${ECHO} "If there is no output then this bootstrap kit is ready to go:"
678 @${ECHO} "" 667 @${ECHO} ""
679 @${ECHO} " ${WRKDIR}/${BOOTSTRAP_NAME}.tar.gz" 668 @${ECHO} " ${WRKDIR}/${BOOTSTRAP_NAME}.tar.gz"
680 @${ECHO} "" 669 @${ECHO} ""
681.endif 670.endif
682 671
683.include "options.mk" 672.include "options.mk"
684 673
685# These dependencies currently use the bundled sources as they require 674# These dependencies currently use the bundled sources as they require
686# development features not yet available in released versions. 675# development features not yet available in released versions.
687# 676#
688#.include "../../devel/libgit2/buildlink3.mk" 677#.include "../../devel/libgit2/buildlink3.mk"
689#.include "../../security/libssh2/buildlink3.mk" 678#.include "../../security/libssh2/buildlink3.mk"
690#.include "../../www/http-parser/buildlink3.mk" 679#.include "../../www/http-parser/buildlink3.mk"
691#.include "../../devel/jemalloc/buildlink3.mk" 680#.include "../../devel/jemalloc/buildlink3.mk"
692 681
693## Issues specific to: bootstrap AND NetBSD follow 682## Issues specific to: bootstrap AND NetBSD follow
694 683
695# rust i386 and sparc64 bootstraps are built for 8.0 684# rust i386 and sparc64 bootstraps are built for 8.0
696# and still depend on libstdc++.so.8. 685# and still depend on libstdc++.so.8.
697# Pull in compat80 on 9.x and newer. 686# Pull in compat80 on 9.x and newer.
698.if (${MACHINE_PLATFORM:MNetBSD-*-i386} || \ 687.if (${MACHINE_PLATFORM:MNetBSD-*-i386} || \
699 ${MACHINE_PLATFORM:MNetBSD-*-sparc64}) \ 688 ${MACHINE_PLATFORM:MNetBSD-*-sparc64}) \
700 && empty(OS_VERSION:M8.*) 689 && empty(OS_VERSION:M8.*)
701TOOL_DEPENDS+= compat80>=0:../../emulators/compat80 690TOOL_DEPENDS+= compat80>=0:../../emulators/compat80
702.endif 691.endif
703 692
704.include "../../mk/atomic64.mk" 693.include "../../mk/atomic64.mk"
705# This is for when we build natively: 694# This is for when we build natively:
706.if ${MACHINE_PLATFORM:MNetBSD-*-powerpc} || \ 695.if ${MACHINE_PLATFORM:MNetBSD-*-powerpc} || \
707 ${MACHINE_PLATFORM:MNetBSD-*-i386} || \ 696 ${MACHINE_PLATFORM:MNetBSD-*-i386} || \
708 ${MACHINE_PLATFORM:MNetBSD-*-mipsel} || \ 697 ${MACHINE_PLATFORM:MNetBSD-*-mipsel} || \
709 ${MACHINE_PLATFORM:MNetBSD-*-riscv64} 698 ${MACHINE_PLATFORM:MNetBSD-*-riscv64}
710# Make libatomic library available via a unique directory: 699# Make libatomic library available via a unique directory:
711DEPENDS+= libatomic-links>=0:../../devel/libatomic-links 700DEPENDS+= libatomic-links>=0:../../devel/libatomic-links
712.endif 701.endif
713 702
714TOOL_DEPENDS+= cmake-[0-9]*:../../devel/cmake 703TOOL_DEPENDS+= cmake-[0-9]*:../../devel/cmake
715.include "../../devel/cmake/buildlink3.mk" 704.include "../../devel/cmake/buildlink3.mk"
716.include "../../devel/zlib/buildlink3.mk" 705.include "../../devel/zlib/buildlink3.mk"
717.include "../../lang/python/tool.mk" 706.include "../../lang/python/tool.mk"
718.include "../../mk/bsd.pkg.mk" 707.include "../../mk/bsd.pkg.mk"

cvs diff -r1.34 -r1.35 pkgsrc/lang/rust/options.mk (switch to unified diff)

--- pkgsrc/lang/rust/options.mk 2024/01/15 12:24:21 1.34
+++ pkgsrc/lang/rust/options.mk 2024/03/03 14:53:32 1.35
@@ -1,70 +1,76 @@ @@ -1,70 +1,76 @@
1# $NetBSD: options.mk,v 1.34 2024/01/15 12:24:21 adam Exp $ 1# $NetBSD: options.mk,v 1.35 2024/03/03 14:53:32 he Exp $
2 2
3PKG_OPTIONS_VAR= PKG_OPTIONS.rust 3PKG_OPTIONS_VAR= PKG_OPTIONS.rust
4PKG_SUPPORTED_OPTIONS+= rust-cargo-static rust-docs 4PKG_SUPPORTED_OPTIONS+= rust-cargo-static rust-docs
5 5
6.include "../../mk/bsd.fast.prefs.mk" 6.include "../../mk/bsd.fast.prefs.mk"
7 7
8# The bundled LLVM current has issues building on SunOS. 8# The bundled LLVM current has issues building on SunOS.
9.if ${OPSYS} != "SunOS" 9.if ${OPSYS} != "SunOS"
10PKG_SUPPORTED_OPTIONS+= rust-internal-llvm 10PKG_SUPPORTED_OPTIONS+= rust-internal-llvm
11# There may be compatibility issues with the base LLVM on e.g. NetBSD. 11# There may be compatibility issues with the base LLVM on e.g. NetBSD.
12. if !empty(HAVE_LLVM) || ${MACHINE_PLATFORM:MDarwin-*-aarch64} 12. if !empty(HAVE_LLVM) || ${MACHINE_PLATFORM:MDarwin-*-aarch64}
13PKG_SUGGESTED_OPTIONS+= rust-internal-llvm 13PKG_SUGGESTED_OPTIONS+= rust-internal-llvm
14. endif 14. endif
15.endif 15.endif
16 16
17# If cross-building, always use the internal LLVM 17# If cross-building, always use the internal LLVM
18.if !empty(TARGET) 18.if !empty(TARGET)
19PKG_SUGGESTED_OPTIONS+= rust-internal-llvm 19PKG_SUGGESTED_OPTIONS+= rust-internal-llvm
20.endif 20.endif
21 21
22# (NetBSD)/sparc64 systems fail to build libunwind, 22# NetBSD/sparc64 when using the internal LLVM needs
23# a dependency of pkgsrc llvm, so use the internal one instead 23# to not use gcc 10.4 or 10.5 (as found in 10.0_BETA or 10.0), ref.
24.if ${MACHINE_PLATFORM:MNetBSD-*-sparc64} 24# https://github.com/rust-lang/rust/issues/117231
25PKG_SUGGESTED_OPTIONS+= rust-internal-llvm 25# (however, gcc from 9.x produces a working LLVM).
 26.if ${MACHINE_PLATFORM:MNetBSD-10.*-sparc64}
 27. if !empty(PKG_OPTIONS:Mrust-internal-llvm)
 28# Require GCC 12 (from pkgsrc) to correctly build the embedded LLVM (17.x).
 29GCC_REQD= 12
 30. endif
26.endif 31.endif
27 32
28# Bundle OpenSSL and curl into the cargo binary when producing 33# Bundle OpenSSL and curl into the cargo binary when producing
29# bootstraps on NetBSD. 34# bootstraps on NetBSD.
30.if ${OPSYS} == "NetBSD" && ${BUILD_TARGET} == "dist" 35.if ${OPSYS} == "NetBSD" && ${BUILD_TARGET} == "dist"
31PKG_SUGGESTED_OPTIONS+= rust-cargo-static 36PKG_SUGGESTED_OPTIONS+= rust-cargo-static
32.endif 37.endif
33 38
34PKG_OPTIONS_LEGACY_OPTS+= rust-llvm:rust-internal-llvm 39PKG_OPTIONS_LEGACY_OPTS+= rust-llvm:rust-internal-llvm
35 40
36.include "../../mk/bsd.options.mk" 41.include "../../mk/bsd.options.mk"
37 42
38# 43#
39# Use the internal copy of LLVM or the external one? 44# Use the internal copy of LLVM or the external one?
40# 45#
41.if empty(PKG_OPTIONS:Mrust-internal-llvm) 46.if empty(PKG_OPTIONS:Mrust-internal-llvm)
 47# External LLVM must be >= 15, ref. RELEASES.md
42BUILDLINK_API_DEPENDS.llvm+= llvm>=15 48BUILDLINK_API_DEPENDS.llvm+= llvm>=15
43.include "../../lang/libunwind/buildlink3.mk" 49.include "../../lang/libunwind/buildlink3.mk"
44.include "../../lang/llvm/buildlink3.mk" 50.include "../../lang/llvm/buildlink3.mk"
45CONFIGURE_ARGS+= --enable-llvm-link-shared 51CONFIGURE_ARGS+= --enable-llvm-link-shared
46CONFIGURE_ARGS+= --llvm-libunwind=system 52CONFIGURE_ARGS+= --llvm-libunwind=system
47CONFIGURE_ARGS+= --llvm-root=${BUILDLINK_PREFIX.llvm} 53CONFIGURE_ARGS+= --llvm-root=${BUILDLINK_PREFIX.llvm}
48.endif 54.endif
49 55
50# 56#
51# Link cargo statically against "native" libraries. 57# Link cargo statically against "native" libraries.
52# (openssl and curl specifically). 58# (openssl and curl specifically).
53# 59#
54.if !empty(PKG_OPTIONS:Mrust-cargo-static) 60.if !empty(PKG_OPTIONS:Mrust-cargo-static)
55CONFIGURE_ARGS+= --enable-cargo-native-static 61CONFIGURE_ARGS+= --enable-cargo-native-static
56.else 62.else
57BUILDLINK_API_DEPENDS.nghttp2+= nghttp2>=1.41.0 63BUILDLINK_API_DEPENDS.nghttp2+= nghttp2>=1.41.0
58BUILDLINK_API_DEPENDS.curl+= curl>=7.67.0 64BUILDLINK_API_DEPENDS.curl+= curl>=7.67.0
59.include "../../www/curl/buildlink3.mk" 65.include "../../www/curl/buildlink3.mk"
60.include "../../security/openssl/buildlink3.mk" 66.include "../../security/openssl/buildlink3.mk"
61.endif 67.endif
62 68
63# 69#
64# Install documentation. 70# Install documentation.
65# 71#
66.if !empty(PKG_OPTIONS:Mrust-docs) 72.if !empty(PKG_OPTIONS:Mrust-docs)
67CONFIGURE_ARGS+= --enable-docs 73CONFIGURE_ARGS+= --enable-docs
68.else 74.else
69CONFIGURE_ARGS+= --disable-docs 75CONFIGURE_ARGS+= --disable-docs
70.endif 76.endif

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

--- pkgsrc/lang/rust/platform.mk 2023/10/25 05:50:43 1.20
+++ pkgsrc/lang/rust/platform.mk 2024/03/03 14:53:32 1.21
@@ -1,26 +1,26 @@ @@ -1,26 +1,26 @@
1# $NetBSD: platform.mk,v 1.20 2023/10/25 05:50:43 pin Exp $ 1# $NetBSD: platform.mk,v 1.21 2024/03/03 14:53:32 he Exp $
2 2
3# This file encodes whether a given platform has support for rust. 3# This file encodes whether a given platform has support for rust.
4 4
5# Platforms where rust ought to work but does not require a link to an 5# Platforms where rust ought to work but does not require a link to an
6# open PR. 6# open PR.
7 7
8.if !defined(PLATFORM_SUPPORTS_RUST) 8.if !defined(PLATFORM_SUPPORTS_RUST)
9 9
10# Rust needs NetBSD>7 10# Rust needs NetBSD>8
11.for rust_arch in aarch64 earmv7hf i386 powerpc riscv64 sparc64 x86_64 11.for rust_arch in aarch64 earmv7hf i386 powerpc riscv64 sparc64 x86_64
12. for rust_os in Darwin FreeBSD Linux NetBSD SunOS 12. for rust_os in Darwin FreeBSD Linux NetBSD SunOS
13. if ${OPSYS} != "NetBSD" || empty(OS_VERSION:M[0-7].*) 13. if ${OPSYS} != "NetBSD" || empty(OS_VERSION:M[0-8].*)
14RUST_PLATFORMS+= ${rust_os}-*-${rust_arch} 14RUST_PLATFORMS+= ${rust_os}-*-${rust_arch}
15. endif 15. endif
16. endfor 16. endfor
17.endfor 17.endfor
18 18
19.for rust_platform in ${RUST_PLATFORMS} 19.for rust_platform in ${RUST_PLATFORMS}
20. if !empty(MACHINE_PLATFORM:M${rust_platform}) 20. if !empty(MACHINE_PLATFORM:M${rust_platform})
21PLATFORM_SUPPORTS_RUST= yes 21PLATFORM_SUPPORTS_RUST= yes
22. endif 22. endif
23.endfor 23.endfor
24PLATFORM_SUPPORTS_RUST?= no 24PLATFORM_SUPPORTS_RUST?= no
25 25
26.endif # !defined(PLATFORM_SUPPORTS_RUST) 26.endif # !defined(PLATFORM_SUPPORTS_RUST)

cvs diff -r1.15 -r1.16 pkgsrc/lang/rust/patches/patch-compiler_rustc__llvm_build.rs (switch to unified diff)

--- pkgsrc/lang/rust/patches/patch-compiler_rustc__llvm_build.rs 2024/01/06 19:00:19 1.15
+++ pkgsrc/lang/rust/patches/patch-compiler_rustc__llvm_build.rs 2024/03/03 14:53:32 1.16
@@ -1,52 +1,50 @@ @@ -1,52 +1,50 @@
1$NetBSD: patch-compiler_rustc__llvm_build.rs,v 1.15 2024/01/06 19:00:19 he Exp $ 1$NetBSD: patch-compiler_rustc__llvm_build.rs,v 1.16 2024/03/03 14:53:32 he Exp $
2 2
3Fix build on NetBSD HEAD-llvm. XXX there is probably a better way to do this. 3Fix build on NetBSD HEAD-llvm. XXX there is probably a better way to do this.
4 4
5Pick up -latomic tweak from 5Pick up -latomic tweak from
6https://github.com/rust-lang/rust/issues/104220 6https://github.com/rust-lang/rust/issues/104220
7and 7and
8https://github.com/rust-lang/rust/pull/104572 8https://github.com/rust-lang/rust/pull/104572
9 9
10--- compiler/rustc_llvm/build.rs.orig 2023-10-03 02:52:17.000000000 +0000 10--- compiler/rustc_llvm/build.rs.orig 2023-10-03 02:52:17.000000000 +0000
11+++ compiler/rustc_llvm/build.rs 11+++ compiler/rustc_llvm/build.rs
12@@ -249,6 +249,10 @@ fn main() { 12@@ -249,6 +249,10 @@ fn main() {
13 { 13 {
14 // 32-bit targets need to link libatomic. 14 // 32-bit targets need to link libatomic.
15 println!("cargo:rustc-link-lib=atomic"); 15 println!("cargo:rustc-link-lib=atomic");
16+ if target.contains("netbsd") 16+ if target.contains("netbsd")
17+ { 17+ {
18+ println!("cargo:rustc-link-lib=z"); 18+ println!("cargo:rustc-link-lib=z");
19+ } 19+ }
20 } else if target.contains("windows-gnu") { 20 } else if target.contains("windows-gnu") {
21 println!("cargo:rustc-link-lib=shell32"); 21 println!("cargo:rustc-link-lib=shell32");
22 println!("cargo:rustc-link-lib=uuid"); 22 println!("cargo:rustc-link-lib=uuid");
23@@ -258,6 +262,14 @@ fn main() { 23@@ -261,7 +265,11 @@ fn main() {
24 { 24 // On NetBSD/i386, gcc and g++ is built for i486 (to maximize backward compat)
25 println!("cargo:rustc-link-lib=z"); 25 // However, LLVM insists on using 64-bit atomics.
26 } else if target.contains("netbsd") { 26 // This gives rise to a need to link rust itself with -latomic for these targets
27+ // When build llvm for i486, and then need -latomic for 64-bit atomics 27- if target.starts_with("i586") || target.starts_with("i686") {
28+ if target.starts_with("i386") 28+ if target.starts_with("i386")
29+ || target.starts_with("i486") 29+ || target.starts_with("i486")
30+ || target.starts_with("i586") 30+ || target.starts_with("i586")
31+ || target.starts_with("i686") 31+ || target.starts_with("i686")
32+ { 32+ {
33+ println!("cargo:rustc-link-lib=atomic"); 33 println!("cargo:rustc-link-lib=atomic");
34+ } 34 }
35 println!("cargo:rustc-link-lib=z"); 35 println!("cargo:rustc-link-lib=z");
36 println!("cargo:rustc-link-lib=execinfo"); 36@@ -352,7 +360,13 @@ fn main() {
37 } 
38@@ -346,7 +358,13 @@ fn main() { 
39 "c++" 37 "c++"
40 } else if target.contains("netbsd") && llvm_static_stdcpp.is_some() { 38 } else if target.contains("netbsd") && llvm_static_stdcpp.is_some() {
41 // NetBSD uses a separate library when relocation is required 39 // NetBSD uses a separate library when relocation is required
42- "stdc++_p" 40- "stdc++_p"
43+ if env::var_os("PKGSRC_HAVE_LIBCPP").is_some() { 41+ if env::var_os("PKGSRC_HAVE_LIBCPP").is_some() {
44+ "c++_pic" 42+ "c++_pic"
45+ } else { 43+ } else {
46+ "stdc++_pic" 44+ "stdc++_pic"
47+ } 45+ }
48+ } else if env::var_os("PKGSRC_HAVE_LIBCPP").is_some() { 46+ } else if env::var_os("PKGSRC_HAVE_LIBCPP").is_some() {
49+ "c++" 47+ "c++"
50 } else if llvm_use_libcxx.is_some() { 48 } else if llvm_use_libcxx.is_some() {
51 "c++" 49 "c++"
52 } else { 50 } else {

cvs diff -r1.15 -r1.16 pkgsrc/lang/rust/patches/patch-compiler_rustc__target_src_spec_mod.rs (switch to unified diff)

--- pkgsrc/lang/rust/patches/patch-compiler_rustc__target_src_spec_mod.rs 2023/10/25 05:50:43 1.15
+++ pkgsrc/lang/rust/patches/patch-compiler_rustc__target_src_spec_mod.rs 2024/03/03 14:53:32 1.16
@@ -1,15 +1,14 @@ @@ -1,15 +1,14 @@
1$NetBSD: patch-compiler_rustc__target_src_spec_mod.rs,v 1.15 2023/10/25 05:50:43 pin Exp $ 1$NetBSD: patch-compiler_rustc__target_src_spec_mod.rs,v 1.16 2024/03/03 14:53:32 he Exp $
2 2
3Add i586(pentium) and mipsel NetBSD targets. 3Add entry for NetBSD/mips64el.
4 4
5--- compiler/rustc_target/src/spec/mod.rs.orig 2021-03-23 16:15:10.000000000 +0000 5--- compiler/rustc_target/src/spec/mod.rs.orig 2024-01-13 14:20:59.236278792 +0000
6+++ compiler/rustc_target/src/spec/mod.rs 6+++ compiler/rustc_target/src/spec/mod.rs
7@@ -1324,6 +1324,8 @@ supported_targets! { 7@@ -1532,6 +1532,7 @@ supported_targets! {
8 ("armv6-unknown-netbsd-eabihf", armv6_unknown_netbsd_eabihf), 
9 ("armv7-unknown-netbsd-eabihf", armv7_unknown_netbsd_eabihf), 8 ("armv7-unknown-netbsd-eabihf", armv7_unknown_netbsd_eabihf),
 9 ("i586-unknown-netbsd", i586_unknown_netbsd),
10 ("i686-unknown-netbsd", i686_unknown_netbsd), 10 ("i686-unknown-netbsd", i686_unknown_netbsd),
11+ ("i586-unknown-netbsd", i586_unknown_netbsd), 11+ ("mips64el-unknown-netbsd", mips64el_unknown_netbsd),
12+ ("mipsel-unknown-netbsd", mipsel_unknown_netbsd), 12 ("mipsel-unknown-netbsd", mipsel_unknown_netbsd),
13 ("powerpc-unknown-netbsd", powerpc_unknown_netbsd), 13 ("powerpc-unknown-netbsd", powerpc_unknown_netbsd),
14 ("riscv64gc-unknown-netbsd", riscv64gc_unknown_netbsd), 14 ("riscv64gc-unknown-netbsd", riscv64gc_unknown_netbsd),
15 ("sparc64-unknown-netbsd", sparc64_unknown_netbsd), 

File Added: pkgsrc/lang/rust/patches/patch-compiler_rustc__target_src_spec_base_netbsd.rs
$NetBSD: patch-compiler_rustc__target_src_spec_base_netbsd.rs,v 1.1 2024/03/03 14:53:32 he Exp $

For the benefit of powerpc, when libatomic-links is installed,
search the directory containing the symlinks to -latomic.

--- compiler/rustc_target/src/spec/base/netbsd.rs.orig	2024-01-06 19:57:14.887897867 +0000
+++ compiler/rustc_target/src/spec/base/netbsd.rs
@@ -1,12 +1,23 @@
-use crate::spec::{cvs, RelroLevel, TargetOptions};
+use crate::spec::{cvs, Cc, Lld, RelroLevel, LinkerFlavor, TargetOptions};
 
 pub fn opts() -> TargetOptions {
+    let add_linker_paths =
+        &[
+            // For the benefit of powerpc, when libatomic-links is installed,
+            "-Wl,-R@PREFIX@/lib/libatomic",
+            "-Wl,-L@PREFIX@/lib/libatomic",
+        ];
+    let pre_link_args = TargetOptions::link_args(
+        LinkerFlavor::Gnu(Cc::Yes, Lld::No),
+        add_linker_paths
+    );
     TargetOptions {
         os: "netbsd".into(),
         dynamic_linking: true,
         families: cvs!["unix"],
         no_default_libraries: false,
         has_rpath: true,
+        pre_link_args,
         position_independent_executables: true,
         relro_level: RelroLevel::Full,
         use_ctors_section: true,

File Added: pkgsrc/lang/rust/patches/patch-compiler_rustc__target_src_spec_targets_mips64el__unknown__netbsd.rs
$NetBSD: patch-compiler_rustc__target_src_spec_targets_mips64el__unknown__netbsd.rs,v 1.1 2024/03/03 14:53:32 he Exp $

Provide a mips64el target with N32, suitable for NetBSD/mips64el.

--- compiler/rustc_target/src/spec/targets/mips64el_unknown_netbsd.rs.orig	2024-01-13 14:16:30.122042614 +0000
+++ compiler/rustc_target/src/spec/targets/mips64el_unknown_netbsd.rs
@@ -0,0 +1,22 @@
+use crate::abi::Endian;
+use crate::spec::{base, Target, TargetOptions};
+
+pub fn target() -> Target {
+    let mut base = base::netbsd::opts();
+    base.max_atomic_width = Some(32);
+    base.cpu = "mips32".into();
+
+    Target {
+        llvm_target: "mipsel-unknown-netbsd".into(),
+        pointer_width: 32,
+        data_layout: "e-m:m-p:32:32-i8:8:32-i16:16:32-i64:64-n32-S64".into(),
+        arch: "mips".into(),
+        options: TargetOptions {
+            abi: "n32".into(),
+            features: "+soft-float,+abi=n32".into(),
+            endian: Endian::Little,
+            mcount: "__mcount".into(),
+            ..base
+        },
+    }
+}

File Added: pkgsrc/lang/rust/patches/patch-src_bootstrap_src_core_build__steps_compile.rs
$NetBSD: patch-src_bootstrap_src_core_build__steps_compile.rs,v 1.1 2024/03/03 14:53:32 he Exp $

On Darwin, do not use @rpath for internal libraries.

--- src/bootstrap/src/core/build_steps/compile.rs.orig	2024-01-06 20:42:20.028206400 +0000
+++ src/bootstrap/src/core/build_steps/compile.rs
@@ -626,7 +626,7 @@ fn copy_sanitizers(
             || target == "x86_64-apple-ios"
         {
             // Update the library’s install name to reflect that it has been renamed.
-            apple_darwin_update_library_name(&dst, &format!("@rpath/{}", &runtime.name));
+            apple_darwin_update_library_name(&dst, &format!("@PREFIX@/lib/{}", &runtime.name));
             // Upon renaming the install name, the code signature of the file will invalidate,
             // so we will sign it again.
             apple_darwin_sign_file(&dst);

File Added: pkgsrc/lang/rust/patches/patch-src_bootstrap_src_core_build__steps_llvm.rs

File Added: pkgsrc/lang/rust/patches/patch-src_bootstrap_src_core_builder.rs
$NetBSD: patch-src_bootstrap_src_core_builder.rs,v 1.1 2024/03/03 14:53:32 he Exp $

Use @PREFIX@, not $ORIGIN in rpath.

--- src/bootstrap/src/core/builder.rs.orig	2024-01-13 20:06:50.748741545 +0000
+++ src/bootstrap/src/core/builder.rs
@@ -1678,7 +1678,7 @@ impl<'a> Builder<'a> {
                 && !target.contains("xous")
             {
                 rustflags.arg("-Clink-args=-Wl,-z,origin");
-                Some(format!("-Wl,-rpath,$ORIGIN/../{libdir}"))
+                Some(format!("-Wl,-rpath,@PREFIX@/{libdir}"))
             } else {
                 None
             };

File Added: pkgsrc/lang/rust/patches/patch-src_bootstrap_src_lib.rs
$NetBSD: patch-src_bootstrap_src_lib.rs,v 1.1 2024/03/03 14:53:32 he Exp $

Don't filter out optimization flags.
FreeBSD has a particular C++ runtime library name

--- src/bootstrap/src/lib.rs.orig	2024-01-06 20:52:50.892941220 +0000
+++ src/bootstrap/src/lib.rs
@@ -1195,13 +1195,13 @@ impl Build {
             .args()
             .iter()
             .map(|s| s.to_string_lossy().into_owned())
-            .filter(|s| !s.starts_with("-O") && !s.starts_with("/O"))
             .collect::<Vec<String>>();
 
         // If we're compiling C++ on macOS then we add a flag indicating that
         // we want libc++ (more filled out than libstdc++), ensuring that
         // LLVM/etc are all properly compiled.
-        if matches!(c, CLang::Cxx) && target.contains("apple-darwin") {
+        if matches!(c, CLang::Cxx) && 
+            (target.contains("apple-darwin") || target.contains("freebsd")) {
             base.push("-stdlib=libc++".into());
         }
 

File Added: pkgsrc/lang/rust/patches/patch-vendor_libc-0.2.148_src_unix_bsd_netbsdlike+netbsd_mips.rs
$NetBSD: patch-vendor_libc-0.2.148_src_unix_bsd_netbsdlike+netbsd_mips.rs,v 1.1 2024/03/03 14:53:33 he Exp $

Add entry for NetBSD/mips.

--- vendor/libc-0.2.148/src/unix/bsd/netbsdlike/netbsd/mips.rs.orig	2024-01-06 21:03:21.781003759 +0000
+++ vendor/libc-0.2.148/src/unix/bsd/netbsdlike/netbsd/mips.rs	2024-01-06 22:27:31.830676317 +0000
@@ -0,0 +1,22 @@
+use PT_FIRSTMACH;
+
+pub type c_long = i32;
+pub type c_ulong = u32;
+pub type c_char = i8;
+pub type __cpu_simple_lock_nv_t = ::c_int;
+
+// should be pub(crate), but that requires Rust 1.18.0
+cfg_if! {
+    if #[cfg(libc_const_size_of)] {
+        #[doc(hidden)]
+        pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_longlong>() - 1;
+    } else {
+        #[doc(hidden)]
+        pub const _ALIGNBYTES: usize = 8 - 1;
+    }
+}
+
+pub const PT_GETREGS: ::c_int = PT_FIRSTMACH + 1;
+pub const PT_SETREGS: ::c_int = PT_FIRSTMACH + 2;
+pub const PT_GETFPREGS: ::c_int = PT_FIRSTMACH + 3;
+pub const PT_SETFPREGS: ::c_int = PT_FIRSTMACH + 4;

File Added: pkgsrc/lang/rust/patches/patch-vendor_libc-0.2.148_src_unix_bsd_netbsdlike_netbsd_mod.rs
$NetBSD: patch-vendor_libc-0.2.148_src_unix_bsd_netbsdlike_netbsd_mod.rs,v 1.1 2024/03/03 14:53:33 he Exp $

Add entries for execinfo, and support
for NetBSD/mips and NetBSD/riscv64.

--- vendor/libc-0.2.148/src/unix/bsd/netbsdlike/netbsd/mod.rs.orig	2024-01-06 22:33:33.911876204 +0000
+++ vendor/libc-0.2.148/src/unix/bsd/netbsdlike/netbsd/mod.rs
@@ -10,7 +10,7 @@ type __pthread_spin_t = __cpu_simple_loc
 pub type vm_size_t = ::uintptr_t; // FIXME: deprecated since long time
 pub type lwpid_t = ::c_uint;
 pub type shmatt_t = ::c_uint;
-pub type cpuid_t = u64;
+pub type cpuid_t = ::c_ulong;
 pub type cpuset_t = _cpuset;
 pub type pthread_spin_t = ::c_uchar;
 pub type timer_t = ::c_int;
@@ -3153,6 +3153,22 @@ extern "C" {
     pub fn kinfo_getvmmap(pid: ::pid_t, cntp: *mut ::size_t) -> *mut kinfo_vmentry;
 }
 
+#[link(name = "execinfo")]
+extern "C" {
+    pub fn backtrace(addrlist: *mut *mut ::c_void, len: ::size_t) -> ::size_t;
+    pub fn backtrace_symbols(addrlist: *const *mut ::c_void, len: ::size_t) -> *mut *mut ::c_char;
+    pub fn backtrace_symbols_fd(
+        addrlist: *const *mut ::c_void,
+        len: ::size_t,
+        fd: ::c_int,
+    ) -> ::c_int;
+    pub fn backtrace_symbols_fmt(
+        addrlist: *const *mut ::c_void,
+        len: ::size_t,
+        fmt: *const ::c_char,
+    ) -> *mut *mut ::c_char;
+}
+
 cfg_if! {
     if #[cfg(target_arch = "aarch64")] {
         mod aarch64;
@@ -3172,6 +3188,12 @@ cfg_if! {
     } else if #[cfg(target_arch = "x86")] {
         mod x86;
         pub use self::x86::*;
+    } else if #[cfg(target_arch = "mips")] {
+        mod mips;
+        pub use self::mips::*;
+    } else if #[cfg(target_arch = "riscv64")] {
+        mod riscv64;
+        pub use self::riscv64::*;
     } else {
         // Unknown target_arch
     }

File Added: pkgsrc/lang/rust/patches/patch-vendor_libc-0.2.148_src_unix_bsd_netbsdlike_netbsd_riscv64.rs
$NetBSD: patch-vendor_libc-0.2.148_src_unix_bsd_netbsdlike_netbsd_riscv64.rs,v 1.1 2024/03/03 14:53:33 he Exp $

Add support for NetBSD/riscv64.

--- vendor/libc-0.2.148/src/unix/bsd/netbsdlike/netbsd/riscv64.rs.orig	2024-01-06 21:03:21.781003759 +0000
+++ vendor/libc-0.2.148/src/unix/bsd/netbsdlike/netbsd/riscv64.rs	2024-01-06 22:31:25.289387359 +0000
@@ -0,0 +1,22 @@
+use PT_FIRSTMACH;
+
+pub type c_long = i64;
+pub type c_ulong = u64;
+pub type c_char = u8;
+pub type __cpu_simple_lock_nv_t = ::c_int;
+
+// should be pub(crate), but that requires Rust 1.18.0
+cfg_if! {
+    if #[cfg(libc_const_size_of)] {
+        #[doc(hidden)]
+        pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_long>() - 1;
+    } else {
+        #[doc(hidden)]
+        pub const _ALIGNBYTES: usize = 8 - 1;
+    }
+}
+
+pub const PT_GETREGS: ::c_int = PT_FIRSTMACH + 0;
+pub const PT_SETREGS: ::c_int = PT_FIRSTMACH + 1;
+pub const PT_GETFPREGS: ::c_int = PT_FIRSTMACH + 2;
+pub const PT_SETFPREGS: ::c_int = PT_FIRSTMACH + 3;

File Added: pkgsrc/lang/rust/patches/patch-vendor_libc-0.2.148_src_unix_solarish_mod.rs
$NetBSD: patch-vendor_libc-0.2.148_src_unix_solarish_mod.rs,v 1.1 2024/03/03 14:53:33 he Exp $

Fix xattr build.

--- vendor/libc-0.2.148/src/unix/solarish/mod.rs.orig	2024-01-06 22:41:58.182128108 +0000
+++ vendor/libc-0.2.148/src/unix/solarish/mod.rs
@@ -1523,6 +1523,8 @@ pub const EOWNERDEAD: ::c_int = 58;
 pub const ENOTRECOVERABLE: ::c_int = 59;
 pub const ENOSTR: ::c_int = 60;
 pub const ENODATA: ::c_int = 61;
+// This is not supported but is required for xattr
+pub const ENOATTR: ::c_int = ::ENODATA;
 pub const ETIME: ::c_int = 62;
 pub const ENOSR: ::c_int = 63;
 pub const ENONET: ::c_int = 64;

File Added: pkgsrc/lang/rust/patches/patch-vendor_libc-0.2.149_src_unix_bsd_netbsdlike_netbsd_mips.rs

File Added: pkgsrc/lang/rust/patches/patch-vendor_libc-0.2.149_src_unix_bsd_netbsdlike_netbsd_mod.rs

File Added: pkgsrc/lang/rust/patches/patch-vendor_libc-0.2.149_src_unix_bsd_netbsdlike_netbsd_riscv64.rs

File Added: pkgsrc/lang/rust/patches/patch-vendor_libc-0.2.149_src_unix_solarish_mod.rs

File Deleted: pkgsrc/lang/rust/patches/patch-compiler_rustc__target_src_spec_i586__unknown__netbsd.rs

File Deleted: pkgsrc/lang/rust/patches/patch-compiler_rustc__target_src_spec_mips64el__unknown__netbsd.rs

File Deleted: pkgsrc/lang/rust/patches/patch-src_bootstrap_llvm.rs

File Deleted: pkgsrc/lang/rust/patches/patch-vendor_libc-0.2.138_src_unix_bsd_netbsdlike_netbsd_mips.rs

File Deleted: pkgsrc/lang/rust/patches/patch-vendor_libc-0.2.138_src_unix_bsd_netbsdlike_netbsd_riscv64.rs

File Deleted: pkgsrc/lang/rust/patches/patch-vendor_libc_src_unix_bsd_netbsdlike_netbsd_riscv64.rs

File Deleted: pkgsrc/lang/rust/patches/patch-compiler_rustc__target_src_spec_mipsel__unknown__netbsd.rs

File Deleted: pkgsrc/lang/rust/patches/patch-vendor_libc_src_unix_bsd_netbsdlike_netbsd_mips.rs

File Deleted: pkgsrc/lang/rust/patches/patch-compiler_rustc__target_src_spec_netbsd__base.rs

File Deleted: pkgsrc/lang/rust/patches/patch-vendor_libc_src_unix_bsd_netbsdlike_netbsd_mod.rs

cvs diff -r1.6 -r1.7 pkgsrc/lang/rust/patches/patch-library_backtrace_src_symbolize_gimli_elf.rs (switch to unified diff)

--- pkgsrc/lang/rust/patches/patch-library_backtrace_src_symbolize_gimli_elf.rs 2023/10/25 05:50:43 1.6
+++ pkgsrc/lang/rust/patches/patch-library_backtrace_src_symbolize_gimli_elf.rs 2024/03/03 14:53:32 1.7
@@ -1,24 +1,25 @@ @@ -1,24 +1,25 @@
1$NetBSD: patch-library_backtrace_src_symbolize_gimli_elf.rs,v 1.6 2023/10/25 05:50:43 pin Exp $ 1$NetBSD: patch-library_backtrace_src_symbolize_gimli_elf.rs,v 1.7 2024/03/03 14:53:32 he Exp $
2 2
3Make NetBSD also find its debug libraries, if present. 3Make NetBSD also find its debug libraries, if present.
4 4
5--- library/backtrace/src/symbolize/gimli/elf.rs.orig 2022-04-04 09:41:26.000000000 +0000 5--- library/backtrace/src/symbolize/gimli/elf.rs.orig 2022-04-04 09:41:26.000000000 +0000
6+++ library/backtrace/src/symbolize/gimli/elf.rs 6+++ library/backtrace/src/symbolize/gimli/elf.rs
7@@ -276,11 +276,16 @@ fn decompress_zlib(input: &[u8], output: 7@@ -304,11 +304,17 @@ fn decompress_zlib(input: &[u8], output:
8 } 8 }
9 } 9 }
10  10
11+#[cfg(target_os = "netbsd")] 11+#[cfg(target_os = "netbsd")]
12+const DEBUG_PATH: &[u8] = b"/usr/libdata/debug"; 12+const DEBUG_PATH: &[u8] = b"/usr/libdata/debug";
13+#[cfg(not(target_os = "netbsd"))] 13+#[cfg(not(target_os = "netbsd"))]
14 const DEBUG_PATH: &[u8] = b"/usr/lib/debug"; 14 const DEBUG_PATH: &[u8] = b"/usr/lib/debug";
15  15
16 fn debug_path_exists() -> bool { 16 fn debug_path_exists() -> bool {
17 cfg_if::cfg_if! { 17 cfg_if::cfg_if! {
18- if #[cfg(any(target_os = "freebsd", target_os = "linux"))] { 18- if #[cfg(any(target_os = "freebsd", target_os = "hurd", target_os = "linux"))] {
19+ if #[cfg(any(target_os = "freebsd",  19+ if #[cfg(any(target_os = "freebsd",
20+ target_os = "netbsd", 20+ target_os = "netbsd",
 21+ target_os = "hurd",
21+ target_os = "linux"))] { 22+ target_os = "linux"))] {
22 use core::sync::atomic::{AtomicU8, Ordering}; 23 use core::sync::atomic::{AtomicU8, Ordering};
23 static DEBUG_PATH_EXISTS: AtomicU8 = AtomicU8::new(0); 24 static DEBUG_PATH_EXISTS: AtomicU8 = AtomicU8::new(0);
24  25

cvs diff -r1.21 -r1.22 pkgsrc/lang/rust/patches/patch-src_bootstrap_bootstrap.py (switch to unified diff)

--- pkgsrc/lang/rust/patches/patch-src_bootstrap_bootstrap.py 2024/01/06 19:00:19 1.21
+++ pkgsrc/lang/rust/patches/patch-src_bootstrap_bootstrap.py 2024/03/03 14:53:32 1.22
@@ -1,37 +1,47 @@ @@ -1,37 +1,47 @@
1$NetBSD: patch-src_bootstrap_bootstrap.py,v 1.21 2024/01/06 19:00:19 he Exp $ 1$NetBSD: patch-src_bootstrap_bootstrap.py,v 1.22 2024/03/03 14:53:32 he Exp $
2 2
3Use `uname -p` on NetBSD, as that is reliable and sensible there. 3Use `uname -p` on NetBSD, as that is reliable and sensible there.
4Handle earmv[67]hf for NetBSD. 4Handle earmv[67]hf for NetBSD.
 5Also use @PREFIX@ and not $ORIGIN in rpath.
5 6
6--- src/bootstrap/bootstrap.py.orig 2023-07-12 03:32:40.000000000 +0000 7--- src/bootstrap/bootstrap.py.orig 2023-07-12 03:32:40.000000000 +0000
7+++ src/bootstrap/bootstrap.py 8+++ src/bootstrap/bootstrap.py
8@@ -271,6 +271,11 @@ def default_build_triple(verbose): 9@@ -271,6 +271,11 @@ def default_build_triple(verbose):
9 'GNU': 'unknown-hurd', 10 'GNU': 'unknown-hurd',
10 } 11 }
11  12
12+ # For NetBSD, use `uname -p`, as there it is reliable & sensible 13+ # For NetBSD, use `uname -p`, as there it is reliable & sensible
13+ if kernel == 'NetBSD': 14+ if kernel == 'NetBSD':
14+ cputype = subprocess.check_output( 15+ cputype = subprocess.check_output(
15+ ['uname', '-p']).strip().decode(default_encoding) 16+ ['uname', '-p']).strip().decode(default_encoding)
16+ 17+
17 # Consider the direct transformation first and then the special cases 18 # Consider the direct transformation first and then the special cases
18 if kernel in kerneltype_mapper: 19 if kernel in kerneltype_mapper:
19 kernel = kerneltype_mapper[kernel] 20 kernel = kerneltype_mapper[kernel]
20@@ -374,10 +379,16 @@ def default_build_triple(verbose): 21@@ -374,10 +379,16 @@ def default_build_triple(verbose):
21 kernel = 'linux-androideabi' 22 kernel = 'linux-androideabi'
22 else: 23 else:
23 kernel += 'eabihf' 24 kernel += 'eabihf'
24- elif cputype in {'armv7l', 'armv8l'}: 25- elif cputype in {'armv7l', 'armv8l'}:
25+ elif cputype in {'armv6hf', 'earmv6hf'}: 26+ elif cputype in {'armv6hf', 'earmv6hf'}:
26+ cputype = 'armv6' 27+ cputype = 'armv6'
27+ if kernel == 'unknown-netbsd': 28+ if kernel == 'unknown-netbsd':
28+ kernel += '-eabihf' 29+ kernel += '-eabihf'
29+ elif cputype in {'armv7l', 'earmv7hf', 'armv8l'}: 30+ elif cputype in {'armv7l', 'earmv7hf', 'armv8l'}:
30 cputype = 'armv7' 31 cputype = 'armv7'
31 if kernel == 'linux-android': 32 if kernel == 'linux-android':
32 kernel = 'linux-androideabi' 33 kernel = 'linux-androideabi'
33+ elif kernel == 'unknown-netbsd': 34+ elif kernel == 'unknown-netbsd':
34+ kernel += '-eabihf' 35+ kernel += '-eabihf'
35 else: 36 else:
36 kernel += 'eabihf' 37 kernel += 'eabihf'
37 elif cputype == 'mips': 38 elif cputype == 'mips':
 39@@ -735,7 +746,7 @@ class RustBuild(object):
 40 rpath_entries = [
 41 # Relative default, all binary and dynamic libraries we ship
 42 # appear to have this (even when `../lib` is redundant).
 43- "$ORIGIN/../lib",
 44+ "@PREFIX@/lib",
 45 os.path.join(os.path.realpath(nix_deps_dir), "lib")
 46 ]
 47 patchelf_args = ["--set-rpath", ":".join(rpath_entries)]

File Deleted: pkgsrc/lang/rust/patches/patch-src_bootstrap_builder.rs

File Deleted: pkgsrc/lang/rust/patches/patch-src_bootstrap_compile.rs

File Deleted: pkgsrc/lang/rust/patches/patch-src_bootstrap_lib.rs

cvs diff -r1.12 -r1.13 pkgsrc/lang/rust/patches/patch-src_tools_rust-installer_install-template.sh (switch to unified diff)

--- pkgsrc/lang/rust/patches/patch-src_tools_rust-installer_install-template.sh 2024/01/22 11:00:16 1.12
+++ pkgsrc/lang/rust/patches/patch-src_tools_rust-installer_install-template.sh 2024/03/03 14:53:33 1.13
@@ -1,179 +1,179 @@ @@ -1,179 +1,179 @@
1$NetBSD: patch-src_tools_rust-installer_install-template.sh,v 1.12 2024/01/22 11:00:16 adam Exp $ 1$NetBSD: patch-src_tools_rust-installer_install-template.sh,v 1.13 2024/03/03 14:53:33 he Exp $
2 2
3No logging to 'install.log'. 3No logging to 'install.log'.
4Do not create 'uninstall.sh'. 4Do not create 'uninstall.sh'.
5Do not make file backups (filename.old), so these will not end up in the final package. 5Do not make file backups (filename.old), so these will not end up in the final package.
6 6
7Rewrite to not use a whole lot of subprocesses just for doing 7Rewrite to not use a whole lot of subprocesses just for doing
8pattern matching and substitution in the install phase using "grep" 8pattern matching and substitution in the install phase using "grep"
9and "sed" when shell builtin "case" and "omit shortest match" ops 9and "sed" when shell builtin "case" and "omit shortest match" ops
10should do just fine. 10should do just fine.
11 11
12--- src/tools/rust-installer/install-template.sh.orig 2023-12-04 19:48:34.000000000 +0000 12--- src/tools/rust-installer/install-template.sh.orig 2023-12-21 16:55:28.000000000 +0000
13+++ src/tools/rust-installer/install-template.sh 13+++ src/tools/rust-installer/install-template.sh
14@@ -6,20 +6,12 @@ set -u 14@@ -6,20 +6,12 @@ set -u
15 init_logging() { 15 init_logging() {
16 local _abs_libdir="$1" 16 local _abs_libdir="$1"
17 local _logfile="$_abs_libdir/$TEMPLATE_REL_MANIFEST_DIR/install.log" 17 local _logfile="$_abs_libdir/$TEMPLATE_REL_MANIFEST_DIR/install.log"
18- rm -f "$_logfile" 18- rm -f "$_logfile"
19- need_ok "failed to remove old installation log" 19- need_ok "failed to remove old installation log"
20- touch "$_logfile" 20- touch "$_logfile"
21- need_ok "failed to create installation log" 21- need_ok "failed to create installation log"
22 LOGFILE="$_logfile" 22 LOGFILE="$_logfile"
23 } 23 }
24  24
25 log_line() { 25 log_line() {
26 local _line="$1" 26 local _line="$1"
27  27
28- if [ -n "${LOGFILE-}" -a -e "${LOGFILE-}" ]; then 28- if [ -n "${LOGFILE-}" -a -e "${LOGFILE-}" ]; then
29- echo "$_line" >> "$LOGFILE" 29- echo "$_line" >> "$LOGFILE"
30- # Ignore errors, which may happen e.g. after the manifest dir is deleted 30- # Ignore errors, which may happen e.g. after the manifest dir is deleted
31- fi 31- fi
32 } 32 }
33  33
34 msg() { 34 msg() {
35@@ -433,8 +425,8 @@ uninstall_components() { 35@@ -433,8 +425,8 @@ uninstall_components() {
36 local _directive 36 local _directive
37 while read _directive; do 37 while read _directive; do
38  38
39- local _command=`echo $_directive | cut -f1 -d:` 39- local _command=`echo $_directive | cut -f1 -d:`
40- local _file=`echo $_directive | cut -f2 -d:` 40- local _file=`echo $_directive | cut -f2 -d:`
41+ local _command=${_directive%%:*} 41+ local _command=${_directive%%:*}
42+ local _file=${_directive#*:} 42+ local _file=${_directive#*:}
43  43
44 # Sanity checks 44 # Sanity checks
45 if [ ! -n "$_command" ]; then critical_err "malformed installation directive"; fi 45 if [ ! -n "$_command" ]; then critical_err "malformed installation directive"; fi
46@@ -541,8 +533,8 @@ install_components() { 46@@ -541,8 +533,8 @@ install_components() {
47 local _directive 47 local _directive
48 while read _directive; do 48 while read _directive; do
49  49
50- local _command=`echo $_directive | cut -f1 -d:` 50- local _command=`echo $_directive | cut -f1 -d:`
51- local _file=`echo $_directive | cut -f2 -d:` 51- local _file=`echo $_directive | cut -f2 -d:`
52+ local _command=${_directive%%:*} 52+ local _command=${_directive%%:*}
53+ local _file=${_directive#*:} 53+ local _file=${_directive#*:}
54  54
55 # Sanity checks 55 # Sanity checks
56 if [ ! -n "$_command" ]; then critical_err "malformed installation directive"; fi 56 if [ ! -n "$_command" ]; then critical_err "malformed installation directive"; fi
57@@ -551,36 +543,24 @@ install_components() { 57@@ -551,36 +543,24 @@ install_components() {
58 # Decide the destination of the file 58 # Decide the destination of the file
59 local _file_install_path="$_dest_prefix/$_file" 59 local _file_install_path="$_dest_prefix/$_file"
60  60
61- if echo "$_file" | grep "^etc/" > /dev/null 61- if echo "$_file" | grep "^etc/" > /dev/null
62- then 62- then
63- local _f="$(echo "$_file" | sed 's/^etc\///')" 63- local _f="$(echo "$_file" | sed 's/^etc\///')"
64- _file_install_path="$CFG_SYSCONFDIR/$_f" 64- _file_install_path="$CFG_SYSCONFDIR/$_f"
65- fi 65- fi
66- 66-
67- if echo "$_file" | grep "^bin/" > /dev/null 67- if echo "$_file" | grep "^bin/" > /dev/null
68- then 68- then
69- local _f="$(echo "$_file" | sed 's/^bin\///')" 69- local _f="$(echo "$_file" | sed 's/^bin\///')"
70- _file_install_path="$CFG_BINDIR/$_f" 70- _file_install_path="$CFG_BINDIR/$_f"
71- fi 71- fi
72- 72-
73- if echo "$_file" | grep "^lib/" > /dev/null 73- if echo "$_file" | grep "^lib/" > /dev/null
74- then 74- then
75- local _f="$(echo "$_file" | sed 's/^lib\///')" 75- local _f="$(echo "$_file" | sed 's/^lib\///')"
76- _file_install_path="$CFG_LIBDIR/$_f" 76- _file_install_path="$CFG_LIBDIR/$_f"
77- fi 77- fi
78- 78-
79- if echo "$_file" | grep "^share" > /dev/null 79- if echo "$_file" | grep "^share" > /dev/null
80- then 80- then
81- local _f="$(echo "$_file" | sed 's/^share\///')" 81- local _f="$(echo "$_file" | sed 's/^share\///')"
82- _file_install_path="$CFG_DATADIR/$_f" 82- _file_install_path="$CFG_DATADIR/$_f"
83- fi 83- fi
84- 84-
85- if echo "$_file" | grep "^share/man/" > /dev/null 85- if echo "$_file" | grep "^share/man/" > /dev/null
86- then 86- then
87- local _f="$(echo "$_file" | sed 's/^share\/man\///')" 87- local _f="$(echo "$_file" | sed 's/^share\/man\///')"
88- _file_install_path="$CFG_MANDIR/$_f" 88- _file_install_path="$CFG_MANDIR/$_f"
89- fi 89- fi
90- 90-
91+ case "$_file" in 91+ case "$_file" in
92+ etc/*) 92+ etc/*)
93+ local _f=${_file#"etc/"} 93+ local _f=${_file#"etc/"}
94+ _file_install_path="$CFG_DESTDIR_PREFIX/share/doc/cargo/$_f" 94+ _file_install_path="$CFG_DESTDIR_PREFIX/share/doc/cargo/$_f"
95+ ;; 95+ ;;
96+ bin/*) 96+ bin/*)
97+ local _f=${_file#"bin/"} 97+ local _f=${_file#"bin/"}
98+ _file_install_path="$CFG_BINDIR/$_f" 98+ _file_install_path="$CFG_BINDIR/$_f"
99+ ;; 99+ ;;
100+ lib/*) 100+ lib/*)
101+ local _f=${_file#"lib/"} 101+ local _f=${_file#"lib/"}
102+ _file_install_path="$CFG_LIBDIR/$_f" 102+ _file_install_path="$CFG_LIBDIR/$_f"
103+ ;; 103+ ;;
104+ share/man/*) 104+ share/man/*)
105+ local _f=${_file#"share/man/"} 105+ local _f=${_file#"share/man/"}
106+ _file_install_path="$CFG_MANDIR/$_f" 106+ _file_install_path="$CFG_MANDIR/$_f"
107+ ;; 107+ ;;
108+ share/doc/*) 108+ share/doc/*)
109 # HACK: Try to support overriding --docdir. Paths with the form 109 # HACK: Try to support overriding --docdir. Paths with the form
110 # "share/doc/$product/" can be redirected to a single --docdir 110 # "share/doc/$product/" can be redirected to a single --docdir
111 # path. If the following detects that --docdir has been specified 111 # path. If the following detects that --docdir has been specified
112@@ -591,14 +571,17 @@ install_components() { 112@@ -591,14 +571,17 @@ install_components() {
113 # contents of those directories are _not_ disjoint. Since this feature 113 # contents of those directories are _not_ disjoint. Since this feature
114 # is almost entirely to support 'make install' anyway I don't expect 114 # is almost entirely to support 'make install' anyway I don't expect
115 # this problem to be a big deal in practice. 115 # this problem to be a big deal in practice.
116- if [ "$CFG_DOCDIR" != "<default>" ] 116- if [ "$CFG_DOCDIR" != "<default>" ]
117- then 117- then
118- if echo "$_file" | grep "^share/doc/" > /dev/null 118- if echo "$_file" | grep "^share/doc/" > /dev/null
119- then 119- then
120- local _f="$(echo "$_file" | sed 's/^share\/doc\/[^/]*\///')" 120- local _f="$(echo "$_file" | sed 's/^share\/doc\/[^/]*\///')"
121- _file_install_path="$CFG_DOCDIR/$_f" 121- _file_install_path="$CFG_DOCDIR/$_f"
122- fi 122- fi
123- fi 123- fi
124+ if [ "$CFG_DOCDIR" != "<default>" ]; then 124+ if [ "$CFG_DOCDIR" != "<default>" ]; then
125+ local _f=${_file#"share/doc/"*/} 125+ local _f=${_file#"share/doc/"*/}
126+ _file_install_path="$CFG_DOCDIR/$_f" 126+ _file_install_path="$CFG_DOCDIR/$_f"
127+ fi 127+ fi
128+ ;; 128+ ;;
129+ share/*) 129+ share/*)
130+ local _f=${_file#"share/"} 130+ local _f=${_file#"share/"}
131+ _file_install_path="$CFG_DATADIR/$_f" 131+ _file_install_path="$CFG_DATADIR/$_f"
132+ ;; 132+ ;;
133+ esac 133+ esac
134+ 134+
135  135
136 # Make sure there's a directory for it 136 # Make sure there's a directory for it
137 make_dir_recursive "$(dirname "$_file_install_path")" 137 make_dir_recursive "$(dirname "$_file_install_path")"
138@@ -615,16 +598,16 @@ install_components() { 138@@ -615,16 +598,16 @@ install_components() {
139  139
140 verbose_msg "copying file $_file_install_path" 140 verbose_msg "copying file $_file_install_path"
141  141
142- maybe_backup_path "$_file_install_path" 142- maybe_backup_path "$_file_install_path"
143- 143-
144- if echo "$_file" | grep "^bin/" > /dev/null || test -x "$_src_dir/$_component/$_file" 144- if echo "$_file" | grep "^bin/" > /dev/null || test -x "$_src_dir/$_component/$_file"
145- then 145- then
146- run cp "$_src_dir/$_component/$_file" "$_file_install_path" 146- run cp "$_src_dir/$_component/$_file" "$_file_install_path"
147- run chmod 755 "$_file_install_path" 147- run chmod 755 "$_file_install_path"
148- else 148- else
149+ local mode=644 149+ local mode=644
150+ if test -x "$_src_dir/$_component/$_file"; then 150+ if test -x "$_src_dir/$_component/$_file"; then
151+ mode=755 151+ mode=755
152+ fi 152+ fi
153+ case "$_file" in 153+ case "$_file" in
154+ bin/*) mode=755 154+ bin/*) mode=755
155+ ;; 155+ ;;
156+ esac 156+ esac
157 run cp "$_src_dir/$_component/$_file" "$_file_install_path" 157 run cp "$_src_dir/$_component/$_file" "$_file_install_path"
158- run chmod 644 "$_file_install_path" 158- run chmod 644 "$_file_install_path"
159- fi 159- fi
160+ run chmod $mode "$_file_install_path" 160+ run chmod $mode "$_file_install_path"
161 critical_need_ok "file creation failed" 161 critical_need_ok "file creation failed"
162  162
163 # Update the manifest 163 # Update the manifest
164@@ -637,7 +620,6 @@ install_components() { 164@@ -637,7 +620,6 @@ install_components() {
165  165
166 verbose_msg "copying directory $_file_install_path" 166 verbose_msg "copying directory $_file_install_path"
167  167
168- maybe_backup_path "$_file_install_path" 168- maybe_backup_path "$_file_install_path"
169  169
170 run cp -R "$_src_dir/$_component/$_file" "$_file_install_path" 170 run cp -R "$_src_dir/$_component/$_file" "$_file_install_path"
171 critical_need_ok "failed to copy directory" 171 critical_need_ok "failed to copy directory"
172@@ -986,7 +968,6 @@ write_to_file "$TEMPLATE_RUST_INSTALLER_ 172@@ -986,7 +968,6 @@ write_to_file "$TEMPLATE_RUST_INSTALLER_
173 critical_need_ok "failed to write installer version" 173 critical_need_ok "failed to write installer version"
174  174
175 # Install the uninstaller 175 # Install the uninstaller
176-install_uninstaller "$src_dir" "$src_basename" "$abs_libdir" 176-install_uninstaller "$src_dir" "$src_basename" "$abs_libdir"
177  177
178 # Install each component 178 # Install each component
179 install_components "$src_dir" "$abs_libdir" "$dest_prefix" "$components" 179 install_components "$src_dir" "$abs_libdir" "$dest_prefix" "$components"

cvs diff -r1.12 -r1.13 pkgsrc/lang/rust/patches/patch-vendor_target-lexicon_src_targets.rs (switch to unified diff)

--- pkgsrc/lang/rust/patches/patch-vendor_target-lexicon_src_targets.rs 2023/10/25 05:50:43 1.12
+++ pkgsrc/lang/rust/patches/patch-vendor_target-lexicon_src_targets.rs 2024/03/03 14:53:33 1.13
@@ -1,30 +1,22 @@ @@ -1,30 +1,22 @@
1$NetBSD: patch-vendor_target-lexicon_src_targets.rs,v 1.12 2023/10/25 05:50:43 pin Exp $ 1$NetBSD: patch-vendor_target-lexicon_src_targets.rs,v 1.13 2024/03/03 14:53:33 he Exp $
2 2
3Add aarch64_eb, mipsel and riscv64gc for NetBSD. 3Add aarch64_eb and mipsel for NetBSD.
4 4
5--- vendor/target-lexicon/src/targets.rs.orig 2021-05-03 21:35:46.000000000 +0000 5--- vendor/target-lexicon/src/targets.rs.orig 2021-05-03 21:35:46.000000000 +0000
6+++ vendor/target-lexicon/src/targets.rs 6+++ vendor/target-lexicon/src/targets.rs
7@@ -1357,6 +1357,7 @@ mod tests { 7@@ -1526,6 +1526,7 @@ mod tests {
8 "aarch64-unknown-linux-gnu_ilp32", 8 "aarch64-unknown-linux-gnu_ilp32",
9 "aarch64-unknown-linux-musl", 9 "aarch64-unknown-linux-musl",
10 "aarch64-unknown-netbsd", 10 "aarch64-unknown-netbsd",
11+ "aarch64_be-unknown-netbsd", 11+ "aarch64_be-unknown-netbsd",
12 "aarch64-unknown-none", 12 "aarch64-unknown-none",
13 "aarch64-unknown-none-softfloat", 13 "aarch64-unknown-none-softfloat",
14 "aarch64-unknown-openbsd", 14 "aarch64-unknown-openbsd",
15@@ -1441,6 +1442,7 @@ mod tests { 15@@ -1611,6 +1612,7 @@ mod tests {
16 "mipsel-unknown-linux-gnu", 16 "mipsel-unknown-linux-gnu",
17 "mipsel-unknown-linux-musl", 17 "mipsel-unknown-linux-musl",
18 "mipsel-unknown-linux-uclibc", 18 "mipsel-unknown-linux-uclibc",
19+ "mipsel-unknown-netbsd", 19+ "mipsel-unknown-netbsd",
20 "mipsel-unknown-none", 20 "mipsel-unknown-none",
21 "mipsisa32r6el-unknown-linux-gnu", 21 "mipsisa32r6el-unknown-linux-gnu",
22 "mipsisa32r6-unknown-linux-gnu", 22 "mipsisa32r6-unknown-linux-gnu",
23@@ -1478,6 +1480,7 @@ mod tests { 
24 "riscv64gc-unknown-freebsd", 
25 "riscv64gc-unknown-linux-gnu", 
26 "riscv64gc-unknown-linux-musl", 
27+ "riscv64gc-unknown-netbsd", 
28 "riscv64gc-unknown-none-elf", 
29 "riscv64gc-unknown-openbsd", 
30 "riscv64imac-unknown-none-elf", 

File Deleted: pkgsrc/lang/rust/patches/patch-vendor_libc-0.2.138_src_unix_bsd_netbsdlike_netbsd_mod.rs

File Deleted: pkgsrc/lang/rust/patches/patch-vendor_libc-0.2.140_src_unix_bsd_netbsdlike_netbsd_mips.rs

File Deleted: pkgsrc/lang/rust/patches/patch-vendor_libc-0.2.140_src_unix_bsd_netbsdlike_netbsd_mod.rs

File Deleted: pkgsrc/lang/rust/patches/patch-vendor_libc-0.2.140_src_unix_bsd_netbsdlike_netbsd_riscv64.rs

File Deleted: pkgsrc/lang/rust/patches/patch-vendor_libc-0.2.140_src_unix_solarish_mod.rs

cvs diff -r1.13 -r1.14 pkgsrc/lang/rust/patches/patch-vendor_libc_src_unix_solarish_mod.rs (switch to unified diff)

--- pkgsrc/lang/rust/patches/patch-vendor_libc_src_unix_solarish_mod.rs 2023/10/25 05:50:43 1.13
+++ pkgsrc/lang/rust/patches/patch-vendor_libc_src_unix_solarish_mod.rs 2024/03/03 14:53:33 1.14
@@ -1,15 +1,15 @@ @@ -1,15 +1,15 @@
1$NetBSD: patch-vendor_libc_src_unix_solarish_mod.rs,v 1.13 2023/10/25 05:50:43 pin Exp $ 1$NetBSD: patch-vendor_libc_src_unix_solarish_mod.rs,v 1.14 2024/03/03 14:53:33 he Exp $
2 2
3Fix xattr build. 3Fix xattr build.
4 4
5--- vendor/libc/src/unix/solarish/mod.rs.orig 2019-05-20 13:47:24.000000000 +0000 5--- vendor/libc/src/unix/solarish/mod.rs.orig 2019-05-20 13:47:24.000000000 +0000
6+++ vendor/libc/src/unix/solarish/mod.rs 6+++ vendor/libc/src/unix/solarish/mod.rs
7@@ -1215,6 +1215,8 @@ pub const EOWNERDEAD: ::c_int = 58; 7@@ -1523,6 +1523,8 @@ pub const EOWNERDEAD: ::c_int = 58;
8 pub const ENOTRECOVERABLE: ::c_int = 59; 8 pub const ENOTRECOVERABLE: ::c_int = 59;
9 pub const ENOSTR: ::c_int = 60; 9 pub const ENOSTR: ::c_int = 60;
10 pub const ENODATA: ::c_int = 61; 10 pub const ENODATA: ::c_int = 61;
11+// This is not supported but is required for xattr 11+// This is not supported but is required for xattr
12+pub const ENOATTR: ::c_int = ::ENODATA; 12+pub const ENOATTR: ::c_int = ::ENODATA;
13 pub const ETIME: ::c_int = 62; 13 pub const ETIME: ::c_int = 62;
14 pub const ENOSR: ::c_int = 63; 14 pub const ENOSR: ::c_int = 63;
15 pub const ENONET: ::c_int = 64; 15 pub const ENONET: ::c_int = 64;