Skip to content

Commit

Permalink
rust: Upgrade to version 1.75.0.
Browse files Browse the repository at this point in the history
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. rust-lang/rust#117231

Upstream changes:

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

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

Compiler
--------

- [Rework negative coherence to properly consider impls that only
  partly overlap.] (rust-lang/rust#112875)
- [Bump `COINDUCTIVE_OVERLAP_IN_COHERENCE` to deny, and warn in dependencies.]
  (rust-lang/rust#116493)
- [Consider alias bounds when computing liveness in NLL.]
  (rust-lang/rust#116733)
- [Add the V (vector) extension to the `riscv64-linux-android` target spec.]
  (rust-lang/rust#116618)
- [Automatically enable cross-crate inlining for small functions]
  (rust-lang/rust#116505)
- Add several new tier 3 targets:
    - [`csky-unknown-linux-gnuabiv2hf`]
      (rust-lang/rust#117049)
    - [`i586-unknown-netbsd`]
      (rust-lang/rust#117170)
    - [`mipsel-unknown-netbsd`]
      (rust-lang/rust#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.]
  (rust-lang/rust#96979)
- [Implement `BufRead` for `VecDeque<u8>`.]
  (rust-lang/rust#110604)
- [Implement `FusedIterator` for `DecodeUtf16` when the inner iterator does.]
  (rust-lang/rust#110729)
- [Implement `Not, Bit{And,Or}{,Assign}` for IP addresses.]
  (rust-lang/rust#113747)
- [Implement `Default` for `ExitCode`.]
  (rust-lang/rust#114589)
- [Guarantee representation of None in NPO]
  (rust-lang/rust#115333)
- [Document when atomic loads are guaranteed read-only.]
  (rust-lang/rust#115577)
- [Broaden the consequences of recursive TLS initialization.]
  (rust-lang/rust#116172)
- [Windows: Support sub-millisecond sleep.]
  (rust-lang/rust#116461)
- [Fix generic bound of `str::SplitInclusive`'s `DoubleEndedIterator` impl]
  (rust-lang/rust#100806)
- [Fix exit status / wait status on non-Unix `cfg(unix)` platforms.]
  (rust-lang/rust#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.]
  (rust-lang/cargo#12779)
- [Allow version-less `Cargo.toml` manifests.]
  (rust-lang/cargo#12786)
- [Make browser links out of HTML file paths.]
  (rust-lang/cargo#12889)

Rustdoc
-------

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

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

- [FreeBSD targets now require at least version 12.]
  (rust-lang/rust#114521)
- [Formally demote tier 2 MIPS targets to tier 3.]
  (rust-lang/rust#115238)
- [Make misalignment a hard error in `const` contexts.]
  (rust-lang/rust#115524)
- [Fix detecting references to packed unsized fields.]
  (rust-lang/rust#115583)
- [Remove support for compiler plugins.]
  (rust-lang/rust#116412)
  • Loading branch information
he32 committed Mar 3, 2024
1 parent 371b99d commit 083dfbe
Show file tree
Hide file tree
Showing 31 changed files with 227 additions and 429 deletions.
99 changes: 44 additions & 55 deletions lang/rust/Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
# $NetBSD: Makefile,v 1.302 2024/01/15 15:15:01 jperkin Exp $
# $NetBSD: Makefile,v 1.303 2024/03/03 14:53:32 he Exp $

DISTNAME= rustc-1.74.1-src
DISTNAME= rustc-1.75.0-src
PKGNAME= ${DISTNAME:S/rustc/rust/:S/-src//}
CATEGORIES= lang
PKGREVISION= 1
MASTER_SITES= https://static.rust-lang.org/dist/

MAINTAINER= [email protected]
Expand All @@ -14,10 +13,9 @@ LICENSE= mit OR apache-2.0
CONFLICTS+= rust-bin-[0-9]*

# LLVM uses -std=c++17
USE_CXX_FEATURES+= c++17

USE_CXX_FEATURES+= c++17
USE_GCC_RUNTIME= yes
USE_LANGUAGES= c c++17
USE_LANGUAGES= c c++
USE_LIBTOOL= yes
USE_TOOLS+= bash grep gmake perl:build pkg-config

Expand Down Expand Up @@ -221,49 +219,49 @@ BUILDLINK_TRANSFORM+= opt:x86_64:arm64
DISTFILES:= ${DEFAULT_DISTFILES}

.if ${MACHINE_PLATFORM:MDarwin-*-aarch64} || make(distinfo) || make (makesum) || make(mdi)
RUST_STAGE0_VER= 1.73.0
RUST_STAGE0_VER= 1.74.1
RUST_ARCH:= aarch64-apple-darwin
RUST_STAGE0:= rust-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.gz
RUST_STD_STAGE0:= rust-std-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.gz
DISTFILES:= ${DISTFILES} ${RUST_STAGE0} ${RUST_STD_STAGE0}
.endif
.if ${MACHINE_PLATFORM:MDarwin-*-x86_64} || make(distinfo) || make (makesum) || make(mdi)
RUST_STAGE0_VER= 1.73.0
RUST_STAGE0_VER= 1.74.1
RUST_ARCH:= x86_64-apple-darwin
RUST_STAGE0:= rust-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.gz
RUST_STD_STAGE0:= rust-std-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.gz
DISTFILES:= ${DISTFILES} ${RUST_STAGE0} ${RUST_STD_STAGE0}
.endif
.if ${MACHINE_PLATFORM:MLinux-*-aarch64} || make(distinfo) || make (makesum) || make(mdi)
RUST_STAGE0_VER= 1.73.0
RUST_STAGE0_VER= 1.74.1
RUST_ARCH:= aarch64-unknown-linux-gnu
RUST_STAGE0:= rust-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.gz
RUST_STD_STAGE0:= rust-std-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.gz
DISTFILES:= ${DISTFILES} ${RUST_STAGE0} ${RUST_STD_STAGE0}
.endif
.if ${MACHINE_PLATFORM:MLinux-*-earmv6hf} || make(distinfo) || make (makesum) || make(mdi)
RUST_STAGE0_VER= 1.73.0
RUST_STAGE0_VER= 1.74.1
RUST_ARCH:= arm-unknown-linux-gnueabihf
RUST_STAGE0:= rust-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.gz
RUST_STD_STAGE0:= rust-std-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.gz
DISTFILES:= ${DISTFILES} ${RUST_STAGE0} ${RUST_STD_STAGE0}
.endif
.if ${MACHINE_PLATFORM:MLinux-*-earmv7hf} || make(distinfo) || make (makesum) || make(mdi)
RUST_STAGE0_VER= 1.73.0
RUST_STAGE0_VER= 1.74.1
RUST_ARCH:= armv7-unknown-linux-gnueabihf
RUST_STAGE0:= rust-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.gz
RUST_STD_STAGE0:= rust-std-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.gz
DISTFILES:= ${DISTFILES} ${RUST_STAGE0} ${RUST_STD_STAGE0}
.endif
.if ${MACHINE_PLATFORM:MLinux-*-i386} || make(distinfo) || make (makesum) || make(mdi)
RUST_STAGE0_VER= 1.73.0
RUST_STAGE0_VER= 1.74.1
RUST_ARCH:= i686-unknown-linux-gnu
RUST_STAGE0:= rust-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.gz
RUST_STD_STAGE0:= rust-std-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.gz
DISTFILES:= ${DISTFILES} ${RUST_STAGE0} ${RUST_STD_STAGE0}
.endif
.if ${MACHINE_PLATFORM:MLinux-*-x86_64} || make(distinfo) || make (makesum) || make(mdi)
RUST_STAGE0_VER= 1.73.0
RUST_STAGE0_VER= 1.74.1
RUST_ARCH:= x86_64-unknown-linux-gnu
RUST_STAGE0:= rust-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.gz
RUST_STD_STAGE0:= rust-std-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.gz
Expand All @@ -275,7 +273,7 @@ DISTFILES:= ${DISTFILES} ${RUST_STAGE0} ${RUST_STD_STAGE0}
# x86_64-sun-solaris bootstrap and comment out the overrides.
#
.if ${MACHINE_PLATFORM:MSunOS-*-x86_64} || make(distinfo) || make (makesum) || make(mdi)
RUST_STAGE0_VER= 1.73.0
RUST_STAGE0_VER= 1.74.1
RUST_ARCH:= x86_64-unknown-illumos
RUST_STAGE0:= rust-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.gz
SITES.${RUST_STAGE0}= https://us-central.manta.mnx.io/pkgsrc/public/pkg-bootstraps/
Expand All @@ -288,14 +286,14 @@ CONFIGURE_ARGS+= --host=${RUST_ARCH}
CONFIGURE_ARGS+= --target=${RUST_ARCH}
.endif
.if ${MACHINE_PLATFORM:MFreeBSD-*-x86_64} || make(distinfo) || make (makesum) || make(mdi)
RUST_STAGE0_VER= 1.73.0
RUST_STAGE0_VER= 1.74.1
RUST_ARCH:= x86_64-unknown-freebsd
RUST_STAGE0:= rust-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.gz
RUST_STD_STAGE0:= rust-std-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.gz
DISTFILES:= ${DISTFILES} ${RUST_STAGE0} ${RUST_STD_STAGE0}
.endif
.if ${MACHINE_PLATFORM:MNetBSD-*-i386} || make(distinfo) || make (makesum) || make(mdi)
RUST_STAGE0_VER= 1.73.0
RUST_STAGE0_VER= 1.74.1
RUST_ARCH= i586-unknown-netbsd
RUST_STAGE0:= rust-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.xz
RUST_STD_STAGE0:= rust-std-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.xz
Expand All @@ -315,15 +313,15 @@ pre-build-fix-paxctl:
${TOOLS_PLATFORM.paxctl} +am ${WRKDIR}/rust-bootstrap/bin/rustc
.endif
.if ${MACHINE_PLATFORM:MNetBSD-*-x86_64} || make(distinfo) || make (makesum) || make(mdi)
RUST_STAGE0_VER= 1.73.0
RUST_STAGE0_VER= 1.74.1
RUST_ARCH= x86_64-unknown-netbsd
RUST_STAGE0:= rust-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.xz
RUST_STD_STAGE0:= rust-std-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.xz
DISTFILES:= ${DISTFILES} ${RUST_STAGE0} ${RUST_STD_STAGE0}
.endif
.if ${MACHINE_PLATFORM:MNetBSD-*-powerpc} || make(distinfo) || make (makesum) || make(mdi)
RUST_STAGE0_VER= 1.73.0
RUST_ARCH= powerpc-unknown-netbsd-nb1
RUST_STAGE0_VER= 1.74.1
RUST_ARCH= powerpc-unknown-netbsd

# Cross-built against NetBSD 9.0
RUST_STAGE0:= rust-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.xz
Expand All @@ -334,7 +332,7 @@ SITES.${RUST_STD_STAGE0}= ${MASTER_SITE_LOCAL:=rust/}

.endif
.if ${MACHINE_PLATFORM:MNetBSD-*-aarch64} || make(distinfo) || make (makesum) || make(mdi)
RUST_STAGE0_VER= 1.73.0
RUST_STAGE0_VER= 1.74.1
RUST_ARCH= aarch64-unknown-netbsd
RUST_STAGE0:= rust-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.xz
RUST_STD_STAGE0:= rust-std-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.xz
Expand All @@ -343,7 +341,7 @@ SITES.${RUST_STAGE0}= ${MASTER_SITE_LOCAL:=rust/}
SITES.${RUST_STD_STAGE0}= ${MASTER_SITE_LOCAL:=rust/}
.endif
.if ${MACHINE_PLATFORM:MNetBSD-*-aarch64eb} || make(distinfo) || make (makesum) || make(mdi)
RUST_STAGE0_VER= 1.73.0
RUST_STAGE0_VER= 1.74.1
RUST_ARCH= aarch64_be-unknown-netbsd
RUST_STAGE0:= rust-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.xz
RUST_STD_STAGE0:= rust-std-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.xz
Expand All @@ -352,7 +350,7 @@ SITES.${RUST_STAGE0}= ${MASTER_SITE_LOCAL:=rust/}
SITES.${RUST_STD_STAGE0}= ${MASTER_SITE_LOCAL:=rust/}
.endif
.if ${MACHINE_PLATFORM:MNetBSD-*-sparc64} || make(distinfo) || make (makesum) || make(mdi)
RUST_STAGE0_VER= 1.73.0
RUST_STAGE0_VER= 1.74.1
RUST_ARCH= sparc64-unknown-netbsd
RUST_STAGE0:= rust-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.xz
RUST_STD_STAGE0:= rust-std-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.xz
Expand All @@ -362,7 +360,7 @@ SITES.${RUST_STD_STAGE0}= ${MASTER_SITE_LOCAL:=rust/}
.endif
.if ${MACHINE_PLATFORM:MNetBSD-*-earmv7hf} || make(distinfo) || make (makesum) || make(mdi)
RUST_ARCH= armv7-unknown-netbsd-eabihf
RUST_STAGE0_VER= 1.73.0
RUST_STAGE0_VER= 1.74.1
RUST_STAGE0:= rust-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.xz
RUST_STD_STAGE0:= rust-std-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.xz
DISTFILES:= ${DISTFILES} ${RUST_STAGE0} ${RUST_STD_STAGE0}
Expand All @@ -371,7 +369,7 @@ SITES.${RUST_STD_STAGE0}= ${MASTER_SITE_LOCAL:=rust/}
.endif
.if ${MACHINE_PLATFORM:MNetBSD-*-earmv6hf} || make(distinfo) || make (makesum) || make(mdi)
RUST_ARCH= armv6-unknown-netbsd-eabihf
RUST_STAGE0_VER= 1.73.0
RUST_STAGE0_VER= 1.74.1
RUST_STAGE0:= rust-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.xz
RUST_STD_STAGE0:= rust-std-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.xz
DISTFILES:= ${DISTFILES} ${RUST_STAGE0} ${RUST_STD_STAGE0}
Expand All @@ -380,7 +378,7 @@ SITES.${RUST_STD_STAGE0}= ${MASTER_SITE_LOCAL:=rust/}
.endif
.if ${MACHINE_PLATFORM:MNetBSD-*-mipsel} || make(distinfo) || make (makesum) || make(mdi)
RUST_ARCH= mipsel-unknown-netbsd
RUST_STAGE0_VER= 1.73.0
RUST_STAGE0_VER= 1.74.1
RUST_STAGE0:= rust-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.xz
RUST_STD_STAGE0:= rust-std-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.xz
DISTFILES:= ${DISTFILES} ${RUST_STAGE0} ${RUST_STD_STAGE0}
Expand All @@ -389,7 +387,7 @@ SITES.${RUST_STD_STAGE0}= ${MASTER_SITE_LOCAL:=rust/}
.endif
.if ${MACHINE_PLATFORM:MNetBSD-*-riscv64} || make(distinfo) || make (makesum) || make(mdi)
RUST_ARCH= riscv64gc-unknown-netbsd
RUST_STAGE0_VER= 1.73.0
RUST_STAGE0_VER= 1.74.1
RUST_STAGE0:= rust-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.xz
RUST_STD_STAGE0:= rust-std-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.xz
DISTFILES:= ${DISTFILES} ${RUST_STAGE0} ${RUST_STD_STAGE0}
Expand All @@ -413,13 +411,14 @@ TOOLS_PATH.md5sum= ${PREFIX}/bin/gmd5sum
TOOLS_PLATFORM.gzcat= ${PREFIX}/bin/gzip -cd
.endif

SUBST_CLASSES+= rpath
SUBST_STAGE.rpath= pre-configure
SUBST_FILES.rpath+= compiler/rustc_codegen_ssa/src/back/linker.rs
SUBST_FILES.rpath+= compiler/rustc_target/src/spec/netbsd_base.rs
SUBST_FILES.rpath+= src/bootstrap/builder.rs
SUBST_FILES.rpath+= src/bootstrap/compile.rs
SUBST_VARS.rpath= PREFIX
SUBST_CLASSES+= prefix
SUBST_STAGE.prefix= pre-configure
SUBST_FILES.prefix+= compiler/rustc_codegen_ssa/src/back/linker.rs
SUBST_FILES.prefix+= compiler/rustc_target/src/spec/base/netbsd.rs
SUBST_FILES.prefix+= src/bootstrap/src/core/build_steps/compile.rs
SUBST_FILES.prefix+= src/bootstrap/src/core/builder.rs
SUBST_FILES.prefix+= src/bootstrap/bootstrap.py
SUBST_VARS.prefix= PREFIX

#
# Generate list of subst entries for various .cargo-checksum.json files. These
Expand All @@ -428,37 +427,27 @@ SUBST_VARS.rpath= PREFIX
# updating and verification.
#

CKSUM_CRATES+= vendor/cc-1.0.73
CKSUMS+= 38970d678de0efb4b5e2978265daa8a613a1db35fc42e669621b03fc56d5b138
CKSUMS+= 65de0d6593a4256e5fcaf898f9468d71bab672c70a2dfab3dcb8514e9b72819c

CKSUM_CRATES+= vendor/cc
CKSUMS+= 17a4659710aa290c4ed9c23063c7b202c5bcf2a84de33aa1f01fc6fded69a1f8
CKSUMS+= a19bcb1a561d4ba5846f8f89fcfe6f05a3cb2e79baf8f21f53f0fba012db1b7f

CKSUM_CRATES+= vendor/libc

CKSUM_CRATES+= vendor/libc-0.2.146
CKSUMS+= 55ce4624745e31ad226b47fde177a46176a89da3fa5030663673a115102471f9
CKSUMS+= 09ab15cd50245f4ced230b7919657ab170e06443bb0ed4baf4449d3472f5f656
CKSUMS+= 90dd33ef20dc3be8aef5bd152a6a06e7ab34f9527b3978487b593aaa16a907bd
CKSUMS+= ec1cb2b8522ce7d35c9fce2f5b17a1a7e28cae9836f1cf11e267f222b72dff60

CKSUM_CRATES+= vendor/libc-0.2.149
CKSUMS+= 1f1beb74c33bd3ad6a5d7aae2afdacf0ccbad0f9dacda2894d2cfdc2414174ae
CKSUMS+= 80f3168251556b3eb918056aa9563db07383f61e69a262f3af390b542fd757bb
CKSUMS+= b1660c631a599a3355116e7485b88ab2f8f2929c2e37851a763431387b902f14
CKSUMS+= 990d1c6c01db31b9e5541128e4987b114f39c6808d94a5f8f048f492cfb96d78

CKSUM_CRATES+= vendor/libc-0.2.138
CKSUMS+= 107a4aa396b8383c66e0ace2f941450b4b69146558cdc4d9fbe33eeab51760f1
CKSUMS+= 4be83bef456569d59405edf134e7fe8eff78f3fe35f1efd60e15405d5c822725

CKSUM_CRATES+= vendor/libc-0.2.140
CKSUMS+= 4493317993af390d8aafc2cb7ace4c349dfc9d2451fd666844f04a4fa1f47442
CKSUMS+= 537a01c3cd5507f493616193991e1135c7896aae3fc92d98ec9facbfe243d980
CKSUMS+= 6442ed05eb390d44a03daa9800af1030f2ee3e61db98675262c227b28de51937
CKSUMS+= ec554c837999c718786debfcfe2241984193751fcd52156323b418d96319aa95
CKSUM_CRATES+= vendor/cc-1.0.73
CKSUMS+= 38970d678de0efb4b5e2978265daa8a613a1db35fc42e669621b03fc56d5b138
CKSUMS+= 65de0d6593a4256e5fcaf898f9468d71bab672c70a2dfab3dcb8514e9b72819c

CKSUM_CRATES+= vendor/libc-0.2.146
#CKSUMS+= 6442ed05eb390d44a03daa9800af1030f2ee3e61db98675262c227b28de51937
#CKSUMS+= ec554c837999c718786debfcfe2241984193751fcd52156323b418d96319aa95
#CKSUMS+= 6a60a542639528a0a34b9c9a7298973ec2cf1449c59546b7b30dcef6c51874dd
#CKSUMS+= ec1cb2b8522ce7d35c9fce2f5b17a1a7e28cae9836f1cf11e267f222b72dff60
CKSUM_CRATES+= vendor/cc
CKSUMS+= 17a4659710aa290c4ed9c23063c7b202c5bcf2a84de33aa1f01fc6fded69a1f8
CKSUMS+= a19bcb1a561d4ba5846f8f89fcfe6f05a3cb2e79baf8f21f53f0fba012db1b7f

CKSUM_CRATES+= vendor/lzma-sys
CKSUMS+= 6fd5e9245db34c6f557b8bfcaf03db82fc88c3b06dbfbb5f03b2bcd138983ef9
Expand Down
16 changes: 11 additions & 5 deletions lang/rust/options.mk
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# $NetBSD: options.mk,v 1.34 2024/01/15 12:24:21 adam Exp $
# $NetBSD: options.mk,v 1.35 2024/03/03 14:53:32 he Exp $

PKG_OPTIONS_VAR= PKG_OPTIONS.rust
PKG_SUPPORTED_OPTIONS+= rust-cargo-static rust-docs
Expand All @@ -19,10 +19,15 @@ PKG_SUGGESTED_OPTIONS+= rust-internal-llvm
PKG_SUGGESTED_OPTIONS+= rust-internal-llvm
.endif

# (NetBSD)/sparc64 systems fail to build libunwind,
# a dependency of pkgsrc llvm, so use the internal one instead
.if ${MACHINE_PLATFORM:MNetBSD-*-sparc64}
PKG_SUGGESTED_OPTIONS+= rust-internal-llvm
# NetBSD/sparc64 when using the internal LLVM needs
# to not use gcc 10.4 or 10.5 (as found in 10.0_BETA or 10.0), ref.
# https://github.com/rust-lang/rust/issues/117231
# (however, gcc from 9.x produces a working LLVM).
.if ${MACHINE_PLATFORM:MNetBSD-10.*-sparc64}
. if !empty(PKG_OPTIONS:Mrust-internal-llvm)
# Require GCC 12 (from pkgsrc) to correctly build the embedded LLVM (17.x).
GCC_REQD= 12
. endif
.endif

# Bundle OpenSSL and curl into the cargo binary when producing
Expand All @@ -39,6 +44,7 @@ PKG_OPTIONS_LEGACY_OPTS+= rust-llvm:rust-internal-llvm
# Use the internal copy of LLVM or the external one?
#
.if empty(PKG_OPTIONS:Mrust-internal-llvm)
# External LLVM must be >= 15, ref. RELEASES.md
BUILDLINK_API_DEPENDS.llvm+= llvm>=15
.include "../../lang/libunwind/buildlink3.mk"
.include "../../lang/llvm/buildlink3.mk"
Expand Down
26 changes: 12 additions & 14 deletions lang/rust/patches/patch-compiler_rustc__llvm_build.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
$NetBSD: patch-compiler_rustc__llvm_build.rs,v 1.15 2024/01/06 19:00:19 he Exp $
$NetBSD: patch-compiler_rustc__llvm_build.rs,v 1.16 2024/03/03 14:53:32 he Exp $

Fix build on NetBSD HEAD-llvm. XXX there is probably a better way to do this.

Expand All @@ -20,22 +20,20 @@ https://github.com/rust-lang/rust/pull/104572
} else if target.contains("windows-gnu") {
println!("cargo:rustc-link-lib=shell32");
println!("cargo:rustc-link-lib=uuid");
@@ -258,6 +262,14 @@ fn main() {
{
println!("cargo:rustc-link-lib=z");
} else if target.contains("netbsd") {
+ // When build llvm for i486, and then need -latomic for 64-bit atomics
+ if target.starts_with("i386")
+ || target.starts_with("i486")
+ || target.starts_with("i586")
@@ -261,7 +265,11 @@ fn main() {
// On NetBSD/i386, gcc and g++ is built for i486 (to maximize backward compat)
// However, LLVM insists on using 64-bit atomics.
// This gives rise to a need to link rust itself with -latomic for these targets
- if target.starts_with("i586") || target.starts_with("i686") {
+ if target.starts_with("i386")
+ || target.starts_with("i486")
+ || target.starts_with("i586")
+ || target.starts_with("i686")
+ {
+ println!("cargo:rustc-link-lib=atomic");
+ }
println!("cargo:rustc-link-lib=atomic");
}
println!("cargo:rustc-link-lib=z");
println!("cargo:rustc-link-lib=execinfo");
}
@@ -346,7 +358,13 @@ fn main() {
@@ -352,7 +360,13 @@ fn main() {
"c++"
} else if target.contains("netbsd") && llvm_static_stdcpp.is_some() {
// NetBSD uses a separate library when relocation is required
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,24 @@
$NetBSD: patch-compiler_rustc__target_src_spec_netbsd__base.rs,v 1.9 2023/10/25 05:50:43 pin Exp $
$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/netbsd_base.rs.orig 2022-12-12 16:02:12.000000000 +0000
+++ compiler/rustc_target/src/spec/netbsd_base.rs
@@ -1,12 +1,20 @@
--- 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),
+ &[
+ // For the benefit of powerpc, when libatomic-links is installed,
+ "-Wl,-L@PREFIX@/lib/libatomic".into(),
+ ],
+ add_linker_paths
+ );
TargetOptions {
os: "netbsd".into(),
Expand Down
Loading

0 comments on commit 083dfbe

Please sign in to comment.