From e762eaae2ed648305ef1bbafde9d2db504170f9b Mon Sep 17 00:00:00 2001 From: Havard Eidnes Date: Sat, 4 May 2024 09:05:47 +0000 Subject: [PATCH] rust178: Add a package for rust version 1.78.0. Pkgsrc changes: * Adapt checksums and patches, some have beene intregrated upstream. Upstream chnages: Version 1.78.0 (2024-05-02) =========================== Language -------- - [Stabilize `#[cfg(target_abi = ...)]`] (https://github.com/rust-lang/rust/pull/119590/) - [Stabilize the `#[diagnostic]` namespace and `#[diagnostic::on_unimplemented]` attribute] (https://github.com/rust-lang/rust/pull/119888/) - [Make async-fn-in-trait implementable with concrete signatures] (https://github.com/rust-lang/rust/pull/120103/) - [Make matching on NaN a hard error, and remove the rest of `illegal_floating_point_literal_pattern`] (https://github.com/rust-lang/rust/pull/116284/) - [static mut: allow mutable reference to arbitrary types, not just slices and arrays] (https://github.com/rust-lang/rust/pull/117614/) - [Extend `invalid_reference_casting` to include references casting to bigger memory layout] (https://github.com/rust-lang/rust/pull/118983/) - [Add `non_contiguous_range_endpoints` lint for singleton gaps after exclusive ranges] (https://github.com/rust-lang/rust/pull/118879/) - [Add `wasm_c_abi` lint for use of older wasm-bindgen versions] (https://github.com/rust-lang/rust/pull/117918/) This lint currently only works when using Cargo. - [Update `indirect_structural_match` and `pointer_structural_match` lints to match RFC] (https://github.com/rust-lang/rust/pull/120423/) - [Make non-`PartialEq`-typed consts as patterns a hard error] (https://github.com/rust-lang/rust/pull/120805/) - [Split `refining_impl_trait` lint into `_reachable`, `_internal` variants] (https://github.com/rust-lang/rust/pull/121720/) - [Remove unnecessary type inference when using associated types inside of higher ranked `where`-bounds] (https://github.com/rust-lang/rust/pull/119849) - [Weaken eager detection of cyclic types during type inference] (https://github.com/rust-lang/rust/pull/119989) - [`trait Trait: Auto {}`: allow upcasting from `dyn Trait` to `dyn Auto`] (https://github.com/rust-lang/rust/pull/119338) Compiler -------- - [Made `INVALID_DOC_ATTRIBUTES` lint deny by default] (https://github.com/rust-lang/rust/pull/111505/) - [Increase accuracy of redundant `use` checking] (https://github.com/rust-lang/rust/pull/117772/) - [Suggest moving definition if non-found macro_rules! is defined later] (https://github.com/rust-lang/rust/pull/121130/) - [Lower transmutes from int to pointer type as gep on null] (https://github.com/rust-lang/rust/pull/121282/) Target changes: - [Windows tier 1 targets now require at least Windows 10] (https://github.com/rust-lang/rust/pull/115141/) - [Enable CMPXCHG16B, SSE3, SAHF/LAHF and 128-bit Atomics in tier 1 Windows] (https://github.com/rust-lang/rust/pull/120820/) - [Add `wasm32-wasip1` tier 2 (without host tools) target] (https://github.com/rust-lang/rust/pull/120468/) - [Add `wasm32-wasip2` tier 3 target] (https://github.com/rust-lang/rust/pull/119616/) - [Rename `wasm32-wasi-preview1-threads` to `wasm32-wasip1-threads`] (https://github.com/rust-lang/rust/pull/122170/) - [Add `arm64ec-pc-windows-msvc` tier 3 target] (https://github.com/rust-lang/rust/pull/119199/) - [Add `armv8r-none-eabihf` tier 3 target for the Cortex-R52] (https://github.com/rust-lang/rust/pull/110482/) - [Add `loongarch64-unknown-linux-musl` tier 3 target] (https://github.com/rust-lang/rust/pull/121832/) Refer to Rust's [platform support page][platform-support-doc] for more information on Rust's tiered platform support. Libraries --------- - [Bump Unicode to version 15.1.0, regenerate tables] (https://github.com/rust-lang/rust/pull/120777/) - [Make align_offset, align_to well-behaved in all cases] (https://github.com/rust-lang/rust/pull/121201/) - [PartialEq, PartialOrd: document expectations for transitive chains] (https://github.com/rust-lang/rust/pull/115386/) - [Optimize away poison guards when std is built with panic=abort] (https://github.com/rust-lang/rust/pull/100603/) - [Replace pthread `RwLock` with custom implementation] (https://github.com/rust-lang/rust/pull/110211/) - [Implement unwind safety for Condvar on all platforms] (https://github.com/rust-lang/rust/pull/121768/) - [Add ASCII fast-path for `char::is_grapheme_extended`] (https://github.com/rust-lang/rust/pull/121138/) Stabilized APIs --------------- - [`impl Read for &Stdin`] (https://doc.rust-lang.org/stable/std/io/struct.Stdin.html#impl-Read-for-%26Stdin) - [Accept non `'static` lifetimes for several `std::error::Error` related implementations] (https://github.com/rust-lang/rust/pull/113833/) - [Make `impl` impl take `?Sized`] (https://github.com/rust-lang/rust/pull/114655/) - [`impl From for io::Error`] (https://doc.rust-lang.org/stable/std/io/struct.Error.html#impl-From%3CTryReserveError%3E-for-Error) These APIs are now stable in const contexts: - [`Barrier::new()`] (https://doc.rust-lang.org/stable/std/sync/struct.Barrier.html#method.new) Cargo ----- - [Stabilize lockfile v4](https://github.com/rust-lang/cargo/pull/12852/) - [Respect `rust-version` when generating lockfile] (https://github.com/rust-lang/cargo/pull/12861/) - [Control `--charset` via auto-detecting config value] (https://github.com/rust-lang/cargo/pull/13337/) - [Support `target..rustdocflags` officially] (https://github.com/rust-lang/cargo/pull/13197/) - [Stabilize global cache data tracking] (https://github.com/rust-lang/cargo/pull/13492/) Misc ---- - [rustdoc: add `--test-builder-wrapper` arg to support wrappers such as RUSTC_WRAPPER when building doctests] (https://github.com/rust-lang/rust/pull/114651/) Compatibility Notes ------------------- - [Many unsafe precondition checks now run for user code with debug assertions enabled] (https://github.com/rust-lang/rust/pull/120594/) This change helps users catch undefined behavior in their code, though the details of how much is checked are generally not stable. - [riscv only supports split_debuginfo=off for now] (https://github.com/rust-lang/rust/pull/120518/) - [Consistently check bounds on hidden types of `impl Trait`] (https://github.com/rust-lang/rust/pull/121679) - [Change equality of higher ranked types to not rely on subtyping] (https://github.com/rust-lang/rust/pull/118247) - [When called, additionally check bounds on normalized function return type] (https://github.com/rust-lang/rust/pull/118882) - [Expand coverage for `arithmetic_overflow` lint] (https://github.com/rust-lang/rust/pull/119432/) Internal Changes ---------------- These changes do not affect any public interfaces of Rust, but they represent significant improvements to the performance or internals of rustc and related tools. - [Update to LLVM 18](https://github.com/rust-lang/rust/pull/120055/) - [Build `rustc` with 1CGU on `x86_64-pc-windows-msvc`] (https://github.com/rust-lang/rust/pull/112267/) - [Build `rustc` with 1CGU on `x86_64-apple-darwin`] (https://github.com/rust-lang/rust/pull/112268/) - [Introduce `run-make` V2 infrastructure, a `run_make_support` library and port over 2 tests as example] (https://github.com/rust-lang/rust/pull/113026/) - [Windows: Implement condvar, mutex and rwlock using futex] (https://github.com/rust-lang/rust/pull/121956/) --- rust178/DESCR | 13 + rust178/HOWTO-BOOTSTRAP | 85 +++ rust178/Makefile | 710 ++++++++++++++++++ rust178/buildlink3.mk | 17 + rust178/cargo.mk | 109 +++ rust178/cross.mk | 82 ++ rust178/distinfo | 155 ++++ rust178/do-cross.mk | 107 +++ rust178/files/gcc-wrap | 199 +++++ rust178/options.mk | 76 ++ ...ler_rustc__codegen__ssa_src_back_linker.rs | 15 + .../patch-compiler_rustc__llvm_build.rs | 50 ++ ...iler_rustc__target_src_spec_base_netbsd.rs | 32 + ...tch-compiler_rustc__target_src_spec_mod.rs | 14 + ..._spec_targets_mips64el__unknown__netbsd.rs | 35 + ...h-library_backtrace_src_symbolize_gimli.rs | 14 + ...brary_backtrace_src_symbolize_gimli_elf.rs | 25 + .../patch-library_std_src_sys_pal_unix_mod.rs | 14 + ...tch-library_std_src_sys_pal_unix_thread.rs | 26 + ...src_sys_pal_unix_thread__parking_netbsd.rs | 34 + .../patches/patch-src_bootstrap_bootstrap.py | 47 ++ ...bootstrap_src_core_build__steps_compile.rs | 15 + .../patch-src_bootstrap_src_core_builder.rs | 15 + .../patches/patch-src_bootstrap_src_lib.rs | 23 + ...patch-src_llvm-project_llvm_CMakeLists.txt | 18 + ...m-project_llvm_cmake_modules_AddLLVM.cmake | 49 ++ ...vm-project_llvm_include_llvm-c_DataTypes.h | 34 + ...vm_include_llvm_Analysis_ConstantFolding.h | 17 + ...project_llvm_utils_FileCheck_FileCheck.cpp | 15 + ...src_tools_cargo_src_cargo_core_profiles.rs | 17 + ...h-src_tools_cargo_tests_testsuite_build.rs | 31 + ...c_tools_rust-installer_install-template.sh | 179 +++++ ...r_aho-corasick_src_packed_teddy_builder.rs | 31 + ...h-vendor_aho-corasick_src_packed_vector.rs | 13 + ...ch-vendor_backtrace_src_symbolize_gimli.rs | 14 + ...endor_backtrace_src_symbolize_gimli_elf.rs | 24 + .../patches/patch-vendor_cc-1.0.73_src_lib.rs | 16 + rust178/patches/patch-vendor_cc_src_lib.rs | 22 + ...endor_crossbeam-utils-0.8.17_no__atomic.rs | 14 + ...endor_crossbeam-utils-0.8.18_no__atomic.rs | 14 + ...patch-vendor_crossbeam-utils_no__atomic.rs | 14 + ...148_src_unix_bsd_netbsdlike_netbsd_mips.rs | 29 + ..._src_unix_bsd_netbsdlike_netbsd_riscv64.rs | 29 + ...ndor_libc-0.2.151_src_unix_solarish_mod.rs | 15 + ...patch-vendor_libc_src_unix_solarish_mod.rs | 15 + .../patches/patch-vendor_lzma-sys_config.h | 18 + ...sl-src_openssl_Configurations_10-main.conf | 18 + .../patch-vendor_openssl-src_src_lib.rs | 64 ++ ...h-vendor_openssl-sys_build_find__normal.rs | 30 + .../patch-vendor_openssl-sys_build_main.rs | 23 + ...patch-vendor_portable-atomic_no__atomic.rs | 14 + ...t_src_spec_aarch64__be__unknown__netbsd.rs | 27 + .../patches/patch-vendor_stacker_src_lib.rs | 15 + ...patch-vendor_target-lexicon_src_targets.rs | 22 + .../patch-vendor_valuable_no__atomic.rs | 14 + rust178/platform.mk | 26 + rust178/rust.mk | 55 ++ 57 files changed, 2848 insertions(+) create mode 100644 rust178/DESCR create mode 100644 rust178/HOWTO-BOOTSTRAP create mode 100644 rust178/Makefile create mode 100644 rust178/buildlink3.mk create mode 100644 rust178/cargo.mk create mode 100644 rust178/cross.mk create mode 100644 rust178/distinfo create mode 100644 rust178/do-cross.mk create mode 100644 rust178/files/gcc-wrap create mode 100644 rust178/options.mk create mode 100644 rust178/patches/patch-compiler_rustc__codegen__ssa_src_back_linker.rs create mode 100644 rust178/patches/patch-compiler_rustc__llvm_build.rs create mode 100644 rust178/patches/patch-compiler_rustc__target_src_spec_base_netbsd.rs create mode 100644 rust178/patches/patch-compiler_rustc__target_src_spec_mod.rs create mode 100644 rust178/patches/patch-compiler_rustc__target_src_spec_targets_mips64el__unknown__netbsd.rs create mode 100644 rust178/patches/patch-library_backtrace_src_symbolize_gimli.rs create mode 100644 rust178/patches/patch-library_backtrace_src_symbolize_gimli_elf.rs create mode 100644 rust178/patches/patch-library_std_src_sys_pal_unix_mod.rs create mode 100644 rust178/patches/patch-library_std_src_sys_pal_unix_thread.rs create mode 100644 rust178/patches/patch-library_std_src_sys_pal_unix_thread__parking_netbsd.rs create mode 100644 rust178/patches/patch-src_bootstrap_bootstrap.py create mode 100644 rust178/patches/patch-src_bootstrap_src_core_build__steps_compile.rs create mode 100644 rust178/patches/patch-src_bootstrap_src_core_builder.rs create mode 100644 rust178/patches/patch-src_bootstrap_src_lib.rs create mode 100644 rust178/patches/patch-src_llvm-project_llvm_CMakeLists.txt create mode 100644 rust178/patches/patch-src_llvm-project_llvm_cmake_modules_AddLLVM.cmake create mode 100644 rust178/patches/patch-src_llvm-project_llvm_include_llvm-c_DataTypes.h create mode 100644 rust178/patches/patch-src_llvm-project_llvm_include_llvm_Analysis_ConstantFolding.h create mode 100644 rust178/patches/patch-src_llvm-project_llvm_utils_FileCheck_FileCheck.cpp create mode 100644 rust178/patches/patch-src_tools_cargo_src_cargo_core_profiles.rs create mode 100644 rust178/patches/patch-src_tools_cargo_tests_testsuite_build.rs create mode 100644 rust178/patches/patch-src_tools_rust-installer_install-template.sh create mode 100644 rust178/patches/patch-vendor_aho-corasick_src_packed_teddy_builder.rs create mode 100644 rust178/patches/patch-vendor_aho-corasick_src_packed_vector.rs create mode 100644 rust178/patches/patch-vendor_backtrace_src_symbolize_gimli.rs create mode 100644 rust178/patches/patch-vendor_backtrace_src_symbolize_gimli_elf.rs create mode 100644 rust178/patches/patch-vendor_cc-1.0.73_src_lib.rs create mode 100644 rust178/patches/patch-vendor_cc_src_lib.rs create mode 100644 rust178/patches/patch-vendor_crossbeam-utils-0.8.17_no__atomic.rs create mode 100644 rust178/patches/patch-vendor_crossbeam-utils-0.8.18_no__atomic.rs create mode 100644 rust178/patches/patch-vendor_crossbeam-utils_no__atomic.rs create mode 100644 rust178/patches/patch-vendor_libc-0.2.148_src_unix_bsd_netbsdlike_netbsd_mips.rs create mode 100644 rust178/patches/patch-vendor_libc-0.2.148_src_unix_bsd_netbsdlike_netbsd_riscv64.rs create mode 100644 rust178/patches/patch-vendor_libc-0.2.151_src_unix_solarish_mod.rs create mode 100644 rust178/patches/patch-vendor_libc_src_unix_solarish_mod.rs create mode 100644 rust178/patches/patch-vendor_lzma-sys_config.h create mode 100644 rust178/patches/patch-vendor_openssl-src_openssl_Configurations_10-main.conf create mode 100644 rust178/patches/patch-vendor_openssl-src_src_lib.rs create mode 100644 rust178/patches/patch-vendor_openssl-sys_build_find__normal.rs create mode 100644 rust178/patches/patch-vendor_openssl-sys_build_main.rs create mode 100644 rust178/patches/patch-vendor_portable-atomic_no__atomic.rs create mode 100644 rust178/patches/patch-vendor_rustc-ap-rustc__target_src_spec_aarch64__be__unknown__netbsd.rs create mode 100644 rust178/patches/patch-vendor_stacker_src_lib.rs create mode 100644 rust178/patches/patch-vendor_target-lexicon_src_targets.rs create mode 100644 rust178/patches/patch-vendor_valuable_no__atomic.rs create mode 100644 rust178/platform.mk create mode 100644 rust178/rust.mk diff --git a/rust178/DESCR b/rust178/DESCR new file mode 100644 index 00000000000..6dc90a671e6 --- /dev/null +++ b/rust178/DESCR @@ -0,0 +1,13 @@ +Rust is a systems programming language focused on three goals: safety, +speed, and concurrency. It maintains these goals without having a +garbage collector, making it a useful language for a number of use cases +other languages aren't good at: embedding in other languages, programs +with specific space and time requirements, and writing low-level code, +like device drivers and operating systems. + +It improves on current languages targeting this space by having a number +of compile-time safety checks that produce no runtime overhead, while +eliminating all data races. Rust also aims to achieve "zero-cost +abstractions" even though some of these abstractions feel like those of +a high-level language. Even then, Rust still allows precise control +like a low-level language would. diff --git a/rust178/HOWTO-BOOTSTRAP b/rust178/HOWTO-BOOTSTRAP new file mode 100644 index 00000000000..81133db2ec0 --- /dev/null +++ b/rust178/HOWTO-BOOTSTRAP @@ -0,0 +1,85 @@ +How to build a rust bootstrap kit using pkgsrc +---------------------------------------------- + +A rust bootstrap kit is simply a pre-compiled binary of rust and +the rust standard library, and contains the "rust" and "rust-std" +build results, found in + + work/rustc-/build/dist/ +as + rust--.tar.xz +and + rust-std--.tar.xz + +These result files are produced when the "dist" build target is +used, ref. BUILD_TARGET. For a normal native build of the rust +pkgsrc package, the default BUILD_TARGET is "build", not "dist". + +There are two possible ways to produce a bootstrap kit: + +1) a native build. This requires minimum preparation, except + possibly for setting rust.BUILD_TARGET to "dist" via e.g. + /etc/mk.conf. Note that on NetBSD, using the "BUILD_TARGET" == + "dist" results in the "rust-cargo-static" option being set, ref. + options.mk. This is so that the resulting bootstrap kits are + built with mostly-static linking, reducing the run-time dependencies + of the bootstrap kits. + +2) a cross-build. This requires a bit of preparation: + + For each target you want to cross-build rust for, you need + - the cross toolchain resulting from "build.sh tools" for + the intended target + - an OS distribution extracted, including the comp.tgz + set so that the target's include files can be used + - for 32-bit ports, the "libatomic" package needs to be + available. I'm sure there's a clever and long-winded + use of pkg_install which can be used to effect this; + I on my hand have always just extracted the tgz file + and done the minimal cleanup of the "cruft" files + which are part of the package meta-data. + - Pick a root directory for the target, e.g. /u/i386. + Below this directory place the "tools" containing + the cross-compiler in a "tools" sub-directory. + Similarly, the extracted OS distribution in the "dest" + sub-directory. + + There are two methods available for doing the cross-compile: + + a) Using the "cross.mk" file. For an i386 build against i586, the + following settings should be active: + +CROSS_ROOT= /u/i386 +MAKE_ENV+= CROSS_ROOT=${CROSS_ROOT} +GNU_CROSS_TARGET= i486--netbsdelf +MAKE_ENV+= GNU_CROSS_TARGET=${GNU_CROSS_TARGET} +TARGET= i586-unknown-netbsd +SCRIPTS= ${WRKDIR}/scripts +CONFIGURE_ARGS+= --host=${TARGET} +CONFIGURE_ARGS+= --target=${TARGET} +CONFIGURE_ARGS+= --set=target.${TARGET}.cc=${SCRIPTS}/gcc-wrap +CONFIGURE_ARGS+= --set=target.${TARGET}.cxx=${SCRIPTS}/c++-wrap +CONFIGURE_ARGS+= --set=target.${TARGET}.linker=${SCRIPTS}/gcc-wrap +CONFIGURE_ARGS+= --set=target.${TARGET}.ar=${CROSS_ROOT}/tools/bin/${GNU_CROSS_TARGET}-ar + + Then doing a "make" will cross-build rust, including the LLVM + embedded in the rust distribution, ref. the defaulting of that + option when TARGET is defined ref. options.mk. + + Note that when TARGET is set, the default build target for + the rust makefile becomes "dist", so there's no need to set + rust.BUILD_TARGET for cross-builds. + + b) Using the "do-cross.mk" Makefile. This will attempt to + cross-build rust for all the targets listed in the SHORT_TARGETS + variable in that file. Overriding the root directories for + the various targets can be done by making your own "local-roots.mk" + file, ref. "do-cross.mk". + + This will create a "dist" subdirectory in the rust pkgsrc + directory, and the bootstrap kits for each architecture, plus + the library source kit will be placed in this directory. + +The bootstrap kits can then be placed in /usr/pkgsrc/distfiles, and +be used by the "next" rust version, where you can use "make makesum" +to compute the updated checksums for the bootstrap kits. diff --git a/rust178/Makefile b/rust178/Makefile new file mode 100644 index 00000000000..7687767d3df --- /dev/null +++ b/rust178/Makefile @@ -0,0 +1,710 @@ +# $NetBSD: Makefile,v 1.284 2023/06/19 14:46:47 bsiegert Exp $ + +DISTNAME= rustc-1.78.0-src +PKGNAME= ${DISTNAME:S/rustc/rust/:S/-src//} +CATEGORIES= lang +MASTER_SITES= https://static.rust-lang.org/dist/ + +MAINTAINER= pkgsrc-users@NetBSD.org +HOMEPAGE= https://www.rust-lang.org/ +COMMENT= Safe, concurrent, practical language +LICENSE= mit OR apache-2.0 + +CONFLICTS+= rust-bin-[0-9]* + +# LLVM uses -std=c++17 +USE_CXX_FEATURES+= c++17 +USE_GCC_RUNTIME= yes +USE_LANGUAGES= c c++ +USE_LIBTOOL= yes +USE_TOOLS+= bash grep gmake perl:build pkg-config + +# The NetBSD bootstraps are built for NetBSD 8 (because rust doesn't +# build on 7). Mark earlier versions as broken. +BROKEN_ON_PLATFORM+= NetBSD-[1-7].*-* +# Bootstrap is built for NetBSD 9.x on these platforms: +BROKEN_ON_PLATFORM+= NetBSD-8.*-*arm* +BROKEN_ON_PLATFORM+= NetBSD-8.*-aarch64 +BROKEN_ON_PLATFORM+= NetBSD-8.*-sparc64 +BROKEN_ON_PLATFORM+= NetBSD-8.*-powerpc +BROKEN_ON_PLATFORM+= NetBSD-8.*-i386 + +HAS_CONFIGURE= yes +PYTHON_FOR_BUILD_ONLY= yes +CONFIG_SHELL= ${PYTHONBIN} +CONFIGURE_SCRIPT= src/bootstrap/configure.py +CONFIGURE_ARGS+= --prefix=${PREFIX} +CONFIGURE_ARGS+= --mandir=${PREFIX}/${PKGMANDIR} +CONFIGURE_ARGS+= --sysconfdir=${PKG_SYSCONFDIR} +CONFIGURE_ARGS+= --python=${PYTHONBIN} +CONFIGURE_ARGS+= --release-channel=stable +CONFIGURE_ARGS+= --local-rust-root=${RUST_BOOTSTRAP_PATH} +CONFIGURE_ARGS+= --enable-extended # Build and install cargo too. +CONFIGURE_ARGS+= --enable-rpath +CONFIGURE_ARGS+= --disable-codegen-tests +CONFIGURE_ARGS+= --disable-compiler-docs +CONFIGURE_ARGS+= --disable-llvm-static-stdcpp +CONFIGURE_ARGS+= --disable-ninja +CONFIGURE_ARGS+= --dist-compression-formats=xz + +# Include (optional) settings to cross-build rust +.include "cross.mk" + +# optional from do-cross.mk +CONFIGURE_ARGS+= ${ADD_CONFIGURE_ARGS} + +# Getting RPATH with $ORIGIN into bootstrap may be troublesome, so +# uncommenting the LD_LIBRARY_PATH setting may be required to run +# the bootstrap +PKGSRC_MAKE_ENV+= LD_LIBRARY_PATH=${RUST_BOOTSTRAP_PATH:Q}/lib + +# This should allow us to perform "offline" builds (so cargo doesn't fetch +# dependencies during the build stage) but this isn't hooked up yet. +CONFIGURE_ARGS+= --enable-vendor + +# cargo defaults to using the number of available CPUs +MAKE_ENV+= CARGO_BUILD_JOBS=${_MAKE_JOBS_N} + +# Rust builds some bundled components with strict version requirements, ensure +# that any conflicting packages pulled in via dependencies are not buildlinked. +BUILDLINK_FILES_CMD.libssh2= ${TRUE} +BUILDLINK_FILES_CMD.xz= ${TRUE} +MAKE_ENV+= LZMA_API_STATIC=1 + +# MacOS X 10.7 is the oldest supported version. See +# ${WRKSRC}/src/bootstrap/lib.rs +MAKE_ENV.Darwin+= MACOSX_DEPLOYMENT_TARGET="10.7" + +CFLAGS.SunOS+= -D_POSIX_PTHREAD_SEMANTICS +MAKE_ENV.SunOS+= AR=gar + +# Debugging of crate resolution +# Annoyingly, this makes the powerpc build succeed... +#MAKE_ENV+= RUSTC_LOG=rustc_metadata + +UNLIMIT_RESOURCES+= cputime stacksize datasize virtualsize + +TEST_TARGET= check + +# bin/* lib/*, but names vary +CHECK_RELRO_SUPPORTED= no +CHECK_SSP_SUPPORTED= no + +.include "../../mk/bsd.prefs.mk" + +# Allow overriding MAKE_JOBS_SAFE +# some may chose to mostly build faster, +# and deal with any failures due to deadlocks +.if !empty(rust.MAKE_JOBS_SAFE) +. if ${rust.MAKE_JOBS_SAFE:tl} == "yes" +MAKE_JOBS_SAFE= yes +. endif +.endif + +.if !empty(rust.BUILD_TARGET) +BUILD_TARGET= ${rust.BUILD_TARGET} +.endif + +.if !empty(TARGET) +# Use "dist" build target for cross compile of bootstrap +BUILD_TARGET?= dist +.else +BUILD_TARGET?= build +.endif + +.if ${MACHINE_PLATFORM:MNetBSD-*-powerpc} || \ + ${MACHINE_PLATFORM:MNetBSD-*-earmv[67]hf} || \ + ${MACHINE_PLATFORM:MNetBSD-*-mipsel} || \ + !empty(TARGET:Marmv[67]-unknown-netbsd-eabihf) || \ + !empty(TARGET:Mmipsel-unknown-netbsd) +# Bootstrapping on NetBSD/powerpc requires no debug-info from rustc +# (both for amd64->powerpc built and powerpc->powerpc built bootstrap bits) +# Also try to downsize the armv[67] build. +CONFIGURE_ARGS+= --disable-debug +CONFIGURE_ARGS+= --disable-debug-assertions +CONFIGURE_ARGS+= --disable-llvm-release-debuginfo +CONFIGURE_ARGS+= --debuginfo-level=0 +CONFIGURE_ARGS+= --debuginfo-level-rustc=0 +CONFIGURE_ARGS+= --debuginfo-level-std=0 +CONFIGURE_ARGS+= --debuginfo-level-tools=0 +CONFIGURE_ARGS+= --debuginfo-level-tests=0 +.endif + +# Only build the ARM target on/for this host, due to resource constraints +.if ${MACHINE_PLATFORM:MNetBSD-*-earmv[67]hf} +CONFIGURE_ARGS+= --set llvm.targets="ARM" +.endif +# When cross-building for ARM on X86, X86 needs to go along due +# to 2-stage build process +.if !empty(TARGET:Marmv[67]-unknown-netbsd-eabihf) +CONFIGURE_ARGS+= --set llvm.targets="ARM;X86" +.endif +# Same for mips: +.if ${MACHINE_PLATFORM:MNetBSD-*-mipsel} +CONFIGURE_ARGS+= --set llvm.targets="Mips" +.endif +.if !empty(TARGET:Mmipsel-unknown-netbsd) +CONFIGURE_ARGS+= --set llvm.targets="Mips;X86" +.endif + +CHECK_INTERPRETER_SKIP+= lib/rustlib/src/rust/library/backtrace/ci/android-sdk.sh +CHECK_INTERPRETER_SKIP+= lib/rustlib/src/rust/library/backtrace/ci/debuglink.sh +CHECK_INTERPRETER_SKIP+= lib/rustlib/src/rust/library/backtrace/ci/run.sh +CHECK_INTERPRETER_SKIP+= lib/rustlib/src/rust/library/backtrace/ci/run-docker.sh +CHECK_INTERPRETER_SKIP+= lib/rustlib/src/rust/library/core/src/unicode/printable.py +CHECK_INTERPRETER_SKIP+= lib/rustlib/src/rust/library/stdarch/ci/build-std-detect.sh +CHECK_INTERPRETER_SKIP+= lib/rustlib/src/rust/library/stdarch/ci/dox.sh +CHECK_INTERPRETER_SKIP+= lib/rustlib/src/rust/library/stdarch/ci/run-docker.sh +CHECK_INTERPRETER_SKIP+= lib/rustlib/src/rust/library/stdarch/ci/run.sh +CHECK_INTERPRETER_SKIP+= lib/rustlib/src/rust/library/stdarch/ci/style.sh + +CHECK_PORTABILITY_SKIP+= tests/run-make/dump-ice-to-disk/check.sh + +.if ${OPSYS} == "NetBSD" +# This block contains information about known trouble on NetBSD and workarounds. + +# Parallel builds failed on NetBSD due to dynamic linker locking bugs. +# \todo Explain if the build is believed to be sound if not parallel, +# or if a non-parallel build is merely more likely to work. +# +# See toolchain/54192 at +# http://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=54192 +# which was fixed in -current on 2020-04-19: +# http://mail-index.netbsd.org/source-changes/2020/04/16/msg116256.html +# http://mail-index.netbsd.org/source-changes/2020/04/19/msg116337.html +# These were pulled up to netbsd-9 on 2020-05-13: +# http://releng.netbsd.org/cgi-bin/req-9.cgi?show=907 +# This has not been pulled up to netbsd-8 +# \todo Explain if it's not applicable, shouldn't be pulled up, should be +# but hasn't, is too hard, etc. +# +# On pkgbuild for 2020Q1 9.0_RELEASE amd64, rust did not build despite +# MAKE_JOBS_SAFE=no, but setting MAKE_JOBS=1 resulted in success. (No +# PR is open for this.) \todo Understand and fix. +# +# If we aren't on 9-current, and are on 8.x or 9.x, avoid parallel. +# Release 9.x and 9.1 or later is OK. +. if ${OPSYS} == "NetBSD" && ${OPSYS_VERSION} > 090999 && ${OPSYS_VERSION} < 090900 +MAKE_JOBS_SAFE?= no +. endif + +# Open PRs +# +# Broken package with PREFIX not /usr/pkg: +# http://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=54453 +# + +.endif + +# +# Under NetBSD, do not use DT_RUNPATH +# +BUILDLINK_TRANSFORM.NetBSD+= rm:-Wl,--enable-new-dtags + +# +# Somewhere in the LLVM build "-arch x86_64" is passed on macOS/arm64 which +# breaks linking, see https://github.com/rust-lang/rust/issues/81790. Until +# this can be located (proving difficult!) we just force it. +# +.if ${MACHINE_PLATFORM:MDarwin-*-aarch64} +BUILDLINK_TRANSFORM+= opt:x86_64:arm64 +.endif + +# +# Rust unfortunately requires itself to build. On platforms which aren't +# supported by upstream (where they offer binary bootstraps), or where we do +# not trust random binaries from the Internet, we need to build and provide our +# own bootstrap. See the stage0-bootstrap below for more details. +# +DISTFILES:= ${DEFAULT_DISTFILES} + +.if ${MACHINE_PLATFORM:MDarwin-*-aarch64} || make(distinfo) || make (makesum) || make(mdi) +RUST_STAGE0_VER= 1.77.2 +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.77.2 +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.77.2 +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.77.2 +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.77.2 +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.77.2 +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.77.2 +RUST_ARCH:= x86_64-unknown-linux-gnu +RUST_STAGE0:= rust-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.gz +RUST_STD_STAGE0:= rust-std-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.gz +DISTFILES:= ${DISTFILES} ${RUST_STAGE0} ${RUST_STD_STAGE0} +.endif +# +# The SunOS target defaults to illumos as that's what the current bootstraps +# are built on. If you wish to target Oracle Solaris you'll need to create an +# 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.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/ +DISTFILES:= ${DISTFILES} ${RUST_STAGE0} +RUST_BOOTSTRAP_PATH?= ${WRKDIR}/rust-${RUST_STAGE0_VER}-${RUST_ARCH} +# Override default "x86_64-sun-solaris" selection +CONFIGURE_ARGS+= --set=target.${RUST_ARCH}.llvm-config=${LLVM_CONFIG_PATH} +CONFIGURE_ARGS+= --build=${RUST_ARCH} +CONFIGURE_ARGS+= --host=${RUST_ARCH} +CONFIGURE_ARGS+= --target=${RUST_ARCH} +.endif +.if ${MACHINE_PLATFORM:MFreeBSD-*-x86_64} || make(distinfo) || make (makesum) || make(mdi) +RUST_STAGE0_VER= 1.77.2 +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.77.1 +RUST_ARCH= i586-unknown-netbsd +RUST_STAGE0:= rust-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.xz +RUST_STD_STAGE0:= rust-std-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.xz +SITES.${RUST_STAGE0}= ${MASTER_SITE_LOCAL:=rust/} +SITES.${RUST_STD_STAGE0}= ${MASTER_SITE_LOCAL:=rust/} +DISTFILES:= ${DISTFILES} ${RUST_STAGE0} ${RUST_STD_STAGE0} +# Setting this changes it for every distfile, which doesn't match what is +# currently in distinfo. +#DIST_SUBDIR= ${PKGNAME} +# For atomic ops +CFLAGS+= -march=i586 +CONFIGURE_ARGS+= --build=${RUST_ARCH} +pre-build: pre-build-fix-paxctl +.PHONY: pre-build-fix-paxctl +pre-build-fix-paxctl: + ${TOOLS_PLATFORM.paxctl} +am ${WRKDIR}/rust-bootstrap/bin/cargo + ${TOOLS_PLATFORM.paxctl} +am ${WRKDIR}/rust-bootstrap/bin/rustc +.endif +.if ${MACHINE_PLATFORM:MNetBSD-*-x86_64} || make(distinfo) || make (makesum) || make(mdi) +RUST_STAGE0_VER= 1.77.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.77.1 +RUST_ARCH= powerpc-unknown-netbsd + +# Cross-built against NetBSD 9.0 +RUST_STAGE0:= rust-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.xz +RUST_STD_STAGE0:= rust-std-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.xz +DISTFILES:= ${DISTFILES} ${RUST_STAGE0} ${RUST_STD_STAGE0} +SITES.${RUST_STAGE0}= ${MASTER_SITE_LOCAL:=rust/} +SITES.${RUST_STD_STAGE0}= ${MASTER_SITE_LOCAL:=rust/} + +.endif +.if ${MACHINE_PLATFORM:MNetBSD-*-aarch64} || make(distinfo) || make (makesum) || make(mdi) +RUST_STAGE0_VER= 1.77.1 +RUST_ARCH= aarch64-unknown-netbsd +RUST_STAGE0:= rust-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.xz +RUST_STD_STAGE0:= rust-std-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.xz +DISTFILES:= ${DISTFILES} ${RUST_STAGE0} ${RUST_STD_STAGE0} +SITES.${RUST_STAGE0}= ${MASTER_SITE_LOCAL:=rust/} +SITES.${RUST_STD_STAGE0}= ${MASTER_SITE_LOCAL:=rust/} +.endif +.if ${MACHINE_PLATFORM:MNetBSD-*-aarch64eb} || make(distinfo) || make (makesum) || make(mdi) +RUST_STAGE0_VER= 1.77.1 +RUST_ARCH= aarch64_be-unknown-netbsd +RUST_STAGE0:= rust-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.xz +RUST_STD_STAGE0:= rust-std-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.xz +DISTFILES:= ${DISTFILES} ${RUST_STAGE0} ${RUST_STD_STAGE0} +SITES.${RUST_STAGE0}= ${MASTER_SITE_LOCAL:=rust/} +SITES.${RUST_STD_STAGE0}= ${MASTER_SITE_LOCAL:=rust/} +.endif +.if ${MACHINE_PLATFORM:MNetBSD-*-sparc64} || make(distinfo) || make (makesum) || make(mdi) +RUST_STAGE0_VER= 1.77.1 +RUST_ARCH= sparc64-unknown-netbsd +RUST_STAGE0:= rust-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.xz +RUST_STD_STAGE0:= rust-std-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.xz +DISTFILES:= ${DISTFILES} ${RUST_STAGE0} ${RUST_STD_STAGE0} +SITES.${RUST_STAGE0}= ${MASTER_SITE_LOCAL:=rust/} +SITES.${RUST_STD_STAGE0}= ${MASTER_SITE_LOCAL:=rust/} +.endif +.if ${MACHINE_PLATFORM:MNetBSD-*-earmv7hf} || make(distinfo) || make (makesum) || make(mdi) +RUST_ARCH= armv7-unknown-netbsd-eabihf +RUST_STAGE0_VER= 1.77.1 +RUST_STAGE0:= rust-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.xz +RUST_STD_STAGE0:= rust-std-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.xz +DISTFILES:= ${DISTFILES} ${RUST_STAGE0} ${RUST_STD_STAGE0} +SITES.${RUST_STAGE0}= ${MASTER_SITE_LOCAL:=rust/} +SITES.${RUST_STD_STAGE0}= ${MASTER_SITE_LOCAL:=rust/} +.endif +.if ${MACHINE_PLATFORM:MNetBSD-*-earmv6hf} || make(distinfo) || make (makesum) || make(mdi) +RUST_ARCH= armv6-unknown-netbsd-eabihf +RUST_STAGE0_VER= 1.77.1 +RUST_STAGE0:= rust-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.xz +RUST_STD_STAGE0:= rust-std-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.xz +DISTFILES:= ${DISTFILES} ${RUST_STAGE0} ${RUST_STD_STAGE0} +SITES.${RUST_STAGE0}= ${MASTER_SITE_LOCAL:=rust/} +SITES.${RUST_STD_STAGE0}= ${MASTER_SITE_LOCAL:=rust/} +.endif +#.if ${MACHINE_PLATFORM:MNetBSD-*-mipsel} || make(distinfo) || make (makesum) || make(mdi) +#RUST_ARCH= mipsel-unknown-netbsd +#RUST_STAGE0_VER= 1.77.0 +#RUST_STAGE0:= rust-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.xz +#RUST_STD_STAGE0:= rust-std-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.xz +#DISTFILES:= ${DISTFILES} ${RUST_STAGE0} ${RUST_STD_STAGE0} +#SITES.${RUST_STAGE0}= ${MASTER_SITE_LOCAL:=rust/} +#SITES.${RUST_STD_STAGE0}= ${MASTER_SITE_LOCAL:=rust/} +#.endif +.if ${MACHINE_PLATFORM:MNetBSD-*-riscv64} || make(distinfo) || make (makesum) || make(mdi) +RUST_ARCH= riscv64gc-unknown-netbsd +RUST_STAGE0_VER= 1.77.1 +RUST_STAGE0:= rust-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.xz +RUST_STD_STAGE0:= rust-std-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.xz +DISTFILES:= ${DISTFILES} ${RUST_STAGE0} ${RUST_STD_STAGE0} +SITES.${RUST_STAGE0}= ${MASTER_SITE_LOCAL:=rust/} +SITES.${RUST_STD_STAGE0}= ${MASTER_SITE_LOCAL:=rust/} +.endif + +# You may override RUST_BOOTSTRAP_PATH and RUST_ARCH in mk.conf +# if you have a local bootstrap compiler. +.if !defined(RUST_ARCH) && !defined(RUST_BOOTSTRAP_PATH) +NOT_FOR_PLATFORM+= ${MACHINE_PLATFORM} +.else +RUST_BOOTSTRAP_PATH?= ${WRKDIR}/rust-bootstrap +.endif + +.if ${OPSYS} == "SunOS" +TOOL_DEPENDS+= coreutils>=0:../../sysutils/coreutils +TOOL_DEPENDS+= gzip>=0:../../archivers/gzip +TOOLS_CREATE+= md5sum +TOOLS_PATH.md5sum= ${PREFIX}/bin/gmd5sum +TOOLS_PLATFORM.gzcat= ${PREFIX}/bin/gzip -cd +.endif + +SUBST_CLASSES+= prefix +SUBST_STAGE.prefix= pre-configure +SUBST_FILES.prefix+= compiler/rustc_codegen_ssa/src/back/linker.rs +SUBST_FILES.prefix+= compiler/rustc_target/src/spec/base/netbsd.rs +SUBST_FILES.prefix+= src/bootstrap/src/core/build_steps/compile.rs +SUBST_FILES.prefix+= src/bootstrap/src/core/builder.rs +SUBST_FILES.prefix+= src/bootstrap/bootstrap.py +SUBST_VARS.prefix= PREFIX + +# +# Generate list of subst entries for various .cargo-checksum.json files. These +# are all handled together in one big substitution to simplify things rather +# than one substitution entry per file, but are kept separate below to ease +# updating and verification. +# + +CKSUM_CRATES+= vendor/libc-0.2.151 +CKSUMS+= 6d0ed494ac7d7b2d4bc63bc913cf21df8f625ce57b5d4aa490c5457c772cb979 +CKSUMS+= 4d4b8d1e41d432c8b346ac1b3a8fd607be466999df0669c1beec3ccab5fa4d9a + +CKSUM_CRATES+= vendor/libc +CKSUMS+= 10b2369edc027fcb2e41e5342f24946aa01ee1549a6d7f06b9a3956ff84518bc +CKSUMS+= 5357faa7191a248bb5b8cc17f9bdf56b60958851a9a6206c384ea94ba1f8dc24 + +CKSUM_CRATES+= vendor/cc-1.0.73 +CKSUMS+= 38970d678de0efb4b5e2978265daa8a613a1db35fc42e669621b03fc56d5b138 +CKSUMS+= 65de0d6593a4256e5fcaf898f9468d71bab672c70a2dfab3dcb8514e9b72819c + +CKSUM_CRATES+= vendor/cc +CKSUMS+= 71e55cf18e32dab3b9feae2add4ff57932a10084cc5aad4680c12eb3a91ed124 +CKSUMS+= 8cabd34e3fe6cabdbd5a7e324693ff13ee1ce4474ab861134df41666c0fdb99f + +CKSUM_CRATES+= vendor/lzma-sys +CKSUMS+= 6fd5e9245db34c6f557b8bfcaf03db82fc88c3b06dbfbb5f03b2bcd138983ef9 +CKSUMS+= 5e252578b5d266f6a4c8dc9f71ca7a91536ccb8c5c7d7753b82f12ec886459ef + +CKSUM_CRATES+= vendor/stacker +CKSUMS+= 59ca847887cf19387119d18c57f08d5a8520d714876ca0142b8f1c001ecde06b +CKSUMS+= 03be8ae293b713fe6e9703e4809dd68caaec992bae6777914ffddae8da2a9bc7 + +#CKSUM_CRATES+= vendor/crossbeam-epoch-0.9.15 +#CKSUM_CRATES+= vendor/crossbeam-utils-0.8.16 +#CKSUMS+= 5f75132808d9e8d6e266fe77f9e20bbc35855a1c37a5dbc0940b3e989bca1a94 +#CKSUMS+= 6a23e8a00ef6410a009a662198f3fd5521308263bf08ba663ca49a96b2c3f179 + +CKSUM_CRATES+= vendor/crossbeam-utils-0.8.17 +CKSUMS+= 31a8276afd38e39987a169eeb02e9bed32670de5ca36d7eb74aab7e506cf9dc4 +CKSUMS+= ead4bda23c322bde8c01e48d4cd19b70e7b7e473a56466218d279f88463ab466 + +CKSUM_CRATES+= vendor/crossbeam-utils-0.8.18 +CKSUMS+= 31a8276afd38e39987a169eeb02e9bed32670de5ca36d7eb74aab7e506cf9dc4 +CKSUMS+= ead4bda23c322bde8c01e48d4cd19b70e7b7e473a56466218d279f88463ab466 + +CKSUM_CRATES+= vendor/crossbeam-utils +CKSUMS+= 31a8276afd38e39987a169eeb02e9bed32670de5ca36d7eb74aab7e506cf9dc4 +CKSUMS+= ead4bda23c322bde8c01e48d4cd19b70e7b7e473a56466218d279f88463ab466 + +CKSUM_CRATES+= vendor/openssl-src +CKSUMS+= c87f041ff9ada85cddcb2a787788e05b2ab5ffc0a85f502fe7e3f7cbda59d49c +CKSUMS+= 67b877964bc0e40c84669c423818a3cb39501eaedfc3f5caf9c33d4779c3d03f +CKSUMS+= 090744f85cf99a9b8412c23fca1eabb61eb45d830f0f9f0e7309be2572c1e827 +CKSUMS+= 4261f87c06e6505afd9f7bdafe5aebdd153a1c6f928203cec2dd125642d60fc1 + +#CKSUM_CRATES+= vendor/nix-0.26.2 +#CKSUMS+= c3e13a2edea54d190a4b051f62efc97953c00b5051a9fda0e39e3bc732a31939 +#CKSUMS+= 263bd7ace66a4cfee3de18532f61c187327fcbd564666b4f97c4b01ae6885d98 + +CKSUM_CRATES+= vendor/aho-corasick +CKSUMS+= 840065521cbd4701fa5b8b506d1537843d858c903f7cadf3c68749ea1780874b +CKSUMS+= 626ce9b45dfded3d2eaf795a1d86be765a7d63eb4bcaf9d7b89add6f686f7ede +CKSUMS+= 720735ea6c7ff92b081426513e6e82feed24a922849297bb538d28f7b8129f81 +CKSUMS+= 3a5d88cf1ce02dc1bc06aa7d7aad0fa6d63ca45246a47ebeae43b48544065dcc + +#CKSUM_CRATES+= vendor/portable-atomic +#CKSUMS+= 3c8c8ad562d62cb394225b4ba7276bbd68d73ac521bf62c55fd38ef54c825e2d +#CKSUMS+= 1f9a76cf5c5be90bfe6321f3b0b725378bc9244daeec24542603057f03a0dde4 + +SUBST_CLASSES+= cksum +SUBST_STAGE.cksum= pre-configure +.for crate in ${CKSUM_CRATES} +SUBST_FILES.cksum+= ${crate}/.cargo-checksum.json +.endfor +.for from to in ${CKSUMS} +SUBST_SED.cksum+= -e 's,${from},${to},g' +.endfor + +post-extract: + set -e; \ + if ${TEST} -e ${WRKDIR}/rust-${RUST_STAGE0_VER}-${RUST_ARCH}/install.sh \ + -a ! -e ${RUST_BOOTSTRAP_PATH}/bin/rustc; then \ + cd ${WRKDIR}/rust-${RUST_STAGE0_VER}-${RUST_ARCH}; \ + env ${MAKE_ENV} ${TOOLS_BASH} \ + ./install.sh --prefix=${RUST_BOOTSTRAP_PATH}; \ + cd ${WRKDIR}/rust-std-${RUST_STAGE0_VER}-${RUST_ARCH}; \ + env ${MAKE_ENV} ${TOOLS_BASH} \ + ./install.sh --prefix=${RUST_BOOTSTRAP_PATH}; \ + fi +.if ${OPSYS} == "NetBSD" + SDIR=${WRKDIR}/scripts; \ + ${MKDIR} $${SDIR}; \ + cd $${SDIR}; \ + ${RM} -f c++-wrap; \ + ${RM} -f clang++-wrap; \ + ${RM} -f clang-wrap; \ + ${RM} -f ar-wrap; \ + ${CP} ${.CURDIR}/files/gcc-wrap .; \ + ${CHMOD} +x gcc-wrap; \ + ${LN} -s gcc-wrap c++-wrap; \ + ${LN} -s gcc-wrap clang++-wrap; \ + ${LN} -s gcc-wrap clang-wrap; \ + ${LN} -s gcc-wrap ar-wrap +.endif + +.if ${OPSYS} == "FreeBSD" +MAKE_ENV+= OPENSSL_DIR=${SSLBASE} +.endif + +.if ${OPSYS} == "NetBSD" && !empty(PKGSRC_COMPILER:Mclang) && !exists(/lib/libgcc_s.so) +BUILDLINK_TRANSFORM+= rm:-lgcc_s +MAKE_ENV+= PKGSRC_HAVE_LIBCPP=yes + +pre-build: provide-libgcc-for-bootstrap +.PHONY: provide-libgcc-for-bootstrap +provide-libgcc-for-bootstrap: +. if exists(${FILESDIR}/libgcc_s.so.1) + cp ${FILESDIR}/libgcc_s.so.1 ${RUST_BOOTSTRAP_PATH}/lib/. +. endif +.endif + +# +# These are essentially copies of the "all", "test", and "install" Makefile +# targets, but are duplicated here so that we can specify -j. +# +do-build: + ${RUN}${_ULIMIT_CMD} \ + cd ${WRKSRC} && \ + ${SETENV} ${MAKE_ENV} \ + sh -c "if [ \"${BUILD_TARGET}\" = \"dist\" ]; then \ + unset DESTDIR; \ + ${PYTHONBIN} ./x.py -v \ + ${BUILD_TARGET} -j ${_MAKE_JOBS_N}; \ + else \ + ${PYTHONBIN} ./x.py -v \ + ${BUILD_TARGET} --stage 2 -j ${_MAKE_JOBS_N} && \ + ${PYTHONBIN} ./x.py -v \ + doc --stage 2 -j ${_MAKE_JOBS_N}; \ + fi" + +do-test: + ${RUN}${_ULIMIT_CMD} \ + cd ${WRKSRC} && \ + ${SETENV} ${MAKE_ENV} \ + ${PYTHONBIN} ./x.py -v test -j ${_MAKE_JOBS_N} + +do-install: + ${RUN}${_ULIMIT_CMD} \ + cd ${WRKSRC} && \ + ${SETENV} ${MAKE_ENV} ${INSTALL_ENV} \ + ${PYTHONBIN} ./x.py -v install -j ${_MAKE_JOBS_N} + +SUBST_CLASSES+= destdir +SUBST_STAGE.destdir= post-install +SUBST_FILES.destdir= ${DESTDIR}${PREFIX}/lib/rustlib/manifest-* +SUBST_SED.destdir= -e 's|file:${DESTDIR}${PREFIX}|file:${PREFIX}|' + +GENERATE_PLIST+= ${FIND} ${DESTDIR}${PREFIX} \( -type f -o -type l \) -print | \ + ${SED} -e 's,${DESTDIR}${PREFIX}/,,' | ${SORT} ; + +# Create a relocatable stage2 bootstrap from the bits we just built that can be +# used to build the next version of rust. Currently only tested on SmartOS. +# +# Use the alternate BOOTSTRAP_NAME when creating a nightly release. +# +#BOOTSTRAP_NAME= ${PKGNAME_NOREV:C/rust/rust-nightly/}-${RUST_ARCH} +BOOTSTRAP_NAME= ${PKGNAME_NOREV}-${RUST_ARCH} +BOOTSTRAP_TMPDIR= ${WRKDIR}/${BOOTSTRAP_NAME} +USE_TOOLS+= gtar + +# The NetBSD part is so far untested, because I could not convince +# the rust build to use the gcc wrapper when building natively, +# so that I could get a placeholder in the RPATH, because chrpath +# cannot extend the length of the RPATH... +ELFEDIT?= /usr/bin/elfedit + +.PHONY: stage0-bootstrap +stage0-bootstrap: install + ${RM} -rf ${BOOTSTRAP_TMPDIR} + ${MKDIR} ${BOOTSTRAP_TMPDIR} +.if ${OPSYS} == "NetBSD" + (cd ${BOOTSTRAP_TMPDIR}; \ + DISTDIR=${WRKSRC}/bild/dist; \ + VER_ARCH=${PKGVERSION}-${RUST_ARCH}; \ + RUSTC=rustc-$${VER_ARCH}; \ + RUSTC_FILE=$${RUSTC}.tar.gz; \ + RUST_STD=rust-std-$${VER_ARCH}; \ + RUST_STD_FILE=$${RUST_STD}.tar.gz; \ + ${GTAR} -xzf $${DISTDIR}/$${RUSTC_FILE}; \ + (cd ${RUSTC}; \ + RPATH='/usr/pkg/lib:/lib:/usr/lib:$$ORIGIN/../lib'; \ + for f in rls-preview/bin/rls rustc/bin/rustc rustc/bin/rustdoc; do \ + chrpath -r $$RPATH $$f; \ + done; \ + RPATH='/usr/pkg/lib:/lib:/usr/lib:$$ORIGIN'; \ + for f in rustc/lib/*.so*; do \ + chrpath -r $$RPATH $$f; \ + done; \ + RPATH='/usr/pkg/lib:/lib:/usr/lib:$$ORIGIN:$$ORIGIN/../../..'; \ + for f in rustc/lib/rustlib/*/*/*.so*; do \ + chrpath -r $$RPATH $$f; \ + done;); \ + ${GTAR} -czf $${RUSTC_FILE} $${RUSTC}; \ + ${CP} $${DISTDIR}/$${RUST_STD_FILE} .; \ + ${ECHO} "Fixed stage0 bootstrap in ${BOOTSTRAP_TMPDIR}:"; \ + ${ECHO} "$${RUSTC_FILE}"; \ + ${ECHO} "$${RUST_STD_FILE}"; \ + ) +.endif +.if ${OS_VARIANT} == "SmartOS" + ${CP} -R ${DESTDIR}/${PREFIX}/bin ${BOOTSTRAP_TMPDIR}/ + ${CP} -R ${DESTDIR}/${PREFIX}/lib ${BOOTSTRAP_TMPDIR}/ + ${MKDIR} ${BOOTSTRAP_TMPDIR}/lib/pkgsrc + set -e; \ + for lib in libgcc_s.so.1 libstdc++.so.6; do \ + ${CP} `${PKG_CC} -print-file-name=$${lib}` \ + ${BOOTSTRAP_TMPDIR}/lib/pkgsrc/; \ + done; \ + for lib in libLLVM-15.so libcrypto.so.1.1 libcurl.so.4 \ + libssl.so.1.1 libz.so.1 libzstd.so.1; do \ + ${CP} ${PREFIX}/lib/$${lib} ${BOOTSTRAP_TMPDIR}/lib/pkgsrc/; \ + done; \ + for lib in libiconv.so.2 libidn2.so.0 libintl.so.8 liblber.so.2 \ + libldap.so.2 libnghttp2.so.14 libsasl2.so.3 \ + libssh2.so.1 libunistring.so.5; do \ + ${CP} ${PREFIX}/lib/$${lib} ${BOOTSTRAP_TMPDIR}/lib/pkgsrc/; \ + done; \ + for f in ${BOOTSTRAP_TMPDIR}/bin/*; do \ + /bin/file -b "$$f" | grep ^ELF >/dev/null || continue; \ + ${ELFEDIT} -e 'dyn:runpath $$ORIGIN/../lib:$$ORIGIN/../lib/pkgsrc' $$f; \ + done; \ + for f in ${BOOTSTRAP_TMPDIR}/lib/pkgsrc/*.so*; do \ + ${ELFEDIT} -e 'dyn:runpath $$ORIGIN' $$f; \ + done; \ + for f in ${BOOTSTRAP_TMPDIR}/lib/*.so*; do \ + ${ELFEDIT} -e 'dyn:runpath $$ORIGIN:$$ORIGIN/pkgsrc' $$f; \ + done; \ + for f in ${BOOTSTRAP_TMPDIR}/lib/rustlib/*/*/*.so*; do \ + ${ELFEDIT} -e 'dyn:runpath $$ORIGIN:$$ORIGIN/../../..:$$ORIGIN/../../../pkgsrc' $$f; \ + done; \ + cd ${WRKDIR}; ${GTAR} -zcf ${BOOTSTRAP_NAME}.tar.gz ${BOOTSTRAP_NAME} + @${ECHO} "" + @${ECHO} "Verify correct library paths using the following:" + @${ECHO} "" + @${ECHO} " cd ${BOOTSTRAP_TMPDIR}" + @${ECHO} " find . -type f | xargs ldd 2>/dev/null | egrep 'not.found|${PREFIX}'" + @${ECHO} "" + @${ECHO} "If there is no output then this bootstrap kit is ready to go:" + @${ECHO} "" + @${ECHO} " ${WRKDIR}/${BOOTSTRAP_NAME}.tar.gz" + @${ECHO} "" +.endif + +.include "options.mk" + +# These dependencies currently use the bundled sources as they require +# development features not yet available in released versions. +# +#.include "../../devel/libgit2/buildlink3.mk" +#.include "../../security/libssh2/buildlink3.mk" +#.include "../../www/http-parser/buildlink3.mk" +#.include "../../devel/jemalloc/buildlink3.mk" + +## Issues specific to: bootstrap AND NetBSD follow + +# rust i386 and sparc64 bootstraps are built for 8.0 +# and still depend on libstdc++.so.8. +# Pull in compat80 on 9.x and newer. +.if (${MACHINE_PLATFORM:MNetBSD-*-i386} || \ + ${MACHINE_PLATFORM:MNetBSD-*-sparc64}) \ + && empty(OS_VERSION:M8.*) +TOOL_DEPENDS+= compat80>=0:../../emulators/compat80 +.endif + +.include "../../mk/atomic64.mk" +# This is for when we build natively: +.if ${MACHINE_PLATFORM:MNetBSD-*-powerpc} || \ + ${MACHINE_PLATFORM:MNetBSD-*-i386} || \ + ${MACHINE_PLATFORM:MNetBSD-*-mipsel} || \ + ${MACHINE_PLATFORM:MNetBSD-*-riscv64} +# Make libatomic library available via a unique directory: +DEPENDS+= libatomic-links>=0:../../devel/libatomic-links +.endif + +TOOL_DEPENDS+= cmake-[0-9]*:../../devel/cmake +.include "../../devel/cmake/buildlink3.mk" +.include "../../devel/zlib/buildlink3.mk" +.include "../../lang/python/tool.mk" +.include "../../mk/bsd.pkg.mk" diff --git a/rust178/buildlink3.mk b/rust178/buildlink3.mk new file mode 100644 index 00000000000..1e4c6a9c9d2 --- /dev/null +++ b/rust178/buildlink3.mk @@ -0,0 +1,17 @@ +# $NetBSD: buildlink3.mk,v 1.6 2020/07/08 14:46:14 jperkin Exp $ + +BUILDLINK_TREE+= rust + +# +# DO NOT include this directly! Use rust.mk instead. +# + +.if !defined(RUST_BUILDLINK3_MK) +RUST_BUILDLINK3_MK:= + +BUILDLINK_API_DEPENDS.rust+= rust>=1.56.1 +BUILDLINK_PKGSRCDIR.rust?= ../../wip/rust +BUILDLINK_PASSTHRU_DIRS+= ${PREFIX}/lib/rustlib +.endif + +BUILDLINK_TREE+= -rust diff --git a/rust178/cargo.mk b/rust178/cargo.mk new file mode 100644 index 00000000000..f48bdac474f --- /dev/null +++ b/rust178/cargo.mk @@ -0,0 +1,109 @@ +# $NetBSD: cargo.mk,v 1.35 2023/05/16 06:10:52 wiz Exp $ +# +# Common logic that can be used by packages that depend on cargo crates +# from crates.io. This lets existing pkgsrc infrastructure fetch and verify +# cargo crates instead of using the rust package manager in the build phase. +# Inspired by cargo.mk from FreeBSD ports. +# +# Usage example: +# +# CARGO_CRATE_DEPENDS+= sha1-0.20 +# .include "../../lang/rust/cargo.mk" +# +# If modifying the list of dependencies, re-run the build once without +# --offline in CARGO_ARGS to generate a new valid Cargo.lock. +# e.g: make CARGO_ARGS="build --release" build +# +# a list of CARGO_CRATE_DEPENDS can be generated via +# make print-cargo-depends > cargo-depends.mk +# +# See also www/geckodriver for a full example. + +MASTER_SITES?= -${MASTER_SITE_CRATESIO}${PKGBASE}/${PKGVERSION_NOREV}/download + +CHECK_SSP_SUPPORTED= no + +.include "../../lang/rust/rust.mk" + +USE_TOOLS+= bsdtar +CARGO_VENDOR_DIR= ${WRKDIR}/vendor +CARGO_WRKSRC?= ${WRKSRC} + +# TODO: some Cargo.lock files include git+https sources which need to be fetched from the URL (not necessarily resolving to a crate.io url) +DISTFILES?= ${DEFAULT_DISTFILES} +.for crate in ${CARGO_CRATE_DEPENDS} +DISTFILES+= ${crate}.crate +SITES.${crate}.crate+= -${MASTER_SITE_CRATESIO}${crate:C/-[0-9]+\.[0-9.]+.*$//}/${crate:C/^.*-([0-9]+\.[0-9.]+.*)$/\1/}/download +EXTRACT_DIR.${crate}.crate?= ${CARGO_VENDOR_DIR} +.endfor + +.include "../../mk/bsd.prefs.mk" +# Triggers NetBSD ld.so bug (PR toolchain/54192) +# See Makefile for further information. +.if ${OPSYS} == "NetBSD" && ${OPSYS_VERSION} < 099957 +MAKE_JOBS_SAFE= no +.endif + +post-extract: cargo-vendor-crates +.PHONY: cargo-vendor-crates +cargo-vendor-crates: + @${STEP_MSG} "Extracting local cargo crates" + ${RUN}${MKDIR} ${CARGO_WRKSRC}/.cargo + ${RUN}${PRINTF} "[source.crates-io]\nreplace-with = \"vendored-sources\"\n[source.vendored-sources]\ndirectory = \"${CARGO_VENDOR_DIR}\"\n" > ${CARGO_WRKSRC}/.cargo/config + ${RUN}${MKDIR} ${CARGO_VENDOR_DIR} +.for crate in ${CARGO_CRATE_DEPENDS} + ${RUN}${PRINTF} '{"package":"%s","files":{}}' \ + `${DIGEST} sha256 < ${_DISTDIR}/${crate}.crate` \ + > ${CARGO_VENDOR_DIR}/${crate}/.cargo-checksum.json +.endfor + +# Legacy name +.PHONY: show-cargo-depends +show-cargo-depends: print-cargo-depends + +.PHONY: print-cargo-depends +print-cargo-depends: + ${RUN}${AWK} 'BEGIN {print "# $$Net" "BSD$$"; print;} \ + /^name = / { split($$3, a, "\""); name=a[2]; } \ + /^version = / { split($$3, a, "\""); vers=a[2]; } \ + /^source = / { \ + print "CARGO_CRATE_DEPENDS+=\t" name "-" vers; \ + }' ${CARGO_WRKSRC}/Cargo.lock + +DEFAULT_CARGO_ARGS= --offline -j${_MAKE_JOBS_N} \ + ${CARGO_NO_DEFAULT_FEATURES:M[yY][eE][sS]:C/[yY][eE][sS]/--no-default-features/} \ + ${CARGO_FEATURES:C/.*/--features/W} \ + ${CARGO_FEATURES:S/ /,/Wg} +CARGO_ARGS?= build --release ${DEFAULT_CARGO_ARGS} +CARGO_INSTALL_ARGS?= install --path . --root ${DESTDIR}${PREFIX} ${DEFAULT_CARGO_ARGS} + +MAKE_ENV+= RUSTFLAGS=${RUSTFLAGS:Q} + +.if !target(do-build) +do-build: do-cargo-build +.endif + +.PHONY: do-cargo-build +do-cargo-build: + ${RUN} cd ${CARGO_WRKSRC} && ${SETENV} ${MAKE_ENV} ${PREFIX}/bin/cargo ${CARGO_ARGS} + +.if !target(do-install) && ${GNU_CONFIGURE:Uno:tl} == no +do-install: do-cargo-install +.endif + +.PHONY: do-cargo-install +do-cargo-install: + ${RUN} cd ${CARGO_WRKSRC} && ${SETENV} ${MAKE_ENV} ${PREFIX}/bin/cargo ${CARGO_INSTALL_ARGS} + # remove files cargo uses for tracking installations + ${RM} -f ${DESTDIR}${PREFIX}/.crates.toml + ${RM} -f ${DESTDIR}${PREFIX}/.crates2.json + +.if ${OPSYS} == "Darwin" +.PHONY: do-cargo-post-install-darwin-fix-rpath +post-install: do-cargo-post-install-darwin-fix-rpath +do-cargo-post-install-darwin-fix-rpath: + ${RUN} cd ${DESTDIR}; \ + for i in $$(${FIND} .${PREFIX}/lib -name '*.so' | ${SED} -e 's|^\./||'); do \ + install_name_tool -id /$$i $$i; \ + done +.endif diff --git a/rust178/cross.mk b/rust178/cross.mk new file mode 100644 index 00000000000..2984a3d0580 --- /dev/null +++ b/rust178/cross.mk @@ -0,0 +1,82 @@ +# $NetBSD: cross.mk,v 1.3 2020/07/16 09:35:37 jperkin Exp $ + +# These settings may be used to cross-build rust. +# +# They interact with the files/gcc-wrap script to pick the +# right compiler for the different phases of the build, and +# use the headers for the target when required. Note that the +# cross-root tree will need to have the required binary packages +# installed (curl etc., see list of buildlink3.mk includes in main +# Makefile). + +# The gcc-wrap / c++-wrap script takes CROSS_ROOT environment variable +# to do a cross-build. The wrapper script assumes dest/ and tools/ +# as a result of a cross-build of NetBSD as subdirectories of this root +#CROSS_ROOT= /u/evbarm-armv7hf +#CROSS_ROOT= /u/evbarm-armv6hf +#CROSS_ROOT= /u/sparc64 +#CROSS_ROOT= /u/macppc +#CROSS_ROOT= /u/evbarm64 +#CROSS_ROOT= /u/evbarm64eb +#CROSS_ROOT= /u/i386 +#CROSS_ROOT= /u/mipsel +#CROSS_ROOT= /u/riscv64 +#CROSS_ROOT= / +#MAKE_ENV+= CROSS_ROOT=${CROSS_ROOT} + +# The GNU cross target designation +#GNU_CROSS_TARGET= armv7--netbsdelf-eabihf +#GNU_CROSS_TARGET= armv6--netbsdelf-eabihf +#GNU_CROSS_TARGET= sparc64--netbsd +#GNU_CROSS_TARGET= powerpc--netbsd +#GNU_CROSS_TARGET= aarch64--netbsd +#GNU_CROSS_TARGET= aarch64_be--netbsd +#GNU_CROSS_TARGET= i486--netbsdelf +#GNU_CROSS_TARGET= mipsel--netbsd +#GNU_CROSS_TARGET= riscv64--netbsd +#MAKE_ENV+= GNU_CROSS_TARGET=${GNU_CROSS_TARGET} + +# To cross-build rust, you need to specify +# the ultimate target to built for, as well as the +# host the compiler is supposed to run on. +# Rust's target designation +#TARGET= armv7-unknown-netbsd-eabihf +#TARGET= armv6-unknown-netbsd-eabihf +#TARGET= sparc64-unknown-netbsd +#TARGET= powerpc-unknown-netbsd +#TARGET= aarch64-unknown-netbsd +#TARGET= aarch64_be-unknown-netbsd +#TARGET= i686-unknown-netbsd +#TARGET= i586-unknown-netbsd +#TARGET= mipsel-unknown-netbsd +#TARGET= riscv64gc-unknown-netbsd +# +#SCRIPTS= ${WRKDIR}/scripts +#CONFIGURE_ARGS+= --host=${TARGET} +#CONFIGURE_ARGS+= --target=${TARGET} +#CONFIGURE_ARGS+= --set=target.${TARGET}.cc=${SCRIPTS}/gcc-wrap +#CONFIGURE_ARGS+= --set=target.${TARGET}.cxx=${SCRIPTS}/c++-wrap +#CONFIGURE_ARGS+= --set=target.${TARGET}.linker=${SCRIPTS}/gcc-wrap +# Pick one: +#CONFIGURE_ARGS+= --set=target.${TARGET}.ar=${CROSS_ROOT}/tools/bin/${GNU_CROSS_TARGET}-ar +#CONFIGURE_ARGS+= --set=target.${TARGET}.ar=${SCRIPTS}/ar-wrap + +# May be required when cross-building on NetBSD +#MAKE_ENV+= OPENSSL_DIR=/usr + +# +# Cross-compile illumos target. The host is identical, it's just the target +# that is renamed from x86_64-sun-solaris to x86_64-unknown-illumos. +# +#TARGET= x86_64-unknown-illumos +# +# Use these variables for "cross-compiling" from x86_64-sun-solaris. +# +#CONFIGURE_ARGS+= --set=target.${TARGET}.llvm-config=${LLVM_CONFIG_PATH} +#CONFIGURE_ARGS+= --host=${TARGET} +#CONFIGURE_ARGS+= --target=${TARGET} +# +# Set this variable when using a native x86_64-unknown-illumos bootstrap, as +# the build still defaults to x86_64-sun-solaris based on uname. +# +#CONFIGURE_ARGS+= --build=${TARGET} diff --git a/rust178/distinfo b/rust178/distinfo new file mode 100644 index 00000000000..bbd2a0bfea4 --- /dev/null +++ b/rust178/distinfo @@ -0,0 +1,155 @@ +$NetBSD: distinfo,v 1.159 2023/06/19 14:46:47 bsiegert Exp $ + +BLAKE2s (rust-1.74.1-x86_64-unknown-illumos.tar.gz) = a85cd9e2f41848c0d533bfe77b205dd73fd095cf312eefd1d25fea7e016d01ba +SHA512 (rust-1.74.1-x86_64-unknown-illumos.tar.gz) = 3bde6eb2ba638c0e5400fb8968de1e407d7aa3018044bc43168fe2acca47deaa89bf0dec43221096f9041e0355bce0b66a098c72d2f624842c0bd57c4bedface +Size (rust-1.74.1-x86_64-unknown-illumos.tar.gz) = 231103389 bytes +BLAKE2s (rust-1.77.1-aarch64-unknown-netbsd.tar.xz) = f417cefa62957fa377ad1127060c0ec78c62c98a844dcde0f0f0ff75cabce44f +SHA512 (rust-1.77.1-aarch64-unknown-netbsd.tar.xz) = 3f19d1da1631e2dc5918dccc2baa24e361739adc7fde9385950ba865c48a1d2645ae4a4cf25f9da1246f04b0fbb8a0c972f304c5bf51c5a312df0f5bb72faca7 +Size (rust-1.77.1-aarch64-unknown-netbsd.tar.xz) = 161209772 bytes +BLAKE2s (rust-1.77.1-aarch64_be-unknown-netbsd.tar.xz) = 5423dd837f47538992a67313a83983b583148f670f561da1d2a256fc98b5e24d +SHA512 (rust-1.77.1-aarch64_be-unknown-netbsd.tar.xz) = 449b8520f0904e15163e6a55bec5dcdb18c0e423b6dd2450f99dd061edcdbd33e9c4fe5dc874ab09b4efabd6199f9ad595f13ecd4d69d708c68f9fc54c1da6c4 +Size (rust-1.77.1-aarch64_be-unknown-netbsd.tar.xz) = 159858112 bytes +BLAKE2s (rust-1.77.1-armv6-unknown-netbsd-eabihf.tar.xz) = 0636a7163287b690b93bcd81db0999777cb8bf21a59062a0fe60e050e178aaca +SHA512 (rust-1.77.1-armv6-unknown-netbsd-eabihf.tar.xz) = d68ef8f00f0d55a1bfce14a2878774259aca722d43c6e9ce7f8ebd6dc540393c84d3943f7dda9a79b240c12d87a9deb7d8a35b690bdef06a12434b8619a82e91 +Size (rust-1.77.1-armv6-unknown-netbsd-eabihf.tar.xz) = 139224332 bytes +BLAKE2s (rust-1.77.1-armv7-unknown-netbsd-eabihf.tar.xz) = 58deb97caa4c3dcb2fb92cbd4ee5ba873292657b1b361ceeeeabad5d84134dca +SHA512 (rust-1.77.1-armv7-unknown-netbsd-eabihf.tar.xz) = 94b8037e105e24fb716f35d30f6fbd19b8dc068303dfef0bb0fdb030da753633eb129d92ee6fbcee86429b2cad28af4a880de6b18ce1917b4163346b4d01f2ef +Size (rust-1.77.1-armv7-unknown-netbsd-eabihf.tar.xz) = 139373196 bytes +BLAKE2s (rust-1.77.1-i586-unknown-netbsd.tar.xz) = ec8824e5faf40055491a5f0346f856b125a0c9875782af941165fb9c02a3c642 +SHA512 (rust-1.77.1-i586-unknown-netbsd.tar.xz) = ea3238fcf820aff0733abc1d6c1ce6ad3cb55c5e45e5e8f6bb074b1a1e655fd9aaff1c1eb71aea980f5ebb9560ce809dbd58d539849033173db3aee064efdca7 +Size (rust-1.77.1-i586-unknown-netbsd.tar.xz) = 175473176 bytes +BLAKE2s (rust-1.77.1-powerpc-unknown-netbsd.tar.xz) = 45dac0770622c7fadf825f5b37b8d7386d62aa11fd38c0b98b7c3eca79ccb577 +SHA512 (rust-1.77.1-powerpc-unknown-netbsd.tar.xz) = f5e995ab0ec24ef03232606385f57120d61529fe51003d1978cf23bec4773ee9796d23ca517fe1cd79753540a305e42e5b640856daf6e5a0835deaeaa8cb2603 +Size (rust-1.77.1-powerpc-unknown-netbsd.tar.xz) = 187015936 bytes +BLAKE2s (rust-1.77.1-riscv64gc-unknown-netbsd.tar.xz) = 75100a68d7a1bb05f4e973e36dd23c1e678f222c17277eb786531a4c06b4521c +SHA512 (rust-1.77.1-riscv64gc-unknown-netbsd.tar.xz) = 08d82d4bc0f3cd5478733adb69e67ef177a935b38e5d66adf7a99ceb4bed6a61b04367bd69ae1333df2614806104834d84f58b40e38acf713936dbb77635e490 +Size (rust-1.77.1-riscv64gc-unknown-netbsd.tar.xz) = 172460240 bytes +BLAKE2s (rust-1.77.1-sparc64-unknown-netbsd.tar.xz) = f45da067891765b9ea3ae4558769ba59042deeb61e90f378626ca55a5e2b3065 +SHA512 (rust-1.77.1-sparc64-unknown-netbsd.tar.xz) = d81ff19d0f47a57c5cd97bdc2f69979aa8d90a105f65d1403e9504964dddc59af10da078a54956cdf6e24d1d1df0b12c938609c640dcc95e7c4d2be5c2a197ce +Size (rust-1.77.1-sparc64-unknown-netbsd.tar.xz) = 156139656 bytes +BLAKE2s (rust-1.77.1-x86_64-unknown-netbsd.tar.xz) = 74b1fd48da38a8bf26ba86dd65a5b5b0da6db7935795ae08f0882e39c585d9f9 +SHA512 (rust-1.77.1-x86_64-unknown-netbsd.tar.xz) = ebd747a1884f4a2778ed8939b5d7ccfdf85f6ded717747a6892b8bd697839f209608cedea6e5087a54b5a8b1d98013e56fa7cdb0169f81674ff354b31f13e931 +Size (rust-1.77.1-x86_64-unknown-netbsd.tar.xz) = 153136764 bytes +BLAKE2s (rust-1.77.2-aarch64-apple-darwin.tar.gz) = 7da34767db62eb82c5a5c328ede881a0d937542c500bf4026b8ae4099ee50231 +SHA512 (rust-1.77.2-aarch64-apple-darwin.tar.gz) = 15a7e10755adb9ec053a68358deb865d3c980d84b39b77047a54da479fca978d4f435174557a7e2b09435305607699872318b089c6d68541fac11a61c8d23f69 +Size (rust-1.77.2-aarch64-apple-darwin.tar.gz) = 247103778 bytes +BLAKE2s (rust-1.77.2-aarch64-unknown-linux-gnu.tar.gz) = 70fc926e4bdaf1a8eda3687ad00ebbe466d4ce34970962a58cc7086a689c5463 +SHA512 (rust-1.77.2-aarch64-unknown-linux-gnu.tar.gz) = 74911677657cefc8d987e10a7cacd0806d81847232154cdb0573e8dece1413fc6035eed62b8a89fe96b96c3df43471e53d626df33df8ab07dcab56500246f2c1 +Size (rust-1.77.2-aarch64-unknown-linux-gnu.tar.gz) = 454853476 bytes +BLAKE2s (rust-1.77.2-arm-unknown-linux-gnueabihf.tar.gz) = d6af4aeb4511d55fb2fae28b0c5a9e3023da63711184c5d27948dd1df97a2de9 +SHA512 (rust-1.77.2-arm-unknown-linux-gnueabihf.tar.gz) = 5a00390f9ca344de2a3f6a1c2cb87f820a86b1ce657b5a0b8a50340dbc1c87a442b3c3b051d4708a3da30672e3a237894e7d37256aa4f09c09cef8bd8497b357 +Size (rust-1.77.2-arm-unknown-linux-gnueabihf.tar.gz) = 343398247 bytes +BLAKE2s (rust-1.77.2-armv7-unknown-linux-gnueabihf.tar.gz) = 2baa71e30524f9f8984962fa0fc7b0943756150430c871ae5b336e63e2177db4 +SHA512 (rust-1.77.2-armv7-unknown-linux-gnueabihf.tar.gz) = 92b834471c0d3603e5d49f167a1f5a3020c466f3fd18c09b12531c5719befc2eac9ba3f3de74f7ea0ef80fca5acc2291501329fa61d1f348a18bbec90792557a +Size (rust-1.77.2-armv7-unknown-linux-gnueabihf.tar.gz) = 332520230 bytes +BLAKE2s (rust-1.77.2-i686-unknown-linux-gnu.tar.gz) = 08ddb4fea49c0de0e5af1341fc6c24675d3f789683bd7af0f3af86324c3114f1 +SHA512 (rust-1.77.2-i686-unknown-linux-gnu.tar.gz) = 3acb914c5cf823ff68b700257e16dc0ca18533b094e2c46cb7b49cb3f6b47cc218ad037960c5ac4f954c730bf8a3649d4ac9be9d0f940cb44cfcb8df48966991 +Size (rust-1.77.2-i686-unknown-linux-gnu.tar.gz) = 406032381 bytes +BLAKE2s (rust-1.77.2-x86_64-apple-darwin.tar.gz) = 1e54776c0df9a170b318883b8ccd0296df15fb68e7f03e14d124a36aa875a32a +SHA512 (rust-1.77.2-x86_64-apple-darwin.tar.gz) = 3f2ddfda0124c57b57426d04744683e77db56a57e1201c5be744f1fba9fe6232d156c7f8dc0551865e8a6a31633060b5f000a76b409d157177bc741616aa0690 +Size (rust-1.77.2-x86_64-apple-darwin.tar.gz) = 328060087 bytes +BLAKE2s (rust-1.77.2-x86_64-unknown-freebsd.tar.gz) = 60ac669d8ed61a7e4badb55138a95420dba5fb0f6ef7a801158f36e29970f54b +SHA512 (rust-1.77.2-x86_64-unknown-freebsd.tar.gz) = e2afe9028ed16c691cc0737d3dca8c25cd413262a5767038ca4eb93c168d1463758061dc6c8cd9e56270cb1bb02c526cec72049656c2218e84104e3bb757768d +Size (rust-1.77.2-x86_64-unknown-freebsd.tar.gz) = 304173540 bytes +BLAKE2s (rust-1.77.2-x86_64-unknown-linux-gnu.tar.gz) = 64d51e1e1b029b07c0ee33313e9559b42cc6735791dd341df0af9a2545b2c96f +SHA512 (rust-1.77.2-x86_64-unknown-linux-gnu.tar.gz) = f5fe1ebb856873e5f9f45149ec7736a13fc5ea6ce973dc2df46f38bf0fab34d5d09281aa2f7749908e4c00ad751c39778fd034ff20d8210ad6aeb3dd5eacd0df +Size (rust-1.77.2-x86_64-unknown-linux-gnu.tar.gz) = 317256728 bytes +BLAKE2s (rust-std-1.77.1-aarch64-unknown-netbsd.tar.xz) = 6c81a850cf50f69e73160baf9bb159073c7269f5568f53ba6cb7898cee96089f +SHA512 (rust-std-1.77.1-aarch64-unknown-netbsd.tar.xz) = e947955022d39e9f5b20de38e4531b6f564b23a942c34ed5f673ae4043c5b916eafeea803f537e794afc81a597d64ca1c115067312b3f1b7c582fcec7838362e +Size (rust-std-1.77.1-aarch64-unknown-netbsd.tar.xz) = 22769120 bytes +BLAKE2s (rust-std-1.77.1-aarch64_be-unknown-netbsd.tar.xz) = 7c0740d555c35930695d3a987a5dc6614308dcce5fab93fd670a32cee2d10af6 +SHA512 (rust-std-1.77.1-aarch64_be-unknown-netbsd.tar.xz) = 24c1aa3306701a8d3eea284fe316a7b369a2b6d97716a7de339561ed3e3090456fa503c0ec1d3272ac91591b2e231fda44bbd5c32f06ca55c2072233851070e6 +Size (rust-std-1.77.1-aarch64_be-unknown-netbsd.tar.xz) = 22754836 bytes +BLAKE2s (rust-std-1.77.1-armv6-unknown-netbsd-eabihf.tar.xz) = 27f3562f278c2935c136d578db1eb4c1ddfe12ac1ec0b9729e5095d95395d996 +SHA512 (rust-std-1.77.1-armv6-unknown-netbsd-eabihf.tar.xz) = 93a36cd0754975d13c7a60b31d0a69765c8894234422a4447b2f04531642421504e68d408ded1ff0f695050b403666e893d14f4eabe4cb6c2a22c7a1a40c9a2b +Size (rust-std-1.77.1-armv6-unknown-netbsd-eabihf.tar.xz) = 21355204 bytes +BLAKE2s (rust-std-1.77.1-armv7-unknown-netbsd-eabihf.tar.xz) = 5d081f5d3a125e6dc333b1324b268c4a5e0d7a3af407caca8b0fa501342e8734 +SHA512 (rust-std-1.77.1-armv7-unknown-netbsd-eabihf.tar.xz) = aa882882209758561474b205ec3d1b5db0341c0ede6f00d0b4b6c72a1f860981f3f9cfc8413677ae05b14eb49bd8849283550c617570dd5e336796a84f7547d0 +Size (rust-std-1.77.1-armv7-unknown-netbsd-eabihf.tar.xz) = 22215380 bytes +BLAKE2s (rust-std-1.77.1-i586-unknown-netbsd.tar.xz) = f135396d338d18c989e58118a32a4e0b70a3db1d5fc31ca6d9ddcf3457d31668 +SHA512 (rust-std-1.77.1-i586-unknown-netbsd.tar.xz) = 6f587278c8a3e22f2aa129caecd02358910cf7f0ed1da9dbe0fd365771f21ed9e3c77af8f4a72bd16744577f33bda6e7647d30d83b93b449e70b1f58f621f265 +Size (rust-std-1.77.1-i586-unknown-netbsd.tar.xz) = 23235572 bytes +BLAKE2s (rust-std-1.77.1-powerpc-unknown-netbsd.tar.xz) = d574f27b69b0370e9d3fc9e79a553ca944c98c5ca2781ece4eaf1e74d8b83482 +SHA512 (rust-std-1.77.1-powerpc-unknown-netbsd.tar.xz) = 239dfe6a37fd4e152424326e0b93cc6de7715a87d7776ffe5d0bccc98c342ea68afc875ecd870b0280b484194ce2d600c6c12f78026f3c189b2ab3ab45b90f8b +Size (rust-std-1.77.1-powerpc-unknown-netbsd.tar.xz) = 21532136 bytes +BLAKE2s (rust-std-1.77.1-riscv64gc-unknown-netbsd.tar.xz) = 6ab10d83da1b503d6c8c0ed65fc1b8ffec2e2733d7ec0671e8387c7469433d8d +SHA512 (rust-std-1.77.1-riscv64gc-unknown-netbsd.tar.xz) = c02d9b1068fb153b795f7106c1373e0dc6baa7697cb403ef9385d552bf84c540f837dab56e28e0b814045f411fca8b626225ada8b15772ec46d7118bb7f9b9f0 +Size (rust-std-1.77.1-riscv64gc-unknown-netbsd.tar.xz) = 21521640 bytes +BLAKE2s (rust-std-1.77.1-sparc64-unknown-netbsd.tar.xz) = 307b35670983e097d2a6264e1d61e29ada88758ac4215d4ceccdfdb13f6810ea +SHA512 (rust-std-1.77.1-sparc64-unknown-netbsd.tar.xz) = 4595808d2a7ecabc08204cd228ab5e1186c17c934a73ca83859ae3a245b4fc93528bf0b5a48a57dca63a3bca8fa95516246ae1381544fd17446973a099191a65 +Size (rust-std-1.77.1-sparc64-unknown-netbsd.tar.xz) = 21480940 bytes +BLAKE2s (rust-std-1.77.1-x86_64-unknown-netbsd.tar.xz) = a43cac7ed2d318f8dcd43e7c78e5d3ceb2d5ee41387c4072dce14175ae1f13bc +SHA512 (rust-std-1.77.1-x86_64-unknown-netbsd.tar.xz) = 4a50f26bf4021b036012e4aca5667ac775f215388e39300d0b8cfb96982f6cc1f4a5a7bab1128eb16779063f04a4c47e715c3d84228536feac3cf1b1f8004058 +Size (rust-std-1.77.1-x86_64-unknown-netbsd.tar.xz) = 23559612 bytes +BLAKE2s (rust-std-1.77.2-aarch64-apple-darwin.tar.gz) = 113fd06385e96d13aa2fd3927f6962a640e7204946ebc6677db025bd26ad7280 +SHA512 (rust-std-1.77.2-aarch64-apple-darwin.tar.gz) = 35c637bbf33225d11c4b4bee1c5ae2132e2c43356333c6b79ec9c80c6423c40da8154250199baa55d44bbd1a48522ebfa889e0128f83ff8a48288077ecb6e2b6 +Size (rust-std-1.77.2-aarch64-apple-darwin.tar.gz) = 40411220 bytes +BLAKE2s (rust-std-1.77.2-aarch64-unknown-linux-gnu.tar.gz) = 6615d943fd8f8378951781793dd99f04a52df2b0abc5d3e02d00197029a82aeb +SHA512 (rust-std-1.77.2-aarch64-unknown-linux-gnu.tar.gz) = 03e3182e87702d698c77afdbe3ea8bdc44d111c4a4bfa60910b171cbe01c126d15ea1c91d4344523601ab5da4e809d5206168218fdf6e37e619822313d20db1d +Size (rust-std-1.77.2-aarch64-unknown-linux-gnu.tar.gz) = 64717761 bytes +BLAKE2s (rust-std-1.77.2-arm-unknown-linux-gnueabihf.tar.gz) = 92290d6ad376abcc644d134214335874f0e74bdc5cb0ab660bfa333e5245a50f +SHA512 (rust-std-1.77.2-arm-unknown-linux-gnueabihf.tar.gz) = e9558f794e8717a73e3af7ce3295d57e4af4570cd1db0cf7bf3a6cd9cc6aae39c698e17cde9a21895b53f7261da3822f35429d3b2298de8ed3194b85343dd4e0 +Size (rust-std-1.77.2-arm-unknown-linux-gnueabihf.tar.gz) = 37104486 bytes +BLAKE2s (rust-std-1.77.2-armv7-unknown-linux-gnueabihf.tar.gz) = 759613f28565ba413b5670996384975675211093657774b55519f9de3c9f2b69 +SHA512 (rust-std-1.77.2-armv7-unknown-linux-gnueabihf.tar.gz) = c19967e49257ead60a2092c0dda2434d53729ab0291c23df8f0f4d5f15d53de512fc7bd714847bfb7e835509dccddc1d9c1561bf8fbcd9459c77fd230cb5571e +Size (rust-std-1.77.2-armv7-unknown-linux-gnueabihf.tar.gz) = 38341291 bytes +BLAKE2s (rust-std-1.77.2-i686-unknown-linux-gnu.tar.gz) = 903c74ce81af6c98d9f11a68afd20abdd4f0f84cdf9ccc6f80cdb74809a9f404 +SHA512 (rust-std-1.77.2-i686-unknown-linux-gnu.tar.gz) = 632f537068d71b85cea0dbc085adcfc4dee568efbd650325ad6d0d6b8b47f3c7b8e097b2f3584b57dfa847188d990d8e26eb2acf94748c6ddb9340fd0e9ee301 +Size (rust-std-1.77.2-i686-unknown-linux-gnu.tar.gz) = 40040349 bytes +BLAKE2s (rust-std-1.77.2-x86_64-apple-darwin.tar.gz) = 7b75636d2c5aee1b5b66966775e0fc9c2edfd705bb1d6477e8d42da554573dc4 +SHA512 (rust-std-1.77.2-x86_64-apple-darwin.tar.gz) = 9a81f56996b1124cb792c05aa55dad468fb775493a1a1f7695fdc931942c50d6ea106feb37ed6cb510281c30a17469d01bb359b97b5290edd77ff113db095fec +Size (rust-std-1.77.2-x86_64-apple-darwin.tar.gz) = 42017389 bytes +BLAKE2s (rust-std-1.77.2-x86_64-unknown-freebsd.tar.gz) = 563e3d302c85c15c6fb5a41d41af41675e168fb26bbd3634c864513308480ac9 +SHA512 (rust-std-1.77.2-x86_64-unknown-freebsd.tar.gz) = 02d1a8ff2de7a510b698686ce8cf1f939dc1db355bcd071ec4b6557a6127ec44815246782205d29c78044882b225121788a7861bf70663e37640261dd3629f68 +Size (rust-std-1.77.2-x86_64-unknown-freebsd.tar.gz) = 42971269 bytes +BLAKE2s (rust-std-1.77.2-x86_64-unknown-linux-gnu.tar.gz) = b585beefcf9356f91d941e44ca830ea0e9b1065a830f2b05cdf697b410920c0a +SHA512 (rust-std-1.77.2-x86_64-unknown-linux-gnu.tar.gz) = ccc4207abf25a34b2c73dc79da16c38d5d6cc329ced010754ced52f1188da6bec49ee39375f89ee3feb7f74a0d4e94d62883033b8ed9072e1f1257a9955fe2ef +Size (rust-std-1.77.2-x86_64-unknown-linux-gnu.tar.gz) = 44822691 bytes +BLAKE2s (rustc-1.78.0-src.tar.gz) = 5ea6f12f7d68d07af9cba4074ed1968315bc151a7c491d65ee7347091d827b7f +SHA512 (rustc-1.78.0-src.tar.gz) = ba3fa6ea78cb12d0956d0526bcb243b83a81cbb3aa7a01805817f1210802eed0df3e4396e4f83695a68a8765675e77ebdc702723743cb3c6b2895c84c7d11fe2 +Size (rustc-1.78.0-src.tar.gz) = 284630812 bytes +SHA1 (patch-compiler_rustc__codegen__ssa_src_back_linker.rs) = 6c8f8bbacc544b63b20a9546ffe8ca5d74b6f4d4 +SHA1 (patch-compiler_rustc__llvm_build.rs) = a4a66d449fc9eb99d648d02a041778a68f4f7ce8 +SHA1 (patch-compiler_rustc__target_src_spec_base_netbsd.rs) = 7d910631f49acf2c33fdd191fd3e0f261efae234 +SHA1 (patch-compiler_rustc__target_src_spec_mod.rs) = a22b5d28997ed9a5565deec9c34322165d563d00 +SHA1 (patch-compiler_rustc__target_src_spec_targets_mips64el__unknown__netbsd.rs) = e97b7978cc525db7eadf967d51f4818a3c145754 +SHA1 (patch-library_backtrace_src_symbolize_gimli.rs) = 1ab343595e65ff6348f83cffc30e53d764485ff8 +SHA1 (patch-library_backtrace_src_symbolize_gimli_elf.rs) = 3b84a462c6bc8245d579452e4c37e3ce13314952 +SHA1 (patch-library_std_src_sys_pal_unix_mod.rs) = bfc59ae4568547e3ed71c8b31ba5b5b5363d5d40 +SHA1 (patch-library_std_src_sys_pal_unix_thread.rs) = 74a04665236d8c13378f6ced00c37325aaba8b22 +SHA1 (patch-library_std_src_sys_pal_unix_thread__parking_netbsd.rs) = 9b073ba37a644c5094c48f33e49578ac026e16ff +SHA1 (patch-src_bootstrap_bootstrap.py) = 5cd73003292c935ce0e405edd132180233a04857 +SHA1 (patch-src_bootstrap_src_core_build__steps_compile.rs) = 4696304623232acd419ad15597f539a10a014271 +SHA1 (patch-src_bootstrap_src_core_builder.rs) = 57bf8e00ea863e5908f46e10bb208d7bc0b5d031 +SHA1 (patch-src_bootstrap_src_lib.rs) = d29bc3c0b335d5e788eecbb02fc08966beef0fb1 +SHA1 (patch-src_llvm-project_llvm_CMakeLists.txt) = 7abfabb6ec70df229a69355f8c76825610165c37 +SHA1 (patch-src_llvm-project_llvm_cmake_modules_AddLLVM.cmake) = e1b2eb2f0b3cf1cf87b443656ae306b3242f6b12 +SHA1 (patch-src_llvm-project_llvm_include_llvm-c_DataTypes.h) = cb011fc19957883c01725797f7c85ed1b20f96f1 +SHA1 (patch-src_llvm-project_llvm_include_llvm_Analysis_ConstantFolding.h) = 39d76e6659143d154ae690ac70781b698a2023d8 +SHA1 (patch-src_llvm-project_llvm_utils_FileCheck_FileCheck.cpp) = 2587c2f4d11ad8f75bf8a16de625135b26bacc15 +SHA1 (patch-src_tools_cargo_src_cargo_core_profiles.rs) = e1af7fde97416e0a269ee34efd37f4f47fcf7a95 +SHA1 (patch-src_tools_cargo_tests_testsuite_build.rs) = 60713699c968f3e389f486e796009d31a5048906 +SHA1 (patch-src_tools_rust-installer_install-template.sh) = 6984546c34a2e4d55a6dbe59baa0d4958184e0b7 +SHA1 (patch-vendor_aho-corasick_src_packed_teddy_builder.rs) = cdd3ea21c270fa7a66ffe24adf93d7f871fd8441 +SHA1 (patch-vendor_aho-corasick_src_packed_vector.rs) = 3205c7f698079e045726bfe17a372f71758ab9dd +SHA1 (patch-vendor_backtrace_src_symbolize_gimli.rs) = b93148ff72a60a17c6a444f2616386c40d872153 +SHA1 (patch-vendor_backtrace_src_symbolize_gimli_elf.rs) = 308538090d9ce11d206d6eef0e675581a1fc6e80 +SHA1 (patch-vendor_cc-1.0.73_src_lib.rs) = 98acea9fb98898f63bbb0f6555df5e4b15da2b85 +SHA1 (patch-vendor_cc_src_lib.rs) = b205e3e8138ce0843ab622b230dd8af2b8781d6f +SHA1 (patch-vendor_crossbeam-utils-0.8.17_no__atomic.rs) = 43ba3d5ed59446d4c1f4b39cc3bafda5d6ae1795 +SHA1 (patch-vendor_crossbeam-utils-0.8.18_no__atomic.rs) = d4d9288cb199af9bc7e321fbd2b42860aed954ec +SHA1 (patch-vendor_crossbeam-utils_no__atomic.rs) = bb0c38a8aedf41957f2a1556d021eef171cfd617 +SHA1 (patch-vendor_libc-0.2.148_src_unix_bsd_netbsdlike_netbsd_mips.rs) = 0895df54084281263b9dae67e57f68168fb66bd4 +SHA1 (patch-vendor_libc-0.2.148_src_unix_bsd_netbsdlike_netbsd_riscv64.rs) = 8699853de4225d4e5953d6bf17b59bc463fa7b5d +SHA1 (patch-vendor_libc-0.2.151_src_unix_solarish_mod.rs) = 50a296ba939f8c12a445526b16f50e8111a762a7 +SHA1 (patch-vendor_libc_src_unix_solarish_mod.rs) = 4d16d9545b4bee3155664c4e7ce12082a7f4400e +SHA1 (patch-vendor_lzma-sys_config.h) = b654c7e129fa02697734bc87173f89b3056a5437 +SHA1 (patch-vendor_openssl-src_openssl_Configurations_10-main.conf) = 64f513fe8302066ff8ce3c8459c23c1bfdcf9562 +SHA1 (patch-vendor_openssl-src_src_lib.rs) = d7fce1d3b87261bc6d8a12be41e31816727cf917 +SHA1 (patch-vendor_openssl-sys_build_find__normal.rs) = 98927415bd3517a7492b87da99c8933c19c7299e +SHA1 (patch-vendor_openssl-sys_build_main.rs) = 2832c072ddce399f467442e271983bc7176b42bc +SHA1 (patch-vendor_portable-atomic_no__atomic.rs) = 796032bfc8ea80d6ec0a398ecbdd6b31136d7242 +SHA1 (patch-vendor_rustc-ap-rustc__target_src_spec_aarch64__be__unknown__netbsd.rs) = 4e86aec4c89db9a331950a12f8ec7b8aaa50eed7 +SHA1 (patch-vendor_stacker_src_lib.rs) = e00a1e95eb16540ff182715db778bf97ebd07a5e +SHA1 (patch-vendor_target-lexicon_src_targets.rs) = 65ffbc524705bddd5233b3766b3f271dfea5d625 +SHA1 (patch-vendor_valuable_no__atomic.rs) = 3a40cb846bf1fae864c55a0ddba8fdeb5efcba72 diff --git a/rust178/do-cross.mk b/rust178/do-cross.mk new file mode 100644 index 00000000000..19e064730ca --- /dev/null +++ b/rust178/do-cross.mk @@ -0,0 +1,107 @@ +# $NetBSD$ +# Do all the NetBSD cross builds +# Collect the bootstrap kits in dist/ + +VERSION!= make show-var VARNAME=PKGVERSION +V_NOREV!= make show-var VARNAME=PKGVERSION_NOREV + +SHORT_TARGETS+= armv7 +SHORT_TARGETS+= armv6 +SHORT_TARGETS+= sparc64 +SHORT_TARGETS+= powerpc +SHORT_TARGETS+= arm64 +SHORT_TARGETS+= arm64_be +SHORT_TARGETS+= i386 +SHORT_TARGETS+= riscv64 +#SHORT_TARGETS+= mipsel # produces mips32 (not mips1) executables + +# Conditional local overrides of ROOT.* variables: +.sinclude "local-roots.mk" + +# Root of target directories. +# Must have dest/ (build.sh's DESTDIR) and tools/ subdirectories +ROOT.armv7?= /u/evbarm-armv7hf +ROOT.armv6?= /u/evbarm-armv6hf +ROOT.sparc64?= /u/sparc64 +ROOT.powerpc?= /u/macppc +ROOT.arm64?= /u/evbarm64 +ROOT.arm64_be?= /u/evbarm64eb +ROOT.i386?= /u/i386 +ROOT.mipsel?= /u/mipsel +ROOT.riscv64?= /u/riscv64 + +# Mapping to GNU triple +G_TGT.armv7= armv7--netbsdelf-eabihf +G_TGT.armv6= armv6--netbsdelf-eabihf +G_TGT.sparc64= sparc64--netbsd +G_TGT.powerpc= powerpc--netbsd +G_TGT.arm64= aarch64--netbsd +G_TGT.arm64_be= aarch64_be--netbsd +G_TGT.i386= i486--netbsdelf +G_TGT.mipsel= mipsel--netbsd +G_TGT.riscv64= riscv64--netbsd + +# Mapping to rust's TARGET specification +TGT.armv7= armv7-unknown-netbsd-eabihf +TGT.armv6= armv6-unknown-netbsd-eabihf +TGT.sparc64= sparc64-unknown-netbsd +TGT.powerpc= powerpc-unknown-netbsd +TGT.arm64= aarch64-unknown-netbsd +TGT.arm64_be= aarch64_be-unknown-netbsd +TGT.i386= i586-unknown-netbsd +TGT.mipsel= mipsel-unknown-netbsd +TGT.riscv64= riscv64gc-unknown-netbsd + +# Optional target tweak for bootstrap files +#TT.powerpc= powerpc-unknown-netbsd90 + +WRKDIR= ${.CURDIR}/work +SCRIPTS= ${WRKDIR}/scripts + +#DEBUG= echo + +# Make list of make targets +.for st in ${SHORT_TARGETS} +MTGTS+= do-${st} +.endfor + +all: ${MTGTS} + +# Define the individual build targets, used above +.for st in ${SHORT_TARGETS} +CA.${st}=--host=${TGT.${st}} +CA.${st}+=--target=${TGT.${st}} +CA.${st}+=--set=target.${TGT.${st}}.cc=${SCRIPTS}/gcc-wrap +CA.${st}+=--set=target.${TGT.${st}}.cxx=${SCRIPTS}/c++-wrap +CA.${st}+=--set=target.${TGT.${st}}.linker=${SCRIPTS}/gcc-wrap +CA.${st}+=--set=target.${TGT.${st}}.ar=${ROOT.${st}}/tools/bin/${G_TGT.${st}}-ar +do-${st}: + mkdir -p dist + @echo "=======> Cross-building rust for ${st}" + ${DEBUG} make -f Makefile clean + ${DEBUG} env \ + CROSS_ROOT=${ROOT.${st}} \ + GNU_CROSS_TARGET=${G_TGT.${st}} \ + make -f Makefile \ + ADD_CONFIGURE_ARGS="${CA.${st}}" \ + TARGET=${TGT.${st}} + if [ "${TT.${st}}" != "" ]; then \ + TT=${TT.${st}}; \ + else \ + TT=${TGT.${st}}; \ + fi; \ + distdir=${WRKDIR}/rustc-${V_NOREV}-src/build/dist; \ + for comp in rust rust-std; do \ + src=$${distdir}/$${comp}-${V_NOREV}-${TGT.${st}}.tar.xz; \ + tgt=dist/$${comp}-${VERSION}-$${TT}.tar.xz; \ + if [ ! -f "$${tgt}" ]; then \ + echo ln $${src} $${tgt}; \ + ${DEBUG} ln $${src} $${tgt}; \ + fi; \ + done; \ + src_comp=rust-src-${V_NOREV}.tar.xz; \ + if [ ! -f dist/$${src_comp} ]; then \ + echo ln $${distdir}/$${src_comp} dist; \ + ${DEBUG} ln $${distdir}/$${src_comp} dist; \ + fi +.endfor diff --git a/rust178/files/gcc-wrap b/rust178/files/gcc-wrap new file mode 100644 index 00000000000..957ebfa032f --- /dev/null +++ b/rust178/files/gcc-wrap @@ -0,0 +1,199 @@ +#! /bin/sh + +# Root of targets tools + dest directories +# or unset to default to a native build. + +# This script assumes target tools in $root/tools +# and target's destdir in $root/dest, the result of a NetBSD build.sh. +# ...or the native root, when we don't cross-compile +root=${CROSS_ROOT:-/} + +incadd="" +native=false +if [ $root = "/" ]; then + native=true +else + # What's the tools/bin prefix (if we're cross-building)? + gnuarch=${GNU_CROSS_TARGET:?} + + # A special hack for netbsd-8 targets. + # netbsd-8 has gcc 5.5, but llvm and rust needs >= 7 + # so we build tools from -9, and try to use that, but + # then the include path becomes wrong, and + # is no longer picked up automatically by the compiler + # from the target destination directory + case $gnuarch in + sparc64*) incadd="-I=/usr/include/gcc-5" + ;; + + # immintrin & from gcc-5 not + # compatible with gcc7, apparently + i[3456]86*) incadd="-I=/usr/include/gcc-7" + ;; + + # mips64 does soft-float + mips64*) madd="-msoft-float" + ;; + esac + # We build both for -8 and -9 due to ABI differences, + # so can't just test $gnuarch... Yes, a vile hack. + if [ "$root" = "/u/macppc" ]; then + incadd="-I=/usr/include/gcc-5" + fi +fi + +# Who are we a wrapper for? (Typically either gcc or c++) +who=$(basename $0 | sed -e 's/-wrap$//') + +args="" +if [ ! -z "$madd" ]; then + args="$args $madd" +fi + +# May need to add $linkadd before first -l or fist -L +linkadd="-Wl,--sysroot=${root}/dest" +# (perhaps this is overly cautious, other adjustments we do +# below may be sufficient...) +# Lib directories to ensure we search and have in run-path +libs="/lib /usr/lib /usr/pkg/lib" + +for d in $libs; do + if ! $native; then + linkadd="$linkadd -L=$d" + linkadd="$linkadd -Wl,-rpath-link=${root}/dest/$d" + fi + # Run-path is for when we execute on the target, + # so no $root prefix + linkadd="$linkadd -Wl,-rpath,$d" +done + +# ...and add a placeholder so we can tweak RPATH with chrpath, +# since chrpath can't extend the length of the run path +# (This may also not be needed, we use LD_LIBRARY_PATH instead) +placeholder="placeholder-$(date | openssl dgst -sha1 | \ + awk '{ print $2 }')" +linkadd="$linkadd -Wl,-rpath,/$placeholder" +# the / is a sneaky attempt to let it past cwrapper... + +# More debugging +linkadd="$linkadd -Wl,--verbose" + +linktweaked=false + +# Step through args, tweak where required +set -- "$@" +while [ $# -gt 0 ]; do + case "$1" in +# Insert = at the front of -isystem args. +# This is to get --sysroot prepended, so that +# we pick up the correct set of header files. +# (I thought this wasn't reqired, but apparently it is...) + -isystem) + shift + args="$args -isystem =$1" + ;; +# Also doctor -I directives of known paths and +# redirect them to the --sysroot. + -I/usr/include) + args="$args -I=/usr/include" + ;; + -I/usr/include/krb5) + args="$args -I=/usr/include/krb5" + ;; + -I/usr/pkg/include) +# Try to drop this... + if ! $native; then + args="$args -I=/usr/pkg/include" + fi + ;; + -I) + if [ $2 = "/usr/include" ]; then + args="$args -I=/usr/include" + shift + elif [ $2 = "/usr/include/krb5" ]; then + args="$args -I=/usr/include/krb5" + shift + elif [ $2 = "/usr/pkg/include" ]; then +# Try to drop this too... + if ! $native; then + args="$args -I=/usr/pkg/include" + fi + shift + else + args="$args -I" + fi + ;; + -l*) + if ! $linktweaked; then + args="$args $linkadd" + linktweaked=true + fi + args="$args $1" + ;; + -L) + if ! $linktweaked; then + args="$args $linkadd" + linktweaked=true + fi + shift + tweaked=false + # redirect these to -Wl,--sysroot + for d in /lib /usr/lib /usr/pkg/lib; do + if [ $1 = $d ]; then + args="$args -L =$d" + tweaked=true + fi + done + # Not redirected? If so we need to add + if ! $tweaked; then + args="$args -L $1" + fi + ;; + + -L/lib) + if ! $linktweaked; then + args="$args $linkadd" + linktweaked=true + fi + args="$args -L=/lib" + ;; + -L/usr/lib) + if ! $linktweaked; then + args="$args $linkadd" + linktweaked=true + fi + args="$args -L=/usr/lib" + ;; + -L/usr/pkg/lib) + if ! $linktweaked; then + args="$args $linkadd" + linktweaked=true + fi + args="$args -L=/usr/pkg/lib" + ;; + -Wl,--enable-new-dtags) + # ignore + ;; + *) + args="$args $1" + ;; + esac + shift +done + +if $native; then + # Try to avoid cwrappers, which does "undocumented magic" + # by invoking the compiler "directly". + #cmd="/usr/bin/${who} $args" + # (however, this wrapper isn't used when buliding natively...) + cmd="${who} $args" +else + cmd="${root}/tools/bin/${gnuarch}-${who} \ + --sysroot=${root}/dest \ + $incadd \ + $args" +fi + +# Cannot echo to stdout, messes up e.g. "gcc -print-prog-name=ld" output... +#echo $cmd >> /tmp/gcc-wrap.log +exec $cmd diff --git a/rust178/options.mk b/rust178/options.mk new file mode 100644 index 00000000000..9907c3dbd29 --- /dev/null +++ b/rust178/options.mk @@ -0,0 +1,76 @@ +# $NetBSD: options.mk,v 1.26 2022/07/11 20:13:50 jperkin Exp $ + +PKG_OPTIONS_VAR= PKG_OPTIONS.rust +PKG_SUPPORTED_OPTIONS+= rust-cargo-static rust-docs + +.include "../../mk/bsd.fast.prefs.mk" + +# The bundled LLVM current has issues building on SunOS. +.if ${OPSYS} != "SunOS" +PKG_SUPPORTED_OPTIONS+= rust-internal-llvm +# There may be compatibility issues with the base LLVM on e.g. NetBSD. +. if !empty(HAVE_LLVM) || ${MACHINE_PLATFORM:MDarwin-*-aarch64} +PKG_SUGGESTED_OPTIONS+= rust-internal-llvm +. endif +.endif + +# If cross-building, always use the internal LLVM +.if !empty(TARGET) +PKG_SUGGESTED_OPTIONS+= rust-internal-llvm +.endif + +# 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 +# bootstraps on NetBSD. +.if ${OPSYS} == "NetBSD" && ${BUILD_TARGET} == "dist" +PKG_SUGGESTED_OPTIONS+= rust-cargo-static +.endif + +PKG_OPTIONS_LEGACY_OPTS+= rust-llvm:rust-internal-llvm + +.include "../../mk/bsd.options.mk" + +# +# Use the internal copy of LLVM or the external one? +# +.if empty(PKG_OPTIONS:Mrust-internal-llvm) +# External LLVM must be >= 16, ref. RELEASES.md +BUILDLINK_API_DEPENDS.llvm+= llvm>=16 +.include "../../lang/libunwind/buildlink3.mk" +.include "../../lang/llvm/buildlink3.mk" +CONFIGURE_ARGS+= --enable-llvm-link-shared +CONFIGURE_ARGS+= --llvm-libunwind=system +CONFIGURE_ARGS+= --llvm-root=${BUILDLINK_PREFIX.llvm} +.endif + +# +# Link cargo statically against "native" libraries. +# (openssl and curl specifically). +# +.if !empty(PKG_OPTIONS:Mrust-cargo-static) +CONFIGURE_ARGS+= --enable-cargo-native-static +.else +BUILDLINK_API_DEPENDS.nghttp2+= nghttp2>=1.41.0 +BUILDLINK_API_DEPENDS.curl+= curl>=7.67.0 +.include "../../www/curl/buildlink3.mk" +.include "../../security/openssl/buildlink3.mk" +.endif + +# +# Install documentation. +# +.if !empty(PKG_OPTIONS:Mrust-docs) +CONFIGURE_ARGS+= --enable-docs +.else +CONFIGURE_ARGS+= --disable-docs +.endif diff --git a/rust178/patches/patch-compiler_rustc__codegen__ssa_src_back_linker.rs b/rust178/patches/patch-compiler_rustc__codegen__ssa_src_back_linker.rs new file mode 100644 index 00000000000..21e000a69a5 --- /dev/null +++ b/rust178/patches/patch-compiler_rustc__codegen__ssa_src_back_linker.rs @@ -0,0 +1,15 @@ +$NetBSD$ + +Do not use @rpath on Darwin. + +--- compiler/rustc_codegen_ssa/src/back/linker.rs.orig 2022-12-12 16:02:12.000000000 +0000 ++++ compiler/rustc_codegen_ssa/src/back/linker.rs +@@ -318,7 +318,7 @@ impl<'a> GccLinker<'a> { + // principled solution at some point to force the compiler to pass + // the right `-Wl,-install_name` with an `@rpath` in it. + if self.sess.opts.cg.rpath || self.sess.opts.unstable_opts.osx_rpath_install_name { +- let mut rpath = OsString::from("@rpath/"); ++ let mut rpath = OsString::from("@PREFIX@/lib/"); + rpath.push(out_filename.file_name().unwrap()); + self.linker_args(&[OsString::from("-install_name"), rpath]); + } diff --git a/rust178/patches/patch-compiler_rustc__llvm_build.rs b/rust178/patches/patch-compiler_rustc__llvm_build.rs new file mode 100644 index 00000000000..b000456d6d5 --- /dev/null +++ b/rust178/patches/patch-compiler_rustc__llvm_build.rs @@ -0,0 +1,50 @@ +$NetBSD$ + +Fix build on NetBSD HEAD-llvm. XXX there is probably a better way to do this. + +Pick up -latomic tweak from +https://github.com/rust-lang/rust/issues/104220 +and +https://github.com/rust-lang/rust/pull/104572 + +--- compiler/rustc_llvm/build.rs.orig 2023-10-03 02:52:17.000000000 +0000 ++++ compiler/rustc_llvm/build.rs +@@ -249,6 +249,10 @@ fn main() { + { + // 32-bit targets need to link libatomic. + println!("cargo:rustc-link-lib=atomic"); ++ if target.contains("netbsd") ++ { ++ println!("cargo:rustc-link-lib=z"); ++ } + } else if target.contains("windows-gnu") { + println!("cargo:rustc-link-lib=shell32"); + println!("cargo:rustc-link-lib=uuid"); +@@ -261,7 +265,11 @@ fn main() { + // On NetBSD/i386, gcc and g++ is built for i486 (to maximize backward compat) + // However, LLVM insists on using 64-bit atomics. + // This gives rise to a need to link rust itself with -latomic for these targets +- if target.starts_with("i586") || target.starts_with("i686") { ++ if target.starts_with("i386") ++ || target.starts_with("i486") ++ || target.starts_with("i586") ++ || target.starts_with("i686") ++ { + println!("cargo:rustc-link-lib=atomic"); + } + println!("cargo:rustc-link-lib=z"); +@@ -352,7 +360,13 @@ fn main() { + "c++" + } else if target.contains("netbsd") && llvm_static_stdcpp.is_some() { + // NetBSD uses a separate library when relocation is required +- "stdc++_p" ++ if env::var_os("PKGSRC_HAVE_LIBCPP").is_some() { ++ "c++_pic" ++ } else { ++ "stdc++_pic" ++ } ++ } else if env::var_os("PKGSRC_HAVE_LIBCPP").is_some() { ++ "c++" + } else if llvm_use_libcxx.is_some() { + "c++" + } else { diff --git a/rust178/patches/patch-compiler_rustc__target_src_spec_base_netbsd.rs b/rust178/patches/patch-compiler_rustc__target_src_spec_base_netbsd.rs new file mode 100644 index 00000000000..c1ed446d2f0 --- /dev/null +++ b/rust178/patches/patch-compiler_rustc__target_src_spec_base_netbsd.rs @@ -0,0 +1,32 @@ +$NetBSD$ + +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, + has_thread_local: true, diff --git a/rust178/patches/patch-compiler_rustc__target_src_spec_mod.rs b/rust178/patches/patch-compiler_rustc__target_src_spec_mod.rs new file mode 100644 index 00000000000..324f6c804d3 --- /dev/null +++ b/rust178/patches/patch-compiler_rustc__target_src_spec_mod.rs @@ -0,0 +1,14 @@ +$NetBSD$ + +Add entry for NetBSD/mips64el. + +--- compiler/rustc_target/src/spec/mod.rs.orig 2024-01-13 14:20:59.236278792 +0000 ++++ compiler/rustc_target/src/spec/mod.rs +@@ -1532,6 +1532,7 @@ supported_targets! { + ("armv7-unknown-netbsd-eabihf", armv7_unknown_netbsd_eabihf), + ("i586-unknown-netbsd", i586_unknown_netbsd), + ("i686-unknown-netbsd", i686_unknown_netbsd), ++ ("mips64el-unknown-netbsd", mips64el_unknown_netbsd), + ("mipsel-unknown-netbsd", mipsel_unknown_netbsd), + ("powerpc-unknown-netbsd", powerpc_unknown_netbsd), + ("riscv64gc-unknown-netbsd", riscv64gc_unknown_netbsd), diff --git a/rust178/patches/patch-compiler_rustc__target_src_spec_targets_mips64el__unknown__netbsd.rs b/rust178/patches/patch-compiler_rustc__target_src_spec_targets_mips64el__unknown__netbsd.rs new file mode 100644 index 00000000000..e4ff43501d1 --- /dev/null +++ b/rust178/patches/patch-compiler_rustc__target_src_spec_targets_mips64el__unknown__netbsd.rs @@ -0,0 +1,35 @@ +$NetBSD$ + +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,28 @@ ++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(), ++ metadata: crate::spec::TargetMetadata { ++ description: None, ++ tier: None, ++ host_tools: None, ++ std: None, ++ }, ++ 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 ++ }, ++ } ++} diff --git a/rust178/patches/patch-library_backtrace_src_symbolize_gimli.rs b/rust178/patches/patch-library_backtrace_src_symbolize_gimli.rs new file mode 100644 index 00000000000..0ed9af78224 --- /dev/null +++ b/rust178/patches/patch-library_backtrace_src_symbolize_gimli.rs @@ -0,0 +1,14 @@ +$NetBSD$ + +Add NetBSD to the family who is in the unix class. + +--- library/backtrace/src/symbolize/gimli.rs.orig 2022-04-04 09:41:26.000000000 +0000 ++++ library/backtrace/src/symbolize/gimli.rs +@@ -38,6 +38,7 @@ cfg_if::cfg_if! { + target_os = "ios", + target_os = "linux", + target_os = "macos", ++ target_os = "netbsd", + target_os = "openbsd", + target_os = "solaris", + target_os = "illumos", diff --git a/rust178/patches/patch-library_backtrace_src_symbolize_gimli_elf.rs b/rust178/patches/patch-library_backtrace_src_symbolize_gimli_elf.rs new file mode 100644 index 00000000000..c8ee9229206 --- /dev/null +++ b/rust178/patches/patch-library_backtrace_src_symbolize_gimli_elf.rs @@ -0,0 +1,25 @@ +$NetBSD$ + +Make NetBSD also find its debug libraries, if present. + +--- library/backtrace/src/symbolize/gimli/elf.rs.orig 2022-04-04 09:41:26.000000000 +0000 ++++ library/backtrace/src/symbolize/gimli/elf.rs +@@ -304,11 +304,17 @@ fn decompress_zlib(input: &[u8], output: + } + } + ++#[cfg(target_os = "netbsd")] ++const DEBUG_PATH: &[u8] = b"/usr/libdata/debug"; ++#[cfg(not(target_os = "netbsd"))] + const DEBUG_PATH: &[u8] = b"/usr/lib/debug"; + + fn debug_path_exists() -> bool { + cfg_if::cfg_if! { +- if #[cfg(any(target_os = "freebsd", target_os = "hurd", target_os = "linux"))] { ++ if #[cfg(any(target_os = "freebsd", ++ target_os = "netbsd", ++ target_os = "hurd", ++ target_os = "linux"))] { + use core::sync::atomic::{AtomicU8, Ordering}; + static DEBUG_PATH_EXISTS: AtomicU8 = AtomicU8::new(0); + diff --git a/rust178/patches/patch-library_std_src_sys_pal_unix_mod.rs b/rust178/patches/patch-library_std_src_sys_pal_unix_mod.rs new file mode 100644 index 00000000000..403ccd725e7 --- /dev/null +++ b/rust178/patches/patch-library_std_src_sys_pal_unix_mod.rs @@ -0,0 +1,14 @@ +$NetBSD$ + +Add libexecinfo for backtrace() on NetBSD. + +--- library/std/src/sys/pal/unix/mod.rs.orig 2024-03-22 12:47:54.470537834 +0000 ++++ library/std/src/sys/pal/unix/mod.rs +@@ -384,6 +384,7 @@ cfg_if::cfg_if! { + #[link(name = "pthread")] + extern "C" {} + } else if #[cfg(target_os = "netbsd")] { ++ #[link(name = "execinfo")] + #[link(name = "pthread")] + #[link(name = "rt")] + extern "C" {} diff --git a/rust178/patches/patch-library_std_src_sys_pal_unix_thread.rs b/rust178/patches/patch-library_std_src_sys_pal_unix_thread.rs new file mode 100644 index 00000000000..1756e361fff --- /dev/null +++ b/rust178/patches/patch-library_std_src_sys_pal_unix_thread.rs @@ -0,0 +1,26 @@ +$NetBSD$ + +Fix stack-clash on SunOS. + +...and fix the "count CPUs in affinity set" to work on i32 NetBSD ports. + +--- library/std/src/sys/pal/unix/thread.rs.orig 2024-03-17 19:03:00.000000000 +0000 ++++ library/std/src/sys/pal/unix/thread.rs +@@ -388,7 +388,7 @@ pub fn available_parallelism() -> io::Re + if !set.is_null() { + let mut count: usize = 0; + if libc::pthread_getaffinity_np(libc::pthread_self(), libc::_cpuset_size(set), set) == 0 { +- for i in 0..u64::MAX { ++ for i in 0..libc::cpuid_t::MAX { + match libc::_cpuset_isset(i, set) { + -1 => break, + 0 => continue, +@@ -819,7 +819,7 @@ pub mod guard { + let page_size = os::page_size(); + PAGE_SIZE.store(page_size, Ordering::Relaxed); + +- if cfg!(all(target_os = "linux", not(target_env = "musl"))) { ++ if cfg!(all(target_os = "solaris", all(target_os = "linux", not(target_env = "musl")))) { + // Linux doesn't allocate the whole stack right away, and + // the kernel has its own stack-guard mechanism to fault + // when growing too close to an existing mapping. If we map diff --git a/rust178/patches/patch-library_std_src_sys_pal_unix_thread__parking_netbsd.rs b/rust178/patches/patch-library_std_src_sys_pal_unix_thread__parking_netbsd.rs new file mode 100644 index 00000000000..76757ba9829 --- /dev/null +++ b/rust178/patches/patch-library_std_src_sys_pal_unix_thread__parking_netbsd.rs @@ -0,0 +1,34 @@ +$NetBSD$ + +Try to cast to make this build, to avoid + +error[E0277]: the trait bound `i32: core::convert::From` is not satisfied + --> library/std/src/sys/unix/thread_parking/netbsd.rs:37:37 + | +37 | tv_nsec: dur.subsec_nanos().into(), + | ^^^^ the trait `core::convert::From` is not implemented for `i32` + | + = help: the following other types implement trait `core::convert::From`: + > + > + > + > + > + > + = note: required for `u32` to implement `core::convert::Into` + +For more information about this error, try `rustc --explain E0277`. + +This to un-break the 32-bit ports ... again. + +--- library/std/src/sys/pal/unix/thread_parking/netbsd.rs.orig 2024-03-22 14:07:26.254534488 +0000 ++++ library/std/src/sys/pal/unix/thread_parking/netbsd.rs +@@ -34,7 +34,7 @@ pub fn park_timeout(dur: Duration, hint: + // Saturate so that the operation will definitely time out + // (even if it is after the heat death of the universe). + tv_sec: dur.as_secs().try_into().ok().unwrap_or(time_t::MAX), +- tv_nsec: dur.subsec_nanos().into(), ++ tv_nsec: (dur.subsec_nanos() as libc::c_long).into(), + }; + + // Timeout needs to be mutable since it is modified on NetBSD 9.0 and diff --git a/rust178/patches/patch-src_bootstrap_bootstrap.py b/rust178/patches/patch-src_bootstrap_bootstrap.py new file mode 100644 index 00000000000..20489b8ae1e --- /dev/null +++ b/rust178/patches/patch-src_bootstrap_bootstrap.py @@ -0,0 +1,47 @@ +$NetBSD: patch-src_bootstrap_bootstrap.py,v 1.4 2020/02/17 20:24:18 jperkin Exp $ + +Use `uname -p` on NetBSD, as that is reliable and sensible there. +Handle earmv[67]hf for NetBSD. +Also use @PREFIX@ and not $ORIGIN in rpath. + +--- src/bootstrap/bootstrap.py.orig 2023-07-12 03:32:40.000000000 +0000 ++++ src/bootstrap/bootstrap.py +@@ -271,6 +271,11 @@ def default_build_triple(verbose): + 'GNU': 'unknown-hurd', + } + ++ # For NetBSD, use `uname -p`, as there it is reliable & sensible ++ if kernel == 'NetBSD': ++ cputype = subprocess.check_output( ++ ['uname', '-p']).strip().decode(default_encoding) ++ + # Consider the direct transformation first and then the special cases + if kernel in kerneltype_mapper: + kernel = kerneltype_mapper[kernel] +@@ -374,10 +379,16 @@ def default_build_triple(verbose): + kernel = 'linux-androideabi' + else: + kernel += 'eabihf' +- elif cputype in {'armv7l', 'armv8l'}: ++ elif cputype in {'armv6hf', 'earmv6hf'}: ++ cputype = 'armv6' ++ if kernel == 'unknown-netbsd': ++ kernel += '-eabihf' ++ elif cputype in {'armv7l', 'earmv7hf', 'armv8l'}: + cputype = 'armv7' + if kernel == 'linux-android': + kernel = 'linux-androideabi' ++ elif kernel == 'unknown-netbsd': ++ kernel += '-eabihf' + else: + kernel += 'eabihf' + elif cputype == 'mips': +@@ -735,7 +746,7 @@ class RustBuild(object): + rpath_entries = [ + # Relative default, all binary and dynamic libraries we ship + # appear to have this (even when `../lib` is redundant). +- "$ORIGIN/../lib", ++ "@PREFIX@/lib", + os.path.join(os.path.realpath(nix_deps_dir), "lib") + ] + patchelf_args = ["--set-rpath", ":".join(rpath_entries)] diff --git a/rust178/patches/patch-src_bootstrap_src_core_build__steps_compile.rs b/rust178/patches/patch-src_bootstrap_src_core_build__steps_compile.rs new file mode 100644 index 00000000000..a14e2a2bd84 --- /dev/null +++ b/rust178/patches/patch-src_bootstrap_src_core_build__steps_compile.rs @@ -0,0 +1,15 @@ +$NetBSD$ + +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); diff --git a/rust178/patches/patch-src_bootstrap_src_core_builder.rs b/rust178/patches/patch-src_bootstrap_src_core_builder.rs new file mode 100644 index 00000000000..f96f1e470c1 --- /dev/null +++ b/rust178/patches/patch-src_bootstrap_src_core_builder.rs @@ -0,0 +1,15 @@ +$NetBSD$ + +Use @PREFIX@, not $ORIGIN in rpath. + +--- src/bootstrap/src/core/builder.rs.orig 2024-02-04 13:18:05.000000000 +0000 ++++ src/bootstrap/src/core/builder.rs +@@ -2416,7 +2416,7 @@ impl Cargo { + Some(format!("-Wl,-rpath,@loader_path/../{libdir}")) + } else if !target.is_windows() && !target.contains("aix") && !target.contains("xous") { + self.rustflags.arg("-Clink-args=-Wl,-z,origin"); +- Some(format!("-Wl,-rpath,$ORIGIN/../{libdir}")) ++ Some(format!("-Wl,-rpath,@PREFIX@/{libdir}")) + } else { + None + }; diff --git a/rust178/patches/patch-src_bootstrap_src_lib.rs b/rust178/patches/patch-src_bootstrap_src_lib.rs new file mode 100644 index 00000000000..6eae1d06dfe --- /dev/null +++ b/rust178/patches/patch-src_bootstrap_src_lib.rs @@ -0,0 +1,23 @@ +$NetBSD$ + +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::>(); + + // 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()); + } + diff --git a/rust178/patches/patch-src_llvm-project_llvm_CMakeLists.txt b/rust178/patches/patch-src_llvm-project_llvm_CMakeLists.txt new file mode 100644 index 00000000000..2477a555c8e --- /dev/null +++ b/rust178/patches/patch-src_llvm-project_llvm_CMakeLists.txt @@ -0,0 +1,18 @@ +$NetBSD: patch-src_llvm-project_llvm_CMakeLists.txt,v 1.1 2019/04/14 12:42:03 he Exp $ + +Don't implement sys/regset.h workaround, fix source instead. + +--- src/llvm-project/llvm/CMakeLists.txt.orig 2018-03-10 02:51:13.000000000 +0000 ++++ src/llvm-project/llvm/CMakeLists.txt +@@ -939,11 +939,6 @@ if(LLVM_TARGET_IS_CROSSCOMPILE_HOST) + # (this is a variable that CrossCompile sets on recursive invocations) + endif() + +-if( ${CMAKE_SYSTEM_NAME} MATCHES SunOS ) +- # special hack for Solaris to handle crazy system sys/regset.h +- include_directories("${LLVM_MAIN_INCLUDE_DIR}/llvm/Support/Solaris") +-endif( ${CMAKE_SYSTEM_NAME} MATCHES SunOS ) +- + # Make sure we don't get -rdynamic in every binary. For those that need it, + # use export_executable_symbols(target). + set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS "") diff --git a/rust178/patches/patch-src_llvm-project_llvm_cmake_modules_AddLLVM.cmake b/rust178/patches/patch-src_llvm-project_llvm_cmake_modules_AddLLVM.cmake new file mode 100644 index 00000000000..b213c403640 --- /dev/null +++ b/rust178/patches/patch-src_llvm-project_llvm_cmake_modules_AddLLVM.cmake @@ -0,0 +1,49 @@ +$NetBSD: patch-src_llvm-project_llvm_cmake_modules_AddLLVM.cmake,v 1.3 2020/08/06 11:42:56 jperkin Exp $ + +On Darwin, use correct install-name for shared libraries. + +Undo some of the RPATH magic so that cross-building +works inside pkgsrc again (indirectly eliminates $ORIGIN rpath +handling / editing, $ORIGIN handling is partially undone by cwrappers +in pkgsrc). + +--- src/llvm-project/llvm/cmake/modules/AddLLVM.cmake.orig 2023-07-12 03:33:01.000000000 +0000 ++++ src/llvm-project/llvm/cmake/modules/AddLLVM.cmake +@@ -2311,7 +2311,7 @@ function(llvm_setup_rpath name) + endif() + + if (APPLE) +- set(_install_name_dir INSTALL_NAME_DIR "@rpath") ++ set(_install_name_dir INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib") + set(_install_rpath "@loader_path/../lib${LLVM_LIBDIR_SUFFIX}" ${extra_libdir}) + elseif(${CMAKE_SYSTEM_NAME} MATCHES "AIX" AND BUILD_SHARED_LIBS) + # $ORIGIN is not interpreted at link time by aix ld. +@@ -2320,8 +2320,7 @@ function(llvm_setup_rpath name) + # FIXME: update this when there is better solution. + set(_install_rpath "${LLVM_LIBRARY_OUTPUT_INTDIR}" "${CMAKE_INSTALL_PREFIX}/lib${LLVM_LIBDIR_SUFFIX}" ${extra_libdir}) + elseif(UNIX) +- set(_build_rpath "\$ORIGIN/../lib${LLVM_LIBDIR_SUFFIX}" ${extra_libdir}) +- set(_install_rpath "\$ORIGIN/../lib${LLVM_LIBDIR_SUFFIX}") ++ set(_install_rpath "\$ORIGIN/../lib${LLVM_LIBDIR_SUFFIX}" ${extra_libdir}) + if(${CMAKE_SYSTEM_NAME} MATCHES "(FreeBSD|DragonFly)") + set_property(TARGET ${name} APPEND_STRING PROPERTY + LINK_FLAGS " -Wl,-z,origin ") +@@ -2335,16 +2334,9 @@ function(llvm_setup_rpath name) + return() + endif() + +- # Enable BUILD_WITH_INSTALL_RPATH unless CMAKE_BUILD_RPATH is set and not +- # building for macOS or AIX, as those platforms seemingly require it. +- # On AIX, the tool chain doesn't support modifying rpaths/libpaths for XCOFF +- # on install at the moment, so BUILD_WITH_INSTALL_RPATH is required. ++ # Enable BUILD_WITH_INSTALL_RPATH unless CMAKE_BUILD_RPATH is set. + if("${CMAKE_BUILD_RPATH}" STREQUAL "") +- if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin|AIX") +- set_property(TARGET ${name} PROPERTY BUILD_WITH_INSTALL_RPATH ON) +- else() +- set_property(TARGET ${name} APPEND PROPERTY BUILD_RPATH "${_build_rpath}") +- endif() ++ set_property(TARGET ${name} PROPERTY BUILD_WITH_INSTALL_RPATH ON) + endif() + + set_target_properties(${name} PROPERTIES diff --git a/rust178/patches/patch-src_llvm-project_llvm_include_llvm-c_DataTypes.h b/rust178/patches/patch-src_llvm-project_llvm_include_llvm-c_DataTypes.h new file mode 100644 index 00000000000..7250a1f1499 --- /dev/null +++ b/rust178/patches/patch-src_llvm-project_llvm_include_llvm-c_DataTypes.h @@ -0,0 +1,34 @@ +$NetBSD: patch-src_llvm-project_llvm_include_llvm-c_DataTypes.h,v 1.1 2019/04/14 12:42:03 he Exp $ + +Don't implement sys/regset.h workaround, fix source instead. + +--- src/llvm-project/llvm/include/llvm-c/DataTypes.h.orig 2021-04-17 01:50:37.000000000 +0000 ++++ src/llvm-project/llvm/include/llvm-c/DataTypes.h +@@ -77,4 +77,27 @@ typedef signed int ssize_t; + # define UINT64_MAX 0xffffffffffffffffULL + #endif + ++#if defined(__sun) ++#include ++#undef CS ++#undef DS ++#undef ES ++#undef FS ++#undef GS ++#undef SS ++#undef EAX ++#undef ECX ++#undef EDX ++#undef EBX ++#undef ESP ++#undef EBP ++#undef ESI ++#undef EDI ++#undef EIP ++#undef UESP ++#undef EFL ++#undef ERR ++#undef TRAPNO ++#endif ++ + #endif /* LLVM_C_DATATYPES_H */ diff --git a/rust178/patches/patch-src_llvm-project_llvm_include_llvm_Analysis_ConstantFolding.h b/rust178/patches/patch-src_llvm-project_llvm_include_llvm_Analysis_ConstantFolding.h new file mode 100644 index 00000000000..37d491478d9 --- /dev/null +++ b/rust178/patches/patch-src_llvm-project_llvm_include_llvm_Analysis_ConstantFolding.h @@ -0,0 +1,17 @@ +$NetBSD: patch-src_llvm-project_llvm_include_llvm_Analysis_ConstantFolding.h,v 1.1 2019/04/14 12:42:03 he Exp $ + +Fix SunOS CS conflict not handled by include/llvm-c/DataTypes.h + +--- src/llvm-project/llvm/include/llvm/Analysis/ConstantFolding.h.orig 2018-08-01 16:32:37.000000000 +0000 ++++ src/llvm-project/llvm/include/llvm/Analysis/ConstantFolding.h +@@ -19,6 +19,10 @@ + #ifndef LLVM_ANALYSIS_CONSTANTFOLDING_H + #define LLVM_ANALYSIS_CONSTANTFOLDING_H + ++#ifdef __sun ++#undef CS ++#endif ++ + #include + + namespace llvm { diff --git a/rust178/patches/patch-src_llvm-project_llvm_utils_FileCheck_FileCheck.cpp b/rust178/patches/patch-src_llvm-project_llvm_utils_FileCheck_FileCheck.cpp new file mode 100644 index 00000000000..02c93ff2ecb --- /dev/null +++ b/rust178/patches/patch-src_llvm-project_llvm_utils_FileCheck_FileCheck.cpp @@ -0,0 +1,15 @@ +$NetBSD: patch-src_llvm-project_llvm_utils_FileCheck_FileCheck.cpp,v 1.2 2019/10/02 12:51:43 he Exp $ + +Avoid ambiguous function call. + +--- src/llvm-project/llvm/utils/FileCheck/FileCheck.cpp.orig 2019-02-12 15:22:48.000000000 +0000 ++++ src/llvm-project/llvm/utils/FileCheck/FileCheck.cpp +@@ -592,7 +592,7 @@ static void DumpAnnotatedInput(raw_ostre + unsigned LineCount = InputFileText.count('\n'); + if (InputFileEnd[-1] != '\n') + ++LineCount; +- unsigned LineNoWidth = std::log10(LineCount) + 1; ++ unsigned LineNoWidth = std::log10((float)LineCount) + 1; + // +3 below adds spaces (1) to the left of the (right-aligned) line numbers + // on input lines and (2) to the right of the (left-aligned) labels on + // annotation lines so that input lines and annotation lines are more diff --git a/rust178/patches/patch-src_tools_cargo_src_cargo_core_profiles.rs b/rust178/patches/patch-src_tools_cargo_src_cargo_core_profiles.rs new file mode 100644 index 00000000000..ac9ad7239c3 --- /dev/null +++ b/rust178/patches/patch-src_tools_cargo_src_cargo_core_profiles.rs @@ -0,0 +1,17 @@ +$NetBSD: patch-src_tools_cargo_src_cargo_core_profiles.rs,v 1.3 2019/03/07 20:19:11 jperkin Exp $ + +Turn off incremental builds for sparc64, ref. +https://sources.debian.org/patches/cargo/0.29.0-1/2007_sparc64_disable_incremental_build.patch/ + +--- src/tools/cargo/src/cargo/core/profiles.rs.orig 2023-07-12 03:33:05.000000000 +0000 ++++ src/tools/cargo/src/cargo/core/profiles.rs +@@ -681,6 +681,9 @@ impl Profile { + debuginfo: DebugInfo::Resolved(TomlDebugInfo::Full), + debug_assertions: true, + overflow_checks: true, ++ #[cfg(target_arch = "sparc64")] ++ incremental: false, ++ #[cfg(not(target_arch = "sparc64"))] + incremental: true, + ..Profile::default() + } diff --git a/rust178/patches/patch-src_tools_cargo_tests_testsuite_build.rs b/rust178/patches/patch-src_tools_cargo_tests_testsuite_build.rs new file mode 100644 index 00000000000..7ffba0f965e --- /dev/null +++ b/rust178/patches/patch-src_tools_cargo_tests_testsuite_build.rs @@ -0,0 +1,31 @@ +$NetBSD: patch-src_tools_cargo_tests_testsuite_build.rs,v 1.5 2019/08/29 14:09:57 he Exp $ + +Don't attempt incremental operations on sparc64, ref. +https://sources.debian.org/patches/cargo/0.29.0-1/2007_sparc64_disable_incremental_build.patch/ + +--- src/tools/cargo/tests/testsuite/build.rs.orig 2019-08-13 06:27:40.000000000 +0000 ++++ src/tools/cargo/tests/testsuite/build.rs +@@ -47,6 +47,7 @@ fn cargo_fail_with_no_stderr() { + + /// Checks that the `CARGO_INCREMENTAL` environment variable results in + /// `rustc` getting `-C incremental` passed to it. ++#[cfg(not(target_arch = "sparc64"))] + #[cargo_test] + fn cargo_compile_incremental() { + let p = project() +@@ -69,6 +70,7 @@ fn cargo_compile_incremental() { + .run(); + } + ++#[cfg(not(target_arch = "sparc64"))] + #[cargo_test] + fn incremental_profile() { + let p = project() +@@ -111,6 +113,7 @@ fn incremental_profile() { + .run(); + } + ++#[cfg(not(target_arch = "sparc64"))] + #[cargo_test] + fn incremental_config() { + let p = project() diff --git a/rust178/patches/patch-src_tools_rust-installer_install-template.sh b/rust178/patches/patch-src_tools_rust-installer_install-template.sh new file mode 100644 index 00000000000..d4036445dec --- /dev/null +++ b/rust178/patches/patch-src_tools_rust-installer_install-template.sh @@ -0,0 +1,179 @@ +$NetBSD: patch-src_tools_rust-installer_install-template.sh,v 1.5 2021/06/09 13:42:30 adam Exp $ + +No logging to 'install.log'. +Do not create 'uninstall.sh'. +Do not make file backups (filename.old), so these will not end up in the final package. + +Rewrite to not use a whole lot of subprocesses just for doing +pattern matching and substitution in the install phase using "grep" +and "sed" when shell builtin "case" and "omit shortest match" ops +should do just fine. + +--- src/tools/rust-installer/install-template.sh.orig 2023-12-21 16:55:28.000000000 +0000 ++++ src/tools/rust-installer/install-template.sh +@@ -6,20 +6,12 @@ set -u + init_logging() { + local _abs_libdir="$1" + local _logfile="$_abs_libdir/$TEMPLATE_REL_MANIFEST_DIR/install.log" +- rm -f "$_logfile" +- need_ok "failed to remove old installation log" +- touch "$_logfile" +- need_ok "failed to create installation log" + LOGFILE="$_logfile" + } + + log_line() { + local _line="$1" + +- if [ -n "${LOGFILE-}" -a -e "${LOGFILE-}" ]; then +- echo "$_line" >> "$LOGFILE" +- # Ignore errors, which may happen e.g. after the manifest dir is deleted +- fi + } + + msg() { +@@ -433,8 +425,8 @@ uninstall_components() { + local _directive + while read _directive; do + +- local _command=`echo $_directive | cut -f1 -d:` +- local _file=`echo $_directive | cut -f2 -d:` ++ local _command=${_directive%%:*} ++ local _file=${_directive#*:} + + # Sanity checks + if [ ! -n "$_command" ]; then critical_err "malformed installation directive"; fi +@@ -541,8 +533,8 @@ install_components() { + local _directive + while read _directive; do + +- local _command=`echo $_directive | cut -f1 -d:` +- local _file=`echo $_directive | cut -f2 -d:` ++ local _command=${_directive%%:*} ++ local _file=${_directive#*:} + + # Sanity checks + if [ ! -n "$_command" ]; then critical_err "malformed installation directive"; fi +@@ -551,36 +543,24 @@ install_components() { + # Decide the destination of the file + local _file_install_path="$_dest_prefix/$_file" + +- if echo "$_file" | grep "^etc/" > /dev/null +- then +- local _f="$(echo "$_file" | sed 's/^etc\///')" +- _file_install_path="$CFG_SYSCONFDIR/$_f" +- fi +- +- if echo "$_file" | grep "^bin/" > /dev/null +- then +- local _f="$(echo "$_file" | sed 's/^bin\///')" +- _file_install_path="$CFG_BINDIR/$_f" +- fi +- +- if echo "$_file" | grep "^lib/" > /dev/null +- then +- local _f="$(echo "$_file" | sed 's/^lib\///')" +- _file_install_path="$CFG_LIBDIR/$_f" +- fi +- +- if echo "$_file" | grep "^share" > /dev/null +- then +- local _f="$(echo "$_file" | sed 's/^share\///')" +- _file_install_path="$CFG_DATADIR/$_f" +- fi +- +- if echo "$_file" | grep "^share/man/" > /dev/null +- then +- local _f="$(echo "$_file" | sed 's/^share\/man\///')" +- _file_install_path="$CFG_MANDIR/$_f" +- fi +- ++ case "$_file" in ++ etc/*) ++ local _f=${_file#"etc/"} ++ _file_install_path="$CFG_DESTDIR_PREFIX/share/doc/cargo/$_f" ++ ;; ++ bin/*) ++ local _f=${_file#"bin/"} ++ _file_install_path="$CFG_BINDIR/$_f" ++ ;; ++ lib/*) ++ local _f=${_file#"lib/"} ++ _file_install_path="$CFG_LIBDIR/$_f" ++ ;; ++ share/man/*) ++ local _f=${_file#"share/man/"} ++ _file_install_path="$CFG_MANDIR/$_f" ++ ;; ++ share/doc/*) + # HACK: Try to support overriding --docdir. Paths with the form + # "share/doc/$product/" can be redirected to a single --docdir + # path. If the following detects that --docdir has been specified +@@ -591,14 +571,17 @@ install_components() { + # contents of those directories are _not_ disjoint. Since this feature + # is almost entirely to support 'make install' anyway I don't expect + # this problem to be a big deal in practice. +- if [ "$CFG_DOCDIR" != "" ] +- then +- if echo "$_file" | grep "^share/doc/" > /dev/null +- then +- local _f="$(echo "$_file" | sed 's/^share\/doc\/[^/]*\///')" +- _file_install_path="$CFG_DOCDIR/$_f" +- fi +- fi ++ if [ "$CFG_DOCDIR" != "" ]; then ++ local _f=${_file#"share/doc/"*/} ++ _file_install_path="$CFG_DOCDIR/$_f" ++ fi ++ ;; ++ share/*) ++ local _f=${_file#"share/"} ++ _file_install_path="$CFG_DATADIR/$_f" ++ ;; ++ esac ++ + + # Make sure there's a directory for it + make_dir_recursive "$(dirname "$_file_install_path")" +@@ -615,16 +598,16 @@ install_components() { + + verbose_msg "copying file $_file_install_path" + +- maybe_backup_path "$_file_install_path" +- +- if echo "$_file" | grep "^bin/" > /dev/null || test -x "$_src_dir/$_component/$_file" +- then +- run cp "$_src_dir/$_component/$_file" "$_file_install_path" +- run chmod 755 "$_file_install_path" +- else ++ local mode=644 ++ if test -x "$_src_dir/$_component/$_file"; then ++ mode=755 ++ fi ++ case "$_file" in ++ bin/*) mode=755 ++ ;; ++ esac + run cp "$_src_dir/$_component/$_file" "$_file_install_path" +- run chmod 644 "$_file_install_path" +- fi ++ run chmod $mode "$_file_install_path" + critical_need_ok "file creation failed" + + # Update the manifest +@@ -637,7 +620,6 @@ install_components() { + + verbose_msg "copying directory $_file_install_path" + +- maybe_backup_path "$_file_install_path" + + run cp -R "$_src_dir/$_component/$_file" "$_file_install_path" + critical_need_ok "failed to copy directory" +@@ -986,7 +968,6 @@ write_to_file "$TEMPLATE_RUST_INSTALLER_ + critical_need_ok "failed to write installer version" + + # Install the uninstaller +-install_uninstaller "$src_dir" "$src_basename" "$abs_libdir" + + # Install each component + install_components "$src_dir" "$abs_libdir" "$dest_prefix" "$components" diff --git a/rust178/patches/patch-vendor_aho-corasick_src_packed_teddy_builder.rs b/rust178/patches/patch-vendor_aho-corasick_src_packed_teddy_builder.rs new file mode 100644 index 00000000000..53070c8c9d7 --- /dev/null +++ b/rust178/patches/patch-vendor_aho-corasick_src_packed_teddy_builder.rs @@ -0,0 +1,31 @@ +$NetBSD$ + +--- vendor/aho-corasick/src/packed/teddy/builder.rs.orig 2024-02-18 10:54:27.960401196 +0000 ++++ vendor/aho-corasick/src/packed/teddy/builder.rs +@@ -230,7 +230,7 @@ impl Builder { + } + } + } +- #[cfg(target_arch = "aarch64")] ++ #[cfg(all(target_arch = "aarch64", target_feature = "neon", target_endian = "little"))] + { + use self::aarch64::SlimNeon; + +@@ -301,7 +301,7 @@ impl Builder { + } + #[cfg(not(any( + all(target_arch = "x86_64", target_feature = "sse2"), +- target_arch = "aarch64" ++ all(target_arch = "aarch64", target_feature = "neon", target_endian = "little") + )))] + { + None +@@ -705,7 +705,7 @@ mod x86_64 { + } + } + +-#[cfg(target_arch = "aarch64")] ++#[cfg(all(target_arch = "aarch64", target_feature = "neon", target_endian = "little"))] + mod aarch64 { + use core::arch::aarch64::uint8x16_t; + diff --git a/rust178/patches/patch-vendor_aho-corasick_src_packed_vector.rs b/rust178/patches/patch-vendor_aho-corasick_src_packed_vector.rs new file mode 100644 index 00000000000..a5ba47a39b0 --- /dev/null +++ b/rust178/patches/patch-vendor_aho-corasick_src_packed_vector.rs @@ -0,0 +1,13 @@ +$NetBSD$ + +--- vendor/aho-corasick/src/packed/vector.rs.orig 2024-02-18 10:12:16.371081231 +0000 ++++ vendor/aho-corasick/src/packed/vector.rs +@@ -595,7 +595,7 @@ mod x86_64_avx2 { + } + } + +-#[cfg(target_arch = "aarch64")] ++#[cfg(all(target_arch = "aarch64", target_feature = "neon", target_endian = "little"))] + mod aarch64_neon { + use core::arch::aarch64::*; + diff --git a/rust178/patches/patch-vendor_backtrace_src_symbolize_gimli.rs b/rust178/patches/patch-vendor_backtrace_src_symbolize_gimli.rs new file mode 100644 index 00000000000..367e90786a7 --- /dev/null +++ b/rust178/patches/patch-vendor_backtrace_src_symbolize_gimli.rs @@ -0,0 +1,14 @@ +$NetBSD$ + +Do mmap on NetBSD as well. + +--- ./vendor/backtrace/src/symbolize/gimli.rs.orig 2022-04-04 11:10:55.000000000 +0000 ++++ ./vendor/backtrace/src/symbolize/gimli.rs +@@ -38,6 +38,7 @@ cfg_if::cfg_if! { + target_os = "ios", + target_os = "linux", + target_os = "macos", ++ target_os = "netbsd", + target_os = "openbsd", + target_os = "solaris", + target_os = "illumos", diff --git a/rust178/patches/patch-vendor_backtrace_src_symbolize_gimli_elf.rs b/rust178/patches/patch-vendor_backtrace_src_symbolize_gimli_elf.rs new file mode 100644 index 00000000000..ad3afcd8d1c --- /dev/null +++ b/rust178/patches/patch-vendor_backtrace_src_symbolize_gimli_elf.rs @@ -0,0 +1,24 @@ +$NetBSD$ + +Make NetBSD also find its debug libraries, if present. + +--- vendor/backtrace/src/symbolize/gimli/elf.rs.orig 2022-04-04 11:10:55.000000000 +0000 ++++ vendor/backtrace/src/symbolize/gimli/elf.rs +@@ -276,11 +276,16 @@ fn decompress_zlib(input: &[u8], output: + } + } + ++#[cfg(target_os = "netbsd")] ++const DEBUG_PATH: &[u8] = b"/usr/libdata/debug"; ++#[cfg(target_os != "netbsd")] + const DEBUG_PATH: &[u8] = b"/usr/lib/debug"; + + fn debug_path_exists() -> bool { + cfg_if::cfg_if! { +- if #[cfg(any(target_os = "freebsd", target_os = "linux"))] { ++ if #[cfg(any(target_os = "freebsd", ++ target_os = "netbsd", ++ target_os = "linux"))] { + use core::sync::atomic::{AtomicU8, Ordering}; + static DEBUG_PATH_EXISTS: AtomicU8 = AtomicU8::new(0); + diff --git a/rust178/patches/patch-vendor_cc-1.0.73_src_lib.rs b/rust178/patches/patch-vendor_cc-1.0.73_src_lib.rs new file mode 100644 index 00000000000..864beacf10e --- /dev/null +++ b/rust178/patches/patch-vendor_cc-1.0.73_src_lib.rs @@ -0,0 +1,16 @@ +$NetBSD$ + +Use correct ABI on NetBSD/riscv64. + +--- vendor/cc-1.0.73/src/lib.rs.orig 2023-05-31 21:44:47.000000000 +0000 ++++ vendor/cc-1.0.73/src/lib.rs +@@ -1830,6 +1830,9 @@ impl Build { + } else if target.contains("freebsd") && arch.starts_with("64") { + cmd.args.push(("-march=rv64gc").into()); + cmd.args.push("-mabi=lp64d".into()); ++ } else if target.contains("netbsd") && arch.starts_with("64") { ++ cmd.args.push(("-march=rv64gc").into()); ++ cmd.args.push("-mabi=lp64d".into()); + } else if target.contains("openbsd") && arch.starts_with("64") { + cmd.args.push(("-march=rv64gc").into()); + cmd.args.push("-mabi=lp64d".into()); diff --git a/rust178/patches/patch-vendor_cc_src_lib.rs b/rust178/patches/patch-vendor_cc_src_lib.rs new file mode 100644 index 00000000000..f754e454f47 --- /dev/null +++ b/rust178/patches/patch-vendor_cc_src_lib.rs @@ -0,0 +1,22 @@ +$NetBSD$ + +Add aarch64_be and mipsel for NetBSD. + +--- vendor/cc/src/lib.rs.orig 2024-02-17 11:28:27.283394955 +0000 ++++ vendor/cc/src/lib.rs +@@ -3058,6 +3058,7 @@ impl Build { + "aarch64-unknown-linux-gnu" => Some("aarch64-linux-gnu"), + "aarch64-unknown-linux-musl" => Some("aarch64-linux-musl"), + "aarch64-unknown-netbsd" => Some("aarch64--netbsd"), ++ "aarch64_be-unknown-netbsd" => Some("aarch64_be--netbsd"), + "arm-unknown-linux-gnueabi" => Some("arm-linux-gnueabi"), + "armv4t-unknown-linux-gnueabi" => Some("arm-linux-gnueabi"), + "armv5te-unknown-linux-gnueabi" => Some("arm-linux-gnueabi"), +@@ -3093,6 +3094,7 @@ impl Build { + "mips-unknown-linux-musl" => Some("mips-linux-musl"), + "mipsel-unknown-linux-gnu" => Some("mipsel-linux-gnu"), + "mipsel-unknown-linux-musl" => Some("mipsel-linux-musl"), ++ "mipsel-unknown-netbsd" => Some("mipsel--netbsd"), + "mips64-unknown-linux-gnuabi64" => Some("mips64-linux-gnuabi64"), + "mips64el-unknown-linux-gnuabi64" => Some("mips64el-linux-gnuabi64"), + "mipsisa32r6-unknown-linux-gnu" => Some("mipsisa32r6-linux-gnu"), diff --git a/rust178/patches/patch-vendor_crossbeam-utils-0.8.17_no__atomic.rs b/rust178/patches/patch-vendor_crossbeam-utils-0.8.17_no__atomic.rs new file mode 100644 index 00000000000..09ba0b6af5b --- /dev/null +++ b/rust178/patches/patch-vendor_crossbeam-utils-0.8.17_no__atomic.rs @@ -0,0 +1,14 @@ +$NetBSD$ + +Add NetBSD/mipsel to list of those who have no atomics. + +--- vendor/crossbeam-utils-0.8.17/no_atomic.rs.orig 2024-05-03 22:51:16.357431380 +0000 ++++ vendor/crossbeam-utils-0.8.17/no_atomic.rs +@@ -5,6 +5,7 @@ const NO_ATOMIC: &[&str] = &[ + "bpfeb-unknown-none", + "bpfel-unknown-none", + "mipsel-sony-psx", ++ "mipsel-unknown-netbsd", + "msp430-none-elf", + "riscv32i-unknown-none-elf", + "riscv32im-unknown-none-elf", diff --git a/rust178/patches/patch-vendor_crossbeam-utils-0.8.18_no__atomic.rs b/rust178/patches/patch-vendor_crossbeam-utils-0.8.18_no__atomic.rs new file mode 100644 index 00000000000..8a7b3793faf --- /dev/null +++ b/rust178/patches/patch-vendor_crossbeam-utils-0.8.18_no__atomic.rs @@ -0,0 +1,14 @@ +$NetBSD$ + +Add NetBSD/mipsel to non-atomic targets. + +--- vendor/crossbeam-utils-0.8.18/no_atomic.rs.orig 2024-05-03 22:53:42.558166596 +0000 ++++ vendor/crossbeam-utils-0.8.18/no_atomic.rs +@@ -5,6 +5,7 @@ const NO_ATOMIC: &[&str] = &[ + "bpfeb-unknown-none", + "bpfel-unknown-none", + "mipsel-sony-psx", ++ "mipsel-unknown-netbsd", + "msp430-none-elf", + "riscv32i-unknown-none-elf", + "riscv32im-unknown-none-elf", diff --git a/rust178/patches/patch-vendor_crossbeam-utils_no__atomic.rs b/rust178/patches/patch-vendor_crossbeam-utils_no__atomic.rs new file mode 100644 index 00000000000..3732c9e9efc --- /dev/null +++ b/rust178/patches/patch-vendor_crossbeam-utils_no__atomic.rs @@ -0,0 +1,14 @@ +$NetBSD$ + +Add NetBSD/mipsel to list of non-atomic targets. + +--- vendor/crossbeam-utils/no_atomic.rs.orig 2024-05-03 22:55:08.657084841 +0000 ++++ vendor/crossbeam-utils/no_atomic.rs +@@ -5,6 +5,7 @@ const NO_ATOMIC: &[&str] = &[ + "bpfeb-unknown-none", + "bpfel-unknown-none", + "mipsel-sony-psx", ++ "mipsel-unknown-netbsd", + "msp430-none-elf", + "riscv32i-unknown-none-elf", + "riscv32im-unknown-none-elf", diff --git a/rust178/patches/patch-vendor_libc-0.2.148_src_unix_bsd_netbsdlike_netbsd_mips.rs b/rust178/patches/patch-vendor_libc-0.2.148_src_unix_bsd_netbsdlike_netbsd_mips.rs new file mode 100644 index 00000000000..18aa4d7328b --- /dev/null +++ b/rust178/patches/patch-vendor_libc-0.2.148_src_unix_bsd_netbsdlike_netbsd_mips.rs @@ -0,0 +1,29 @@ +$NetBSD$ + +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; diff --git a/rust178/patches/patch-vendor_libc-0.2.148_src_unix_bsd_netbsdlike_netbsd_riscv64.rs b/rust178/patches/patch-vendor_libc-0.2.148_src_unix_bsd_netbsdlike_netbsd_riscv64.rs new file mode 100644 index 00000000000..17b7d399913 --- /dev/null +++ b/rust178/patches/patch-vendor_libc-0.2.148_src_unix_bsd_netbsdlike_netbsd_riscv64.rs @@ -0,0 +1,29 @@ +$NetBSD$ + +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; diff --git a/rust178/patches/patch-vendor_libc-0.2.151_src_unix_solarish_mod.rs b/rust178/patches/patch-vendor_libc-0.2.151_src_unix_solarish_mod.rs new file mode 100644 index 00000000000..6a37dc1f2fb --- /dev/null +++ b/rust178/patches/patch-vendor_libc-0.2.151_src_unix_solarish_mod.rs @@ -0,0 +1,15 @@ +$NetBSD$ + +Fix xattr build. + +--- vendor/libc-0.2.151/src/unix/solarish/mod.rs.orig 2024-05-03 23:00:56.855657239 +0000 ++++ vendor/libc-0.2.151/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; diff --git a/rust178/patches/patch-vendor_libc_src_unix_solarish_mod.rs b/rust178/patches/patch-vendor_libc_src_unix_solarish_mod.rs new file mode 100644 index 00000000000..af3ce88fd88 --- /dev/null +++ b/rust178/patches/patch-vendor_libc_src_unix_solarish_mod.rs @@ -0,0 +1,15 @@ +$NetBSD: patch-vendor_libc_src_unix_solarish_mod.rs,v 1.1 2019/05/31 14:11:23 jperkin Exp $ + +Fix xattr build. + +--- vendor/libc/src/unix/solarish/mod.rs.orig 2019-05-20 13:47:24.000000000 +0000 ++++ vendor/libc/src/unix/solarish/mod.rs +@@ -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; diff --git a/rust178/patches/patch-vendor_lzma-sys_config.h b/rust178/patches/patch-vendor_lzma-sys_config.h new file mode 100644 index 00000000000..67963cec476 --- /dev/null +++ b/rust178/patches/patch-vendor_lzma-sys_config.h @@ -0,0 +1,18 @@ +$NetBSD: patch-vendor_lzma-sys_config.h,v 1.1 2019/10/28 00:42:21 jperkin Exp $ + +Fix SunOS builds with newer compilers. + +--- vendor/lzma-sys/config.h.orig 2020-10-07 09:33:31.000000000 +0000 ++++ vendor/lzma-sys/config.h +@@ -35,7 +35,11 @@ + // change to `MYTHREAD_WIN95` if targeting Windows XP or earlier + #define MYTHREAD_VISTA 1 + #else ++#if !defined(__sun) || (__STDC_VERSION__-0 < 199901L) + #define _POSIX_C_SOURCE 199506L ++#else ++ #define _POSIX_C_SOURCE 200112L ++#endif + #define MYTHREAD_POSIX 1 + #endif + diff --git a/rust178/patches/patch-vendor_openssl-src_openssl_Configurations_10-main.conf b/rust178/patches/patch-vendor_openssl-src_openssl_Configurations_10-main.conf new file mode 100644 index 00000000000..fcacc14302a --- /dev/null +++ b/rust178/patches/patch-vendor_openssl-src_openssl_Configurations_10-main.conf @@ -0,0 +1,18 @@ +$NetBSD$ + +Replicate part of +https://github.com/openssl/openssl/pull/15086 + +--- vendor/openssl-src/openssl/Configurations/10-main.conf.orig 2023-08-03 13:47:25.000000000 +0000 ++++ vendor/openssl-src/openssl/Configurations/10-main.conf +@@ -950,6 +950,10 @@ my %targets = ( + shared_cflag => "-fPIC", + shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)", + }, ++ "NetBSD-generic32" => { ++ inherit_from => [ "BSD-generic32" ], ++ ex_libs => add(threads("-latomic")), ++ }, + "BSD-generic64" => { + inherit_from => [ "BSD-generic32" ], + bn_ops => "SIXTY_FOUR_BIT_LONG", diff --git a/rust178/patches/patch-vendor_openssl-src_src_lib.rs b/rust178/patches/patch-vendor_openssl-src_src_lib.rs new file mode 100644 index 00000000000..ad03cc68bfc --- /dev/null +++ b/rust178/patches/patch-vendor_openssl-src_src_lib.rs @@ -0,0 +1,64 @@ +$NetBSD: patch-vendor_openssl-src_src_lib.rs,v 1.1 2021/01/01 20:44:48 he Exp $ + +Provide defaults for the various NetBSD targets. + +--- vendor/openssl-src/src/lib.rs.orig 2024-02-04 14:52:05.000000000 +0000 ++++ vendor/openssl-src/src/lib.rs +@@ -239,6 +239,8 @@ impl Build { + "aarch64-unknown-freebsd" => "BSD-generic64", + "aarch64-unknown-linux-gnu" => "linux-aarch64", + "aarch64-unknown-linux-musl" => "linux-aarch64", ++ "aarch64-unknown-netbsd" => "BSD-generic64", ++ "aarch64_be-unknown-netbsd" => "BSD-generic64", + "aarch64-pc-windows-msvc" => "VC-WIN64-ARM", + "arm-linux-androideabi" => "linux-armv4", + "armv7-linux-androideabi" => "linux-armv4", +@@ -249,14 +251,17 @@ impl Build { + "armv5te-unknown-linux-gnueabi" => "linux-armv4", + "armv5te-unknown-linux-musleabi" => "linux-armv4", + "armv6-unknown-freebsd" => "BSD-generic32", ++ "armv6-unknown-netbsd-eabihf" => "BSD-generic32", + "armv7-unknown-freebsd" => "BSD-generic32", + "armv7-unknown-linux-gnueabi" => "linux-armv4", + "armv7-unknown-linux-musleabi" => "linux-armv4", + "armv7-unknown-linux-gnueabihf" => "linux-armv4", + "armv7-unknown-linux-musleabihf" => "linux-armv4", ++ "armv7-unknown-netbsd-eabihf" => "BSD-generic32", + "asmjs-unknown-emscripten" => "gcc", + "i586-unknown-linux-gnu" => "linux-elf", + "i586-unknown-linux-musl" => "linux-elf", ++ "i586-unknown-netbsd" => "BSD-x86-elf", + "i686-apple-darwin" => "darwin-i386-cc", + "i686-linux-android" => "linux-elf", + "i686-pc-windows-gnu" => "mingw", +@@ -264,6 +269,7 @@ impl Build { + "i686-unknown-freebsd" => "BSD-x86-elf", + "i686-unknown-linux-gnu" => "linux-elf", + "i686-unknown-linux-musl" => "linux-elf", ++ "i686-unknown-netbsd" => "BSD-x86-elf", + "loongarch64-unknown-linux-gnu" => "linux-generic64", + "mips-unknown-linux-gnu" => "linux-mips32", + "mips-unknown-linux-musl" => "linux-mips32", +@@ -273,9 +279,11 @@ impl Build { + "mips64el-unknown-linux-muslabi64" => "linux64-mips64", + "mipsel-unknown-linux-gnu" => "linux-mips32", + "mipsel-unknown-linux-musl" => "linux-mips32", ++ "mipsel-unknown-netbsd" => "NetBSD-generic32", + "powerpc-unknown-freebsd" => "BSD-generic32", + "powerpc-unknown-linux-gnu" => "linux-ppc", + "powerpc-unknown-linux-gnuspe" => "linux-ppc", ++ "powerpc-unknown-netbsd" => "BSD-generic32", + "powerpc64-unknown-freebsd" => "BSD-generic64", + "powerpc64-unknown-linux-gnu" => "linux-ppc64", + "powerpc64-unknown-linux-musl" => "linux-ppc64", +@@ -283,8 +291,10 @@ impl Build { + "powerpc64le-unknown-linux-gnu" => "linux-ppc64le", + "powerpc64le-unknown-linux-musl" => "linux-ppc64le", + "riscv64gc-unknown-linux-gnu" => "linux-generic64", ++ "riscv64gc-unknown-netbsd" => "BSD-generic64", + "s390x-unknown-linux-gnu" => "linux64-s390x", + "s390x-unknown-linux-musl" => "linux64-s390x", ++ "sparc64-unknown-netbsd" => "BSD-generic64", + "x86_64-apple-darwin" => "darwin64-x86_64-cc", + "x86_64-linux-android" => "linux-x86_64", + "x86_64-pc-windows-gnu" => "mingw64", diff --git a/rust178/patches/patch-vendor_openssl-sys_build_find__normal.rs b/rust178/patches/patch-vendor_openssl-sys_build_find__normal.rs new file mode 100644 index 00000000000..05d96b1783a --- /dev/null +++ b/rust178/patches/patch-vendor_openssl-sys_build_find__normal.rs @@ -0,0 +1,30 @@ +$NetBSD: patch-vendor_openssl-sys_build_find__normal.rs,v 1.1 2023/06/19 14:46:47 bsiegert Exp $ + +Add hack for Darwin when homebrew is installed. + +--- vendor/openssl-sys/build/find_normal.rs.orig 2023-05-31 21:44:49.000000000 +0000 ++++ vendor/openssl-sys/build/find_normal.rs +@@ -72,23 +72,6 @@ fn resolve_with_wellknown_location(dir: + fn find_openssl_dir(target: &str) -> OsString { + let host = env::var("HOST").unwrap(); + +- if host == target && target.ends_with("-apple-darwin") { +- let homebrew_dir = match target { +- "aarch64-apple-darwin" => "/opt/homebrew", +- _ => "/usr/local", +- }; +- +- if let Some(dir) = resolve_with_wellknown_homebrew_location(homebrew_dir) { +- return dir.into(); +- } else if let Some(dir) = resolve_with_wellknown_location("/opt/pkg") { +- // pkgsrc +- return dir.into(); +- } else if let Some(dir) = resolve_with_wellknown_location("/opt/local") { +- // MacPorts +- return dir.into(); +- } +- } +- + try_pkg_config(); + try_vcpkg(); + diff --git a/rust178/patches/patch-vendor_openssl-sys_build_main.rs b/rust178/patches/patch-vendor_openssl-sys_build_main.rs new file mode 100644 index 00000000000..7f0e828a91f --- /dev/null +++ b/rust178/patches/patch-vendor_openssl-sys_build_main.rs @@ -0,0 +1,23 @@ +$NetBSD$ + +Patterned after Linux and Android, on 32-bit NetBSD ports +include -latomic. Parts of this inspired by +https://github.com/sfackler/rust-openssl/commit/a0a1d1d29263abb7c47fc2e58cef8dab13762a45 + +--- vendor/openssl-sys/build/main.rs.orig 2022-11-02 16:21:42.000000000 +0000 ++++ vendor/openssl-sys/build/main.rs +@@ -133,6 +133,14 @@ fn main() { + println!("cargo:rustc-link-lib=atomic"); + } + ++ // Patterned of the above, make sure we include -latomic ++ // on ilp32 ports (yes, this only tests the "p32" part). ++ if env::var("CARGO_CFG_TARGET_OS").unwrap() == "netbsd" ++ && env::var("CARGO_CFG_TARGET_POINTER_WIDTH").unwrap() == "32" ++ { ++ println!("cargo:rustc-link-lib=atomic"); ++ } ++ + if kind == "static" && target.contains("windows") { + println!("cargo:rustc-link-lib=dylib=gdi32"); + println!("cargo:rustc-link-lib=dylib=user32"); diff --git a/rust178/patches/patch-vendor_portable-atomic_no__atomic.rs b/rust178/patches/patch-vendor_portable-atomic_no__atomic.rs new file mode 100644 index 00000000000..74a76e2e74a --- /dev/null +++ b/rust178/patches/patch-vendor_portable-atomic_no__atomic.rs @@ -0,0 +1,14 @@ +$NetBSD$ + +mipsel-unknown-netbsd doesn't have 64-bit atomics. + +--- vendor/portable-atomic/no_atomic.rs.orig 2024-04-02 18:18:04.323714290 +0000 ++++ vendor/portable-atomic/no_atomic.rs +@@ -40,6 +40,7 @@ static NO_ATOMIC_64: &[&str] = &[ + "mipsel-unknown-linux-gnu", + "mipsel-unknown-linux-musl", + "mipsel-unknown-linux-uclibc", ++ "mipsel-unknown-netbsd", + "mipsel-unknown-none", + "mipsisa32r6-unknown-linux-gnu", + "mipsisa32r6el-unknown-linux-gnu", diff --git a/rust178/patches/patch-vendor_rustc-ap-rustc__target_src_spec_aarch64__be__unknown__netbsd.rs b/rust178/patches/patch-vendor_rustc-ap-rustc__target_src_spec_aarch64__be__unknown__netbsd.rs new file mode 100644 index 00000000000..98a1d9cb7ba --- /dev/null +++ b/rust178/patches/patch-vendor_rustc-ap-rustc__target_src_spec_aarch64__be__unknown__netbsd.rs @@ -0,0 +1,27 @@ +$NetBSD$ + +Add aarch64_be NetBSD target. + +--- /dev/null 2021-04-26 00:02:43.147970692 +0200 ++++ vendor/rustc-ap-rustc_target/src/spec/aarch64_be_unknown_netbsd.rs 2021-04-26 00:07:44.657579025 +0200 +@@ -0,0 +1,20 @@ ++use crate::abi::Endian; ++use crate::spec::{Target, TargetOptions}; ++ ++pub fn target() -> Target { ++ let mut base = super::netbsd_base::opts(); ++ base.max_atomic_width = Some(128); ++ base.unsupported_abis = super::arm_base::unsupported_abis(); ++ ++ Target { ++ llvm_target: "aarch64_be-unknown-netbsd".to_string(), ++ pointer_width: 64, ++ data_layout: "E-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128".to_string(), ++ arch: "aarch64".to_string(), ++ options: TargetOptions { ++ mcount: "__mcount".to_string(), ++ endian: Endian::Big, ++ ..base ++ }, ++ } ++} diff --git a/rust178/patches/patch-vendor_stacker_src_lib.rs b/rust178/patches/patch-vendor_stacker_src_lib.rs new file mode 100644 index 00000000000..dfd1589f54d --- /dev/null +++ b/rust178/patches/patch-vendor_stacker_src_lib.rs @@ -0,0 +1,15 @@ +$NetBSD: patch-vendor_stacker_src_lib.rs,v 1.1 2020/08/06 11:42:56 jperkin Exp $ + +Avoid missing pthread_* on older SunOS. + +--- vendor/stacker/src/lib.rs.orig 2020-07-13 18:18:17.000000000 +0000 ++++ vendor/stacker/src/lib.rs +@@ -407,7 +407,7 @@ cfg_if! { + ); + Some(mi.assume_init().AllocationBase as usize + get_thread_stack_guarantee() + 0x1000) + } +- } else if #[cfg(any(target_os = "linux", target_os="solaris", target_os = "netbsd"))] { ++ } else if #[cfg(any(target_os = "linux", target_os = "netbsd"))] { + unsafe fn guess_os_stack_limit() -> Option { + let mut attr = std::mem::MaybeUninit::::uninit(); + assert_eq!(libc::pthread_attr_init(attr.as_mut_ptr()), 0); diff --git a/rust178/patches/patch-vendor_target-lexicon_src_targets.rs b/rust178/patches/patch-vendor_target-lexicon_src_targets.rs new file mode 100644 index 00000000000..5e646970c48 --- /dev/null +++ b/rust178/patches/patch-vendor_target-lexicon_src_targets.rs @@ -0,0 +1,22 @@ +$NetBSD$ + +Add aarch64_eb and mipsel for NetBSD. + +--- vendor/target-lexicon/src/targets.rs.orig 2021-05-03 21:35:46.000000000 +0000 ++++ vendor/target-lexicon/src/targets.rs +@@ -1526,6 +1526,7 @@ mod tests { + "aarch64-unknown-linux-gnu_ilp32", + "aarch64-unknown-linux-musl", + "aarch64-unknown-netbsd", ++ "aarch64_be-unknown-netbsd", + "aarch64-unknown-none", + "aarch64-unknown-none-softfloat", + "aarch64-unknown-openbsd", +@@ -1611,6 +1612,7 @@ mod tests { + "mipsel-unknown-linux-gnu", + "mipsel-unknown-linux-musl", + "mipsel-unknown-linux-uclibc", ++ "mipsel-unknown-netbsd", + "mipsel-unknown-none", + "mipsisa32r6el-unknown-linux-gnu", + "mipsisa32r6-unknown-linux-gnu", diff --git a/rust178/patches/patch-vendor_valuable_no__atomic.rs b/rust178/patches/patch-vendor_valuable_no__atomic.rs new file mode 100644 index 00000000000..f485c63d9d2 --- /dev/null +++ b/rust178/patches/patch-vendor_valuable_no__atomic.rs @@ -0,0 +1,14 @@ +$NetBSD$ + +Add mipsel-unknown-netbsd. + +--- vendor/valuable/no_atomic.rs.orig 2022-09-19 15:35:03.000000000 +0000 ++++ vendor/valuable/no_atomic.rs +@@ -30,6 +30,7 @@ const NO_ATOMIC_64: &[&str] = &[ + "mipsel-unknown-linux-musl", + "mipsel-unknown-linux-uclibc", + "mipsel-unknown-none", ++ "mipsel-unknown-netbsd", + "mipsisa32r6-unknown-linux-gnu", + "mipsisa32r6el-unknown-linux-gnu", + "powerpc-unknown-freebsd", diff --git a/rust178/platform.mk b/rust178/platform.mk new file mode 100644 index 00000000000..cc75fd55ab9 --- /dev/null +++ b/rust178/platform.mk @@ -0,0 +1,26 @@ +# $NetBSD: platform.mk,v 1.6 2020/12/26 10:04:51 nia Exp $ + +# This file encodes whether a given platform has support for rust. + +# Platforms where rust ought to work but does not require a link to an +# open PR. + +.if !defined(PLATFORM_SUPPORTS_RUST) + +# Rust needs NetBSD>7 +.for rust_arch in aarch64 earmv7hf i386 powerpc riscv64 sparc64 x86_64 +. for rust_os in Darwin FreeBSD Linux NetBSD SunOS +. if ${OPSYS} != "NetBSD" || empty(OS_VERSION:M[0-7].*) +RUST_PLATFORMS+= ${rust_os}-*-${rust_arch} +. endif +. endfor +.endfor + +.for rust_platform in ${RUST_PLATFORMS} +. if !empty(MACHINE_PLATFORM:M${rust_platform}) +PLATFORM_SUPPORTS_RUST= yes +. endif +.endfor +PLATFORM_SUPPORTS_RUST?= no + +.endif # !defined(PLATFORM_SUPPORTS_RUST) diff --git a/rust178/rust.mk b/rust178/rust.mk new file mode 100644 index 00000000000..d9301248654 --- /dev/null +++ b/rust178/rust.mk @@ -0,0 +1,55 @@ +# $NetBSD: rust.mk,v 1.7 2020/10/14 08:23:49 triaxx Exp $ +# +# This file determines the type of rust package to use. +# +# It should be included by rust-dependent packages that don't use +# cargo.mk. +# +# === User-settable variables === +# +# RUST_TYPE +# The preferred type of Rust release to use - +# either bootstrap-from-source or an official binary. +# +# Official Rust binaries are only published for certain platforms, +# including Darwin, FreeBSD, Linux, and NetBSD x86_64. +# +# Possible values: src bin +# Default: src +# +# === Package-settable variables === +# +# RUST_REQ +# The minimum version of Rust required by the package. +# +# Default: 1.56.1 +# +# RUST_RUNTIME +# Whether rust is a runtime dependency. +# Usually it is only needed to build. +# +# Possible values: yes no +# Default: no + +.include "../../mk/bsd.fast.prefs.mk" + +RUST_REQ?= 1.56.1 +RUST_RUNTIME?= no + +RUST_TYPE?= src + +.if ${RUST_TYPE} == "bin" +. if ${RUST_RUNTIME} == "no" +BUILDLINK_DEPMETHOD.rust-bin?= build +. endif +BUILDLINK_API_DEPENDS.rust-bin+= rust-bin>=${RUST_REQ} +. include "../../lang/rust-bin/buildlink3.mk" +.endif + +.if ${RUST_TYPE} == "src" +. if ${RUST_RUNTIME} == "no" +BUILDLINK_DEPMETHOD.rust?= build +. endif +BUILDLINK_API_DEPENDS.rust+= rust>=${RUST_REQ} +. include "../../lang/rust/buildlink3.mk" +.endif