Skip to content

Commit 083dfbe

Browse files
committed
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. 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)
1 parent 371b99d commit 083dfbe

File tree

31 files changed

+227
-429
lines changed

31 files changed

+227
-429
lines changed

lang/rust/Makefile

Lines changed: 44 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
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 $
22

3-
DISTNAME= rustc-1.74.1-src
3+
DISTNAME= rustc-1.75.0-src
44
PKGNAME= ${DISTNAME:S/rustc/rust/:S/-src//}
55
CATEGORIES= lang
6-
PKGREVISION= 1
76
MASTER_SITES= https://static.rust-lang.org/dist/
87

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

1615
# LLVM uses -std=c++17
17-
USE_CXX_FEATURES+= c++17
18-
16+
USE_CXX_FEATURES+= c++17
1917
USE_GCC_RUNTIME= yes
20-
USE_LANGUAGES= c c++17
18+
USE_LANGUAGES= c c++
2119
USE_LIBTOOL= yes
2220
USE_TOOLS+= bash grep gmake perl:build pkg-config
2321

@@ -221,49 +219,49 @@ BUILDLINK_TRANSFORM+= opt:x86_64:arm64
221219
DISTFILES:= ${DEFAULT_DISTFILES}
222220

223221
.if ${MACHINE_PLATFORM:MDarwin-*-aarch64} || make(distinfo) || make (makesum) || make(mdi)
224-
RUST_STAGE0_VER= 1.73.0
222+
RUST_STAGE0_VER= 1.74.1
225223
RUST_ARCH:= aarch64-apple-darwin
226224
RUST_STAGE0:= rust-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.gz
227225
RUST_STD_STAGE0:= rust-std-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.gz
228226
DISTFILES:= ${DISTFILES} ${RUST_STAGE0} ${RUST_STD_STAGE0}
229227
.endif
230228
.if ${MACHINE_PLATFORM:MDarwin-*-x86_64} || make(distinfo) || make (makesum) || make(mdi)
231-
RUST_STAGE0_VER= 1.73.0
229+
RUST_STAGE0_VER= 1.74.1
232230
RUST_ARCH:= x86_64-apple-darwin
233231
RUST_STAGE0:= rust-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.gz
234232
RUST_STD_STAGE0:= rust-std-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.gz
235233
DISTFILES:= ${DISTFILES} ${RUST_STAGE0} ${RUST_STD_STAGE0}
236234
.endif
237235
.if ${MACHINE_PLATFORM:MLinux-*-aarch64} || make(distinfo) || make (makesum) || make(mdi)
238-
RUST_STAGE0_VER= 1.73.0
236+
RUST_STAGE0_VER= 1.74.1
239237
RUST_ARCH:= aarch64-unknown-linux-gnu
240238
RUST_STAGE0:= rust-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.gz
241239
RUST_STD_STAGE0:= rust-std-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.gz
242240
DISTFILES:= ${DISTFILES} ${RUST_STAGE0} ${RUST_STD_STAGE0}
243241
.endif
244242
.if ${MACHINE_PLATFORM:MLinux-*-earmv6hf} || make(distinfo) || make (makesum) || make(mdi)
245-
RUST_STAGE0_VER= 1.73.0
243+
RUST_STAGE0_VER= 1.74.1
246244
RUST_ARCH:= arm-unknown-linux-gnueabihf
247245
RUST_STAGE0:= rust-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.gz
248246
RUST_STD_STAGE0:= rust-std-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.gz
249247
DISTFILES:= ${DISTFILES} ${RUST_STAGE0} ${RUST_STD_STAGE0}
250248
.endif
251249
.if ${MACHINE_PLATFORM:MLinux-*-earmv7hf} || make(distinfo) || make (makesum) || make(mdi)
252-
RUST_STAGE0_VER= 1.73.0
250+
RUST_STAGE0_VER= 1.74.1
253251
RUST_ARCH:= armv7-unknown-linux-gnueabihf
254252
RUST_STAGE0:= rust-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.gz
255253
RUST_STD_STAGE0:= rust-std-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.gz
256254
DISTFILES:= ${DISTFILES} ${RUST_STAGE0} ${RUST_STD_STAGE0}
257255
.endif
258256
.if ${MACHINE_PLATFORM:MLinux-*-i386} || make(distinfo) || make (makesum) || make(mdi)
259-
RUST_STAGE0_VER= 1.73.0
257+
RUST_STAGE0_VER= 1.74.1
260258
RUST_ARCH:= i686-unknown-linux-gnu
261259
RUST_STAGE0:= rust-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.gz
262260
RUST_STD_STAGE0:= rust-std-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.gz
263261
DISTFILES:= ${DISTFILES} ${RUST_STAGE0} ${RUST_STD_STAGE0}
264262
.endif
265263
.if ${MACHINE_PLATFORM:MLinux-*-x86_64} || make(distinfo) || make (makesum) || make(mdi)
266-
RUST_STAGE0_VER= 1.73.0
264+
RUST_STAGE0_VER= 1.74.1
267265
RUST_ARCH:= x86_64-unknown-linux-gnu
268266
RUST_STAGE0:= rust-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.gz
269267
RUST_STD_STAGE0:= rust-std-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.gz
@@ -275,7 +273,7 @@ DISTFILES:= ${DISTFILES} ${RUST_STAGE0} ${RUST_STD_STAGE0}
275273
# x86_64-sun-solaris bootstrap and comment out the overrides.
276274
#
277275
.if ${MACHINE_PLATFORM:MSunOS-*-x86_64} || make(distinfo) || make (makesum) || make(mdi)
278-
RUST_STAGE0_VER= 1.73.0
276+
RUST_STAGE0_VER= 1.74.1
279277
RUST_ARCH:= x86_64-unknown-illumos
280278
RUST_STAGE0:= rust-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.gz
281279
SITES.${RUST_STAGE0}= https://us-central.manta.mnx.io/pkgsrc/public/pkg-bootstraps/
@@ -288,14 +286,14 @@ CONFIGURE_ARGS+= --host=${RUST_ARCH}
288286
CONFIGURE_ARGS+= --target=${RUST_ARCH}
289287
.endif
290288
.if ${MACHINE_PLATFORM:MFreeBSD-*-x86_64} || make(distinfo) || make (makesum) || make(mdi)
291-
RUST_STAGE0_VER= 1.73.0
289+
RUST_STAGE0_VER= 1.74.1
292290
RUST_ARCH:= x86_64-unknown-freebsd
293291
RUST_STAGE0:= rust-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.gz
294292
RUST_STD_STAGE0:= rust-std-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.gz
295293
DISTFILES:= ${DISTFILES} ${RUST_STAGE0} ${RUST_STD_STAGE0}
296294
.endif
297295
.if ${MACHINE_PLATFORM:MNetBSD-*-i386} || make(distinfo) || make (makesum) || make(mdi)
298-
RUST_STAGE0_VER= 1.73.0
296+
RUST_STAGE0_VER= 1.74.1
299297
RUST_ARCH= i586-unknown-netbsd
300298
RUST_STAGE0:= rust-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.xz
301299
RUST_STD_STAGE0:= rust-std-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.xz
@@ -315,15 +313,15 @@ pre-build-fix-paxctl:
315313
${TOOLS_PLATFORM.paxctl} +am ${WRKDIR}/rust-bootstrap/bin/rustc
316314
.endif
317315
.if ${MACHINE_PLATFORM:MNetBSD-*-x86_64} || make(distinfo) || make (makesum) || make(mdi)
318-
RUST_STAGE0_VER= 1.73.0
316+
RUST_STAGE0_VER= 1.74.1
319317
RUST_ARCH= x86_64-unknown-netbsd
320318
RUST_STAGE0:= rust-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.xz
321319
RUST_STD_STAGE0:= rust-std-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.xz
322320
DISTFILES:= ${DISTFILES} ${RUST_STAGE0} ${RUST_STD_STAGE0}
323321
.endif
324322
.if ${MACHINE_PLATFORM:MNetBSD-*-powerpc} || make(distinfo) || make (makesum) || make(mdi)
325-
RUST_STAGE0_VER= 1.73.0
326-
RUST_ARCH= powerpc-unknown-netbsd-nb1
323+
RUST_STAGE0_VER= 1.74.1
324+
RUST_ARCH= powerpc-unknown-netbsd
327325

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

335333
.endif
336334
.if ${MACHINE_PLATFORM:MNetBSD-*-aarch64} || make(distinfo) || make (makesum) || make(mdi)
337-
RUST_STAGE0_VER= 1.73.0
335+
RUST_STAGE0_VER= 1.74.1
338336
RUST_ARCH= aarch64-unknown-netbsd
339337
RUST_STAGE0:= rust-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.xz
340338
RUST_STD_STAGE0:= rust-std-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.xz
@@ -343,7 +341,7 @@ SITES.${RUST_STAGE0}= ${MASTER_SITE_LOCAL:=rust/}
343341
SITES.${RUST_STD_STAGE0}= ${MASTER_SITE_LOCAL:=rust/}
344342
.endif
345343
.if ${MACHINE_PLATFORM:MNetBSD-*-aarch64eb} || make(distinfo) || make (makesum) || make(mdi)
346-
RUST_STAGE0_VER= 1.73.0
344+
RUST_STAGE0_VER= 1.74.1
347345
RUST_ARCH= aarch64_be-unknown-netbsd
348346
RUST_STAGE0:= rust-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.xz
349347
RUST_STD_STAGE0:= rust-std-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.xz
@@ -352,7 +350,7 @@ SITES.${RUST_STAGE0}= ${MASTER_SITE_LOCAL:=rust/}
352350
SITES.${RUST_STD_STAGE0}= ${MASTER_SITE_LOCAL:=rust/}
353351
.endif
354352
.if ${MACHINE_PLATFORM:MNetBSD-*-sparc64} || make(distinfo) || make (makesum) || make(mdi)
355-
RUST_STAGE0_VER= 1.73.0
353+
RUST_STAGE0_VER= 1.74.1
356354
RUST_ARCH= sparc64-unknown-netbsd
357355
RUST_STAGE0:= rust-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.xz
358356
RUST_STD_STAGE0:= rust-std-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.xz
@@ -362,7 +360,7 @@ SITES.${RUST_STD_STAGE0}= ${MASTER_SITE_LOCAL:=rust/}
362360
.endif
363361
.if ${MACHINE_PLATFORM:MNetBSD-*-earmv7hf} || make(distinfo) || make (makesum) || make(mdi)
364362
RUST_ARCH= armv7-unknown-netbsd-eabihf
365-
RUST_STAGE0_VER= 1.73.0
363+
RUST_STAGE0_VER= 1.74.1
366364
RUST_STAGE0:= rust-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.xz
367365
RUST_STD_STAGE0:= rust-std-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.xz
368366
DISTFILES:= ${DISTFILES} ${RUST_STAGE0} ${RUST_STD_STAGE0}
@@ -371,7 +369,7 @@ SITES.${RUST_STD_STAGE0}= ${MASTER_SITE_LOCAL:=rust/}
371369
.endif
372370
.if ${MACHINE_PLATFORM:MNetBSD-*-earmv6hf} || make(distinfo) || make (makesum) || make(mdi)
373371
RUST_ARCH= armv6-unknown-netbsd-eabihf
374-
RUST_STAGE0_VER= 1.73.0
372+
RUST_STAGE0_VER= 1.74.1
375373
RUST_STAGE0:= rust-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.xz
376374
RUST_STD_STAGE0:= rust-std-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.xz
377375
DISTFILES:= ${DISTFILES} ${RUST_STAGE0} ${RUST_STD_STAGE0}
@@ -380,7 +378,7 @@ SITES.${RUST_STD_STAGE0}= ${MASTER_SITE_LOCAL:=rust/}
380378
.endif
381379
.if ${MACHINE_PLATFORM:MNetBSD-*-mipsel} || make(distinfo) || make (makesum) || make(mdi)
382380
RUST_ARCH= mipsel-unknown-netbsd
383-
RUST_STAGE0_VER= 1.73.0
381+
RUST_STAGE0_VER= 1.74.1
384382
RUST_STAGE0:= rust-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.xz
385383
RUST_STD_STAGE0:= rust-std-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.xz
386384
DISTFILES:= ${DISTFILES} ${RUST_STAGE0} ${RUST_STD_STAGE0}
@@ -389,7 +387,7 @@ SITES.${RUST_STD_STAGE0}= ${MASTER_SITE_LOCAL:=rust/}
389387
.endif
390388
.if ${MACHINE_PLATFORM:MNetBSD-*-riscv64} || make(distinfo) || make (makesum) || make(mdi)
391389
RUST_ARCH= riscv64gc-unknown-netbsd
392-
RUST_STAGE0_VER= 1.73.0
390+
RUST_STAGE0_VER= 1.74.1
393391
RUST_STAGE0:= rust-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.xz
394392
RUST_STD_STAGE0:= rust-std-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.xz
395393
DISTFILES:= ${DISTFILES} ${RUST_STAGE0} ${RUST_STD_STAGE0}
@@ -413,13 +411,14 @@ TOOLS_PATH.md5sum= ${PREFIX}/bin/gmd5sum
413411
TOOLS_PLATFORM.gzcat= ${PREFIX}/bin/gzip -cd
414412
.endif
415413

416-
SUBST_CLASSES+= rpath
417-
SUBST_STAGE.rpath= pre-configure
418-
SUBST_FILES.rpath+= compiler/rustc_codegen_ssa/src/back/linker.rs
419-
SUBST_FILES.rpath+= compiler/rustc_target/src/spec/netbsd_base.rs
420-
SUBST_FILES.rpath+= src/bootstrap/builder.rs
421-
SUBST_FILES.rpath+= src/bootstrap/compile.rs
422-
SUBST_VARS.rpath= PREFIX
414+
SUBST_CLASSES+= prefix
415+
SUBST_STAGE.prefix= pre-configure
416+
SUBST_FILES.prefix+= compiler/rustc_codegen_ssa/src/back/linker.rs
417+
SUBST_FILES.prefix+= compiler/rustc_target/src/spec/base/netbsd.rs
418+
SUBST_FILES.prefix+= src/bootstrap/src/core/build_steps/compile.rs
419+
SUBST_FILES.prefix+= src/bootstrap/src/core/builder.rs
420+
SUBST_FILES.prefix+= src/bootstrap/bootstrap.py
421+
SUBST_VARS.prefix= PREFIX
423422

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

431-
CKSUM_CRATES+= vendor/cc-1.0.73
432-
CKSUMS+= 38970d678de0efb4b5e2978265daa8a613a1db35fc42e669621b03fc56d5b138
433-
CKSUMS+= 65de0d6593a4256e5fcaf898f9468d71bab672c70a2dfab3dcb8514e9b72819c
434-
435-
CKSUM_CRATES+= vendor/cc
436-
CKSUMS+= 17a4659710aa290c4ed9c23063c7b202c5bcf2a84de33aa1f01fc6fded69a1f8
437-
CKSUMS+= a19bcb1a561d4ba5846f8f89fcfe6f05a3cb2e79baf8f21f53f0fba012db1b7f
438-
439430
CKSUM_CRATES+= vendor/libc
431+
432+
CKSUM_CRATES+= vendor/libc-0.2.146
440433
CKSUMS+= 55ce4624745e31ad226b47fde177a46176a89da3fa5030663673a115102471f9
441434
CKSUMS+= 09ab15cd50245f4ced230b7919657ab170e06443bb0ed4baf4449d3472f5f656
442435
CKSUMS+= 90dd33ef20dc3be8aef5bd152a6a06e7ab34f9527b3978487b593aaa16a907bd
443436
CKSUMS+= ec1cb2b8522ce7d35c9fce2f5b17a1a7e28cae9836f1cf11e267f222b72dff60
437+
438+
CKSUM_CRATES+= vendor/libc-0.2.149
439+
CKSUMS+= 1f1beb74c33bd3ad6a5d7aae2afdacf0ccbad0f9dacda2894d2cfdc2414174ae
440+
CKSUMS+= 80f3168251556b3eb918056aa9563db07383f61e69a262f3af390b542fd757bb
444441
CKSUMS+= b1660c631a599a3355116e7485b88ab2f8f2929c2e37851a763431387b902f14
445442
CKSUMS+= 990d1c6c01db31b9e5541128e4987b114f39c6808d94a5f8f048f492cfb96d78
446443

447-
CKSUM_CRATES+= vendor/libc-0.2.138
448-
CKSUMS+= 107a4aa396b8383c66e0ace2f941450b4b69146558cdc4d9fbe33eeab51760f1
449-
CKSUMS+= 4be83bef456569d59405edf134e7fe8eff78f3fe35f1efd60e15405d5c822725
450-
451-
CKSUM_CRATES+= vendor/libc-0.2.140
452-
CKSUMS+= 4493317993af390d8aafc2cb7ace4c349dfc9d2451fd666844f04a4fa1f47442
453-
CKSUMS+= 537a01c3cd5507f493616193991e1135c7896aae3fc92d98ec9facbfe243d980
454-
CKSUMS+= 6442ed05eb390d44a03daa9800af1030f2ee3e61db98675262c227b28de51937
455-
CKSUMS+= ec554c837999c718786debfcfe2241984193751fcd52156323b418d96319aa95
444+
CKSUM_CRATES+= vendor/cc-1.0.73
445+
CKSUMS+= 38970d678de0efb4b5e2978265daa8a613a1db35fc42e669621b03fc56d5b138
446+
CKSUMS+= 65de0d6593a4256e5fcaf898f9468d71bab672c70a2dfab3dcb8514e9b72819c
456447

457-
CKSUM_CRATES+= vendor/libc-0.2.146
458-
#CKSUMS+= 6442ed05eb390d44a03daa9800af1030f2ee3e61db98675262c227b28de51937
459-
#CKSUMS+= ec554c837999c718786debfcfe2241984193751fcd52156323b418d96319aa95
460-
#CKSUMS+= 6a60a542639528a0a34b9c9a7298973ec2cf1449c59546b7b30dcef6c51874dd
461-
#CKSUMS+= ec1cb2b8522ce7d35c9fce2f5b17a1a7e28cae9836f1cf11e267f222b72dff60
448+
CKSUM_CRATES+= vendor/cc
449+
CKSUMS+= 17a4659710aa290c4ed9c23063c7b202c5bcf2a84de33aa1f01fc6fded69a1f8
450+
CKSUMS+= a19bcb1a561d4ba5846f8f89fcfe6f05a3cb2e79baf8f21f53f0fba012db1b7f
462451

463452
CKSUM_CRATES+= vendor/lzma-sys
464453
CKSUMS+= 6fd5e9245db34c6f557b8bfcaf03db82fc88c3b06dbfbb5f03b2bcd138983ef9

lang/rust/options.mk

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
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 $
22

33
PKG_OPTIONS_VAR= PKG_OPTIONS.rust
44
PKG_SUPPORTED_OPTIONS+= rust-cargo-static rust-docs
@@ -19,10 +19,15 @@ PKG_SUGGESTED_OPTIONS+= rust-internal-llvm
1919
PKG_SUGGESTED_OPTIONS+= rust-internal-llvm
2020
.endif
2121

22-
# (NetBSD)/sparc64 systems fail to build libunwind,
23-
# a dependency of pkgsrc llvm, so use the internal one instead
24-
.if ${MACHINE_PLATFORM:MNetBSD-*-sparc64}
25-
PKG_SUGGESTED_OPTIONS+= rust-internal-llvm
22+
# NetBSD/sparc64 when using the internal LLVM needs
23+
# to not use gcc 10.4 or 10.5 (as found in 10.0_BETA or 10.0), ref.
24+
# https://github.com/rust-lang/rust/issues/117231
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).
29+
GCC_REQD= 12
30+
. endif
2631
.endif
2732

2833
# Bundle OpenSSL and curl into the cargo binary when producing
@@ -39,6 +44,7 @@ PKG_OPTIONS_LEGACY_OPTS+= rust-llvm:rust-internal-llvm
3944
# Use the internal copy of LLVM or the external one?
4045
#
4146
.if empty(PKG_OPTIONS:Mrust-internal-llvm)
47+
# External LLVM must be >= 15, ref. RELEASES.md
4248
BUILDLINK_API_DEPENDS.llvm+= llvm>=15
4349
.include "../../lang/libunwind/buildlink3.mk"
4450
.include "../../lang/llvm/buildlink3.mk"

lang/rust/patches/patch-compiler_rustc__llvm_build.rs

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
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 $
22

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

@@ -20,22 +20,20 @@ https://github.com/rust-lang/rust/pull/104572
2020
} else if target.contains("windows-gnu") {
2121
println!("cargo:rustc-link-lib=shell32");
2222
println!("cargo:rustc-link-lib=uuid");
23-
@@ -258,6 +262,14 @@ fn main() {
24-
{
25-
println!("cargo:rustc-link-lib=z");
26-
} else if target.contains("netbsd") {
27-
+ // When build llvm for i486, and then need -latomic for 64-bit atomics
28-
+ if target.starts_with("i386")
29-
+ || target.starts_with("i486")
30-
+ || target.starts_with("i586")
23+
@@ -261,7 +265,11 @@ fn main() {
24+
// On NetBSD/i386, gcc and g++ is built for i486 (to maximize backward compat)
25+
// However, LLVM insists on using 64-bit atomics.
26+
// This gives rise to a need to link rust itself with -latomic for these targets
27+
- if target.starts_with("i586") || target.starts_with("i686") {
28+
+ if target.starts_with("i386")
29+
+ || target.starts_with("i486")
30+
+ || target.starts_with("i586")
3131
+ || target.starts_with("i686")
3232
+ {
33-
+ println!("cargo:rustc-link-lib=atomic");
34-
+ }
33+
println!("cargo:rustc-link-lib=atomic");
34+
}
3535
println!("cargo:rustc-link-lib=z");
36-
println!("cargo:rustc-link-lib=execinfo");
37-
}
38-
@@ -346,7 +358,13 @@ fn main() {
36+
@@ -352,7 +360,13 @@ fn main() {
3937
"c++"
4038
} else if target.contains("netbsd") && llvm_static_stdcpp.is_some() {
4139
// NetBSD uses a separate library when relocation is required

lang/rust/patches/patch-compiler_rustc__target_src_spec_netbsd__base.rs renamed to lang/rust/patches/patch-compiler_rustc__target_src_spec_base_netbsd.rs

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,24 @@
1-
$NetBSD: patch-compiler_rustc__target_src_spec_netbsd__base.rs,v 1.9 2023/10/25 05:50:43 pin Exp $
1+
$NetBSD: patch-compiler_rustc__target_src_spec_base_netbsd.rs,v 1.1 2024/03/03 14:53:32 he Exp $
22

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

6-
--- compiler/rustc_target/src/spec/netbsd_base.rs.orig 2022-12-12 16:02:12.000000000 +0000
7-
+++ compiler/rustc_target/src/spec/netbsd_base.rs
8-
@@ -1,12 +1,20 @@
6+
--- compiler/rustc_target/src/spec/base/netbsd.rs.orig 2024-01-06 19:57:14.887897867 +0000
7+
+++ compiler/rustc_target/src/spec/base/netbsd.rs
8+
@@ -1,12 +1,23 @@
99
-use crate::spec::{cvs, RelroLevel, TargetOptions};
1010
+use crate::spec::{cvs, Cc, Lld, RelroLevel, LinkerFlavor, TargetOptions};
1111

1212
pub fn opts() -> TargetOptions {
13+
+ let add_linker_paths =
14+
+ &[
15+
+ // For the benefit of powerpc, when libatomic-links is installed,
16+
+ "-Wl,-R@PREFIX@/lib/libatomic",
17+
+ "-Wl,-L@PREFIX@/lib/libatomic",
18+
+ ];
1319
+ let pre_link_args = TargetOptions::link_args(
1420
+ LinkerFlavor::Gnu(Cc::Yes, Lld::No),
15-
+ &[
16-
+ // For the benefit of powerpc, when libatomic-links is installed,
17-
+ "-Wl,-L@PREFIX@/lib/libatomic".into(),
18-
+ ],
21+
+ add_linker_paths
1922
+ );
2023
TargetOptions {
2124
os: "netbsd".into(),

0 commit comments

Comments
 (0)