From fb8ffa6e8d24b52a9ad2845ba73190f8f0a7c87b Mon Sep 17 00:00:00 2001 From: LI Leding Date: Sun, 14 Jun 2026 22:53:29 +0800 Subject: [PATCH 1/2] Add Rust 1.86.0 DragonFly bootstrap Use the 1.85.1 bootstrap toolchain to build Rust 1.86.0 for x86_64-unknown-dragonfly. Add the 1.86.0 build script, DragonFly patches, vendor checksum fixups, and source tarball checksum. Verified with build-local.sh through xbuild, xtest, xdist, and install. --- 1.86.0/build.sh | 29 +++ ...ompiler_rustc_codegen_ssa_src_back_link.rs | 13 ++ ...piler_rustc_codegen_ssa_src_back_linker.rs | 37 ++++ ...h-library_backtrace_src_symbolize_gimli.rs | 18 ++ ...atch-library_std_src_sys_pal_unix_futex.rs | 29 +++ ...ary_std_src_sys_pal_unix_stack_overflow.rs | 100 +++++++++++ ...brary_std_src_sys_thread_local_key_racy.rs | 22 +++ ...ch-library_std_src_sys_thread_local_mod.rs | 12 ++ ...src_bootstrap_src_core_build_steps_dist.rs | 88 ++++++++++ ...src_bootstrap_src_core_build_steps_test.rs | 61 +++++++ ...atch-src_bootstrap_src_core_builder_mod.rs | 11 ++ ...tch-src_bootstrap_src_core_config_tests.rs | 23 +++ ...lvm-project_llvm_lib_Support_Unix_Path.inc | 28 +++ ...rc_tools_compiletest_src_directive-list.rs | 10 ++ ...patch-src_tools_compiletest_src_runtest.rs | 16 ++ ...ls_compiletest_src_runtest_mir-dump-dir.rs | 15 ++ ...nalyzer_crates_proc-macro-srv_src_dylib.rs | 19 ++ .../patch-tests_debuginfo_dragonfly_gdb.rs | 165 ++++++++++++++++++ ...tch-tests_run-make_emit-to-stdout_rmake.rs | 68 ++++++++ ...tests_run-make_foreign-exceptions_rmake.rs | 12 ++ ..._run-make_foreign-rust-exceptions_rmake.rs | 12 ++ .../patch-tests_run-make_rust-lld_rmake.rs | 12 ++ ...ch-tests_ui_amdgpu-require-explicit-cpu.rs | 12 ++ .../patch-vendor_notify-8.0.0_Cargo.toml | 15 ++ ...dor_openssl-src-111.28.2+1.1.1w_src_lib.rs | 13 ++ checksums.sh | 1 + 26 files changed, 841 insertions(+) create mode 100644 1.86.0/build.sh create mode 100644 1.86.0/patches/patch-compiler_rustc_codegen_ssa_src_back_link.rs create mode 100644 1.86.0/patches/patch-compiler_rustc_codegen_ssa_src_back_linker.rs create mode 100644 1.86.0/patches/patch-library_backtrace_src_symbolize_gimli.rs create mode 100644 1.86.0/patches/patch-library_std_src_sys_pal_unix_futex.rs create mode 100644 1.86.0/patches/patch-library_std_src_sys_pal_unix_stack_overflow.rs create mode 100644 1.86.0/patches/patch-library_std_src_sys_thread_local_key_racy.rs create mode 100644 1.86.0/patches/patch-library_std_src_sys_thread_local_mod.rs create mode 100644 1.86.0/patches/patch-src_bootstrap_src_core_build_steps_dist.rs create mode 100644 1.86.0/patches/patch-src_bootstrap_src_core_build_steps_test.rs create mode 100644 1.86.0/patches/patch-src_bootstrap_src_core_builder_mod.rs create mode 100644 1.86.0/patches/patch-src_bootstrap_src_core_config_tests.rs create mode 100644 1.86.0/patches/patch-src_llvm-project_llvm_lib_Support_Unix_Path.inc create mode 100644 1.86.0/patches/patch-src_tools_compiletest_src_directive-list.rs create mode 100644 1.86.0/patches/patch-src_tools_compiletest_src_runtest.rs create mode 100644 1.86.0/patches/patch-src_tools_compiletest_src_runtest_mir-dump-dir.rs create mode 100644 1.86.0/patches/patch-src_tools_rust-analyzer_crates_proc-macro-srv_src_dylib.rs create mode 100644 1.86.0/patches/patch-tests_debuginfo_dragonfly_gdb.rs create mode 100644 1.86.0/patches/patch-tests_run-make_emit-to-stdout_rmake.rs create mode 100644 1.86.0/patches/patch-tests_run-make_foreign-exceptions_rmake.rs create mode 100644 1.86.0/patches/patch-tests_run-make_foreign-rust-exceptions_rmake.rs create mode 100644 1.86.0/patches/patch-tests_run-make_rust-lld_rmake.rs create mode 100644 1.86.0/patches/patch-tests_ui_amdgpu-require-explicit-cpu.rs create mode 100644 1.86.0/patches/patch-vendor_notify-8.0.0_Cargo.toml create mode 100644 1.86.0/patches/patch-vendor_openssl-src-111.28.2+1.1.1w_src_lib.rs diff --git a/1.86.0/build.sh b/1.86.0/build.sh new file mode 100644 index 0000000..0331fc6 --- /dev/null +++ b/1.86.0/build.sh @@ -0,0 +1,29 @@ +#!/bin/sh + +RUSTC_BOOTSTRAP_VERSION=1.85.1 +CARGO_BOOTSTRAP_VERSION=1.85.1 +RUST_VERSION=1.86.0 + +CONFIGURE_CARGO_STATIC_FLAGS="--enable-cargo-native-static" + +# Since rust 1.38, OPENSSL_DIR has to be specified. +export OPENSSL_DIR="/usr/local" + +# Show backtraces on failures +export RUST_BACKTRACE=1 +# Continue linking rustc driver dynamically +export RUSTC_LINK_STD_INTO_RUSTC_DRIVER=0 + +BASE=`pwd` +DEST=$1 +LLVM_ROOT="" + +. ../checksums.sh +. ../common.sh + +fixup-vendor() { + fixup-vendor-patch openssl-src-111.28.2+1.1.1w src/lib.rs || exit 1 + fixup-vendor-patch notify-8.0.0 Cargo.toml || exit 1 +} + +RUN info clean extract prepatch fixup-vendor config xbuild xdist inst 2>&1 diff --git a/1.86.0/patches/patch-compiler_rustc_codegen_ssa_src_back_link.rs b/1.86.0/patches/patch-compiler_rustc_codegen_ssa_src_back_link.rs new file mode 100644 index 0000000..23fa527 --- /dev/null +++ b/1.86.0/patches/patch-compiler_rustc_codegen_ssa_src_back_link.rs @@ -0,0 +1,13 @@ +--- compiler/rustc_codegen_ssa/src/back/link.rs 2025-03-16 00:27:19.000000000 +0800 ++++ compiler/rustc_codegen_ssa/src/back/link.rs 2026-06-11 14:48:41.552289000 +0800 +@@ -1743,7 +1743,9 @@ + + #[cfg(unix)] + fn command_line_too_big(err: &io::Error) -> bool { +- err.raw_os_error() == Some(::libc::E2BIG) ++ let raw_os_error = err.raw_os_error(); ++ raw_os_error == Some(::libc::E2BIG) ++ || (cfg!(target_os = "dragonfly") && raw_os_error == Some(::libc::EFAULT)) + } + + #[cfg(windows)] diff --git a/1.86.0/patches/patch-compiler_rustc_codegen_ssa_src_back_linker.rs b/1.86.0/patches/patch-compiler_rustc_codegen_ssa_src_back_linker.rs new file mode 100644 index 0000000..a09a3d7 --- /dev/null +++ b/1.86.0/patches/patch-compiler_rustc_codegen_ssa_src_back_linker.rs @@ -0,0 +1,37 @@ +--- compiler/rustc_codegen_ssa/src/back/linker.rs 2025-03-16 00:27:19.000000000 +0800 ++++ compiler/rustc_codegen_ssa/src/back/linker.rs 2026-06-11 14:28:13.682043000 +0800 +@@ -816,11 +816,21 @@ + let res: io::Result<()> = try { + let mut f = File::create_buffered(&path)?; + writeln!(f, "{{")?; +- if !symbols.is_empty() { ++ let preserve_dragonfly_startup_symbols = crate_type == CrateType::Executable ++ && self.sess.target.os == "dragonfly"; ++ if !symbols.is_empty() || preserve_dragonfly_startup_symbols { + writeln!(f, " global:")?; + for sym in symbols { + debug!(" {sym};"); + writeln!(f, " {sym};")?; ++ } ++ if preserve_dragonfly_startup_symbols { ++ // DragonFly startup objects define process globals for DSOs; hiding ++ // them with local: * makes ld.bfd reject PIE executable links. ++ for sym in ["__progname", "environ"] { ++ debug!(" {sym};"); ++ writeln!(f, " {sym};")?; ++ } + } + } + writeln!(f, "\n local:\n *;\n}};")?; +@@ -840,7 +848,10 @@ + } else { + let mut arg = OsString::from("--version-script="); + arg.push(path); +- self.link_arg(arg).link_arg("--no-undefined-version"); ++ self.link_arg(arg); ++ if self.sess.target.os != "dragonfly" { ++ self.link_arg("--no-undefined-version"); ++ } + } + } + diff --git a/1.86.0/patches/patch-library_backtrace_src_symbolize_gimli.rs b/1.86.0/patches/patch-library_backtrace_src_symbolize_gimli.rs new file mode 100644 index 0000000..d388f52 --- /dev/null +++ b/1.86.0/patches/patch-library_backtrace_src_symbolize_gimli.rs @@ -0,0 +1,18 @@ +--- library/backtrace/src/symbolize/gimli.rs 2025-03-16 00:27:19.000000000 +0800 ++++ library/backtrace/src/symbolize/gimli.rs 2026-06-11 14:26:09.092017000 +0800 +@@ -35,6 +35,7 @@ + } else if #[cfg(any( + target_os = "android", + target_os = "freebsd", ++ target_os = "dragonfly", + target_os = "fuchsia", + target_os = "haiku", + target_os = "hurd", +@@ -220,6 +221,7 @@ + target_os = "linux", + target_os = "fuchsia", + target_os = "freebsd", ++ target_os = "dragonfly", + target_os = "hurd", + target_os = "openbsd", + target_os = "netbsd", diff --git a/1.86.0/patches/patch-library_std_src_sys_pal_unix_futex.rs b/1.86.0/patches/patch-library_std_src_sys_pal_unix_futex.rs new file mode 100644 index 0000000..7e65f6b --- /dev/null +++ b/1.86.0/patches/patch-library_std_src_sys_pal_unix_futex.rs @@ -0,0 +1,29 @@ +--- library/std/src/sys/pal/unix/futex.rs.orig 2025-03-16 00:38:21 UTC ++++ library/std/src/sys/pal/unix/futex.rs +@@ -193,19 +193,22 @@ pub fn futex_wake_all(futex: &AtomicU32) { + + #[cfg(target_os = "dragonfly")] + pub fn futex_wait(futex: &AtomicU32, expected: u32, timeout: Option) -> bool { +- // A timeout of 0 means infinite. +- // We round smaller timeouts up to 1 millisecond. ++ let has_timeout = timeout.is_some(); ++ ++ // DragonFly umtx_sleep takes a timeout in microseconds. ++ // A timeout of 0 means infinite. ++ // We round smaller timeouts up to 1 microsecond. + // Overflows are rounded up to an infinite timeout. +- let timeout_ms = +- timeout.and_then(|d| Some(i32::try_from(d.as_millis()).ok()?.max(1))).unwrap_or(0); ++ let timeout_us = ++ timeout.and_then(|d| Some(i32::try_from(d.as_micros()).ok()?.max(1))).unwrap_or(0); + + let r = unsafe { +- libc::umtx_sleep(futex as *const AtomicU32 as *const i32, expected as i32, timeout_ms) ++ libc::umtx_sleep(futex as *const AtomicU32 as *const i32, expected as i32, timeout_us) + }; + +- r == 0 || super::os::errno() != libc::ETIMEDOUT ++ r == 0 || !has_timeout || super::os::errno() != libc::EWOULDBLOCK + } + + // DragonflyBSD doesn't tell us how many threads are woken up, so this always returns false. diff --git a/1.86.0/patches/patch-library_std_src_sys_pal_unix_stack_overflow.rs b/1.86.0/patches/patch-library_std_src_sys_pal_unix_stack_overflow.rs new file mode 100644 index 0000000..7faa6a4 --- /dev/null +++ b/1.86.0/patches/patch-library_std_src_sys_pal_unix_stack_overflow.rs @@ -0,0 +1,100 @@ +--- library/std/src/sys/pal/unix/stack_overflow.rs 2025-03-16 00:27:19.000000000 +0800 ++++ library/std/src/sys/pal/unix/stack_overflow.rs 2026-06-11 14:01:27.661720000 +0800 +@@ -28,6 +28,7 @@ + #[cfg(any( + target_os = "linux", + target_os = "freebsd", ++ target_os = "dragonfly", + target_os = "hurd", + target_os = "macos", + target_os = "netbsd", +@@ -311,6 +312,7 @@ + #[cfg(any( + target_os = "android", + target_os = "freebsd", ++ target_os = "dragonfly", + target_os = "netbsd", + target_os = "hurd", + target_os = "linux", +@@ -319,11 +321,11 @@ + unsafe fn get_stack_start() -> Option<*mut libc::c_void> { + let mut ret = None; + let mut attr: libc::pthread_attr_t = crate::mem::zeroed(); +- #[cfg(target_os = "freebsd")] ++ #[cfg(any(target_os = "freebsd", target_os = "dragonfly"))] + assert_eq!(libc::pthread_attr_init(&mut attr), 0); +- #[cfg(target_os = "freebsd")] ++ #[cfg(any(target_os = "freebsd", target_os = "dragonfly"))] + let e = libc::pthread_attr_get_np(libc::pthread_self(), &mut attr); +- #[cfg(not(target_os = "freebsd"))] ++ #[cfg(not(any(target_os = "freebsd", target_os = "dragonfly")))] + let e = libc::pthread_getattr_np(libc::pthread_self(), &mut attr); + if e == 0 { + let mut stackaddr = crate::ptr::null_mut(); +@@ -331,7 +333,7 @@ + assert_eq!(libc::pthread_attr_getstack(&attr, &mut stackaddr, &mut stacksize), 0); + ret = Some(stackaddr); + } +- if e == 0 || cfg!(target_os = "freebsd") { ++ if e == 0 || cfg!(any(target_os = "freebsd", target_os = "dragonfly")) { + assert_eq!(libc::pthread_attr_destroy(&mut attr), 0); + } + ret +@@ -367,7 +369,7 @@ + install_main_guard_linux_musl(page_size) + } else if cfg!(target_os = "freebsd") { + install_main_guard_freebsd(page_size) +- } else if cfg!(any(target_os = "netbsd", target_os = "openbsd")) { ++ } else if cfg!(any(target_os = "dragonfly", target_os = "netbsd", target_os = "openbsd")) { + install_main_guard_bsds(page_size) + } else { + install_main_guard_default(page_size) +@@ -500,6 +502,7 @@ + #[cfg(any( + target_os = "android", + target_os = "freebsd", ++ target_os = "dragonfly", + target_os = "hurd", + target_os = "linux", + target_os = "netbsd", +@@ -509,11 +512,11 @@ + unsafe fn current_guard() -> Option> { + let mut ret = None; + let mut attr: libc::pthread_attr_t = crate::mem::zeroed(); +- #[cfg(target_os = "freebsd")] ++ #[cfg(any(target_os = "freebsd", target_os = "dragonfly"))] + assert_eq!(libc::pthread_attr_init(&mut attr), 0); +- #[cfg(target_os = "freebsd")] ++ #[cfg(any(target_os = "freebsd", target_os = "dragonfly"))] + let e = libc::pthread_attr_get_np(libc::pthread_self(), &mut attr); +- #[cfg(not(target_os = "freebsd"))] ++ #[cfg(not(any(target_os = "freebsd", target_os = "dragonfly")))] + let e = libc::pthread_getattr_np(libc::pthread_self(), &mut attr); + if e == 0 { + let mut guardsize = 0; +@@ -533,7 +536,7 @@ + assert_eq!(libc::pthread_attr_getstack(&attr, &mut stackptr, &mut size), 0); + + let stackaddr = stackptr.addr(); +- ret = if cfg!(any(target_os = "freebsd", target_os = "netbsd", target_os = "hurd")) { ++ ret = if cfg!(any(target_os = "freebsd", target_os = "dragonfly", target_os = "netbsd", target_os = "hurd")) { + Some(stackaddr - guardsize..stackaddr) + } else if cfg!(all(target_os = "linux", target_env = "musl")) { + Some(stackaddr - guardsize..stackaddr) +@@ -550,7 +553,7 @@ + Some(stackaddr..stackaddr + guardsize) + }; + } +- if e == 0 || cfg!(target_os = "freebsd") { ++ if e == 0 || cfg!(any(target_os = "freebsd", target_os = "dragonfly")) { + assert_eq!(libc::pthread_attr_destroy(&mut attr), 0); + } + ret +@@ -568,6 +571,7 @@ + #[cfg(not(any( + target_os = "linux", + target_os = "freebsd", ++ target_os = "dragonfly", + target_os = "hurd", + target_os = "macos", + target_os = "netbsd", diff --git a/1.86.0/patches/patch-library_std_src_sys_thread_local_key_racy.rs b/1.86.0/patches/patch-library_std_src_sys_thread_local_key_racy.rs new file mode 100644 index 0000000..17aa87e --- /dev/null +++ b/1.86.0/patches/patch-library_std_src_sys_thread_local_key_racy.rs @@ -0,0 +1,22 @@ +--- library/std/src/sys/thread_local/key/racy.rs 2025-03-16 00:27:19.000000000 +0800 ++++ library/std/src/sys/thread_local/key/racy.rs 2026-06-11 13:39:50.341460000 +0800 +@@ -21,13 +21,18 @@ + + // Define a sentinel value that is likely not to be returned + // as a TLS key. +-#[cfg(not(target_os = "nto"))] ++#[cfg(not(any(target_os = "nto", target_os = "dragonfly")))] + const KEY_SENTVAL: usize = 0; + // On QNX Neutrino, 0 is always returned when currently not in use. + // Using 0 would mean to always create two keys and remote the first + // one (with value of 0) immediately afterwards. + #[cfg(target_os = "nto")] + const KEY_SENTVAL: usize = libc::PTHREAD_KEYS_MAX + 1; ++// DragonFly may hand out key 0 in lean statically-linked/LTO executables. ++// Use a value outside pthread_key_t successful non-negative range instead of ++// relying on the double-create workaround for a zero sentinel. ++#[cfg(target_os = "dragonfly")] ++const KEY_SENTVAL: usize = usize::MAX; + + impl LazyKey { + pub const fn new(dtor: Option) -> LazyKey { diff --git a/1.86.0/patches/patch-library_std_src_sys_thread_local_mod.rs b/1.86.0/patches/patch-library_std_src_sys_thread_local_mod.rs new file mode 100644 index 0000000..ddd8528 --- /dev/null +++ b/1.86.0/patches/patch-library_std_src_sys_thread_local_mod.rs @@ -0,0 +1,12 @@ +--- library/std/src/sys/thread_local/mod.rs 2025-03-16 00:27:19.000000000 +0800 ++++ library/std/src/sys/thread_local/mod.rs 2026-06-11 13:39:16.841453000 +0800 +@@ -59,8 +59,7 @@ + target_os = "fuchsia", + target_os = "redox", + target_os = "hurd", +- target_os = "netbsd", +- target_os = "dragonfly" ++ target_os = "netbsd" + ))] { + mod linux_like; + mod list; diff --git a/1.86.0/patches/patch-src_bootstrap_src_core_build_steps_dist.rs b/1.86.0/patches/patch-src_bootstrap_src_core_build_steps_dist.rs new file mode 100644 index 0000000..908b9a9 --- /dev/null +++ b/1.86.0/patches/patch-src_bootstrap_src_core_build_steps_dist.rs @@ -0,0 +1,88 @@ +--- src/bootstrap/src/core/build_steps/dist.rs.orig ++++ src/bootstrap/src/core/build_steps/dist.rs +@@ -27,7 +27,7 @@ + use crate::utils::channel::{self, Info}; + use crate::utils::exec::{BootstrapCommand, command}; + use crate::utils::helpers::{ +- exe, is_dylib, move_file, t, target_supports_cranelift_backend, timeit, ++ exe, hex_encode, is_dylib, move_file, t, target_supports_cranelift_backend, timeit, + }; + use crate::utils::tarball::{GeneratedTarball, OverlayKind, Tarball}; + use crate::{Compiler, DependencyType, LLVM_TOOLS, Mode}; +@@ -44,6 +44,68 @@ + builder.out.join("tmp/dist") + } + ++ ++fn update_dragonfly_vendor_checksum(builder: &Builder<'_>, crate_dir: &Path, file: &str, contents: &[u8]) { ++ use sha2::Digest; ++ ++ let mut hasher = sha2::Sha256::new(); ++ hasher.update(contents); ++ let checksum = hex_encode(hasher.finalize().as_slice()); ++ ++ let checksum_path = crate_dir.join(".cargo-checksum.json"); ++ let mut checksum_json: serde_json::Value = ++ t!(serde_json::from_slice(&t!(fs::read(&checksum_path)))); ++ let files = checksum_json ++ .get_mut("files") ++ .and_then(|files| files.as_object_mut()) ++ .expect("vendor checksum file should contain a files object"); ++ files.insert(file.to_string(), serde_json::Value::String(checksum)); ++ builder.create(&checksum_path, &t!(serde_json::to_string(&checksum_json))); ++} ++ ++fn patch_dragonfly_vendor_openssl_src(builder: &Builder<'_>, plain_dst_src: &Path) { ++ let crate_dir = plain_dst_src.join("vendor/openssl-src-111.28.2+1.1.1w"); ++ if !crate_dir.exists() { ++ return; ++ } ++ ++ let lib_rs = crate_dir.join("src/lib.rs"); ++ let mut contents = t!(fs::read_to_string(&lib_rs)); ++ if !contents.contains("no-devcryptoeng") { ++ let needle = " if target.contains(\"musl\") {\n // MUSL doesn't implement some of the libc functions that the async\n // stuff depends on, and we don't bind to any of that in any case.\n configure.arg(\"no-async\");\n }\n"; ++ let replacement = " if target.contains(\"dragonfly\") {\n configure.arg(\"no-devcryptoeng\");\n }\n\n if target.contains(\"musl\") {\n // MUSL doesn't implement some of the libc functions that the async\n // stuff depends on, and we don't bind to any of that in any case.\n configure.arg(\"no-async\");\n }\n"; ++ ++ if !contents.contains(needle) { ++ panic!("openssl-src crate layout changed; cannot patch DragonFly devcrypto config"); ++ } ++ contents = contents.replacen(needle, replacement, 1); ++ builder.create(&lib_rs, &contents); ++ } ++ ++ update_dragonfly_vendor_checksum(builder, &crate_dir, "src/lib.rs", contents.as_bytes()); ++} ++ ++fn patch_dragonfly_vendor_notify(builder: &Builder<'_>, plain_dst_src: &Path) { ++ let crate_dir = plain_dst_src.join("vendor/notify-8.0.0"); ++ if !crate_dir.exists() { ++ return; ++ } ++ ++ let cargo_toml = crate_dir.join("Cargo.toml"); ++ let mut contents = t!(fs::read_to_string(&cargo_toml)); ++ if contents.contains("dragonflybsd") { ++ contents = contents.replace("target_os = \"dragonflybsd\"", "target_os = \"dragonfly\""); ++ builder.create(&cargo_toml, &contents); ++ } ++ ++ update_dragonfly_vendor_checksum(builder, &crate_dir, "Cargo.toml", contents.as_bytes()); ++} ++ ++fn patch_dragonfly_vendor_crates(builder: &Builder<'_>, plain_dst_src: &Path) { ++ patch_dragonfly_vendor_openssl_src(builder, plain_dst_src); ++ patch_dragonfly_vendor_notify(builder, plain_dst_src); ++} ++ + fn should_build_extended_tool(builder: &Builder<'_>, tool: &str) -> bool { + if !builder.config.extended { + return false; +@@ -1073,6 +1135,7 @@ + let cargo_config_dir = plain_dst_src.join(".cargo"); + builder.create_dir(&cargo_config_dir); + builder.create(&cargo_config_dir.join("config.toml"), &vendor.config); ++ patch_dragonfly_vendor_crates(builder, plain_dst_src); + } + + // Delete extraneous directories diff --git a/1.86.0/patches/patch-src_bootstrap_src_core_build_steps_test.rs b/1.86.0/patches/patch-src_bootstrap_src_core_build_steps_test.rs new file mode 100644 index 0000000..b065b40 --- /dev/null +++ b/1.86.0/patches/patch-src_bootstrap_src_core_build_steps_test.rs @@ -0,0 +1,61 @@ +--- src/bootstrap/src/core/build_steps/test.rs ++++ src/bootstrap/src/core/build_steps/test.rs +@@ -2097,7 +2097,12 @@ + // needed when diffing test output. + cmd.env("RUSTC_FORCE_RUSTC_VERSION", "compiletest"); + cmd.env("DOC_RUST_LANG_ORG_CHANNEL", builder.doc_rust_lang_org_channel()); +- builder.add_rust_test_threads(&mut cmd); ++ if target.contains("dragonfly") && suite == "assembly" { ++ // DragonFly's threaded compiletest runner can park indefinitely in this suite. ++ cmd.env("RUST_TEST_THREADS", "1"); ++ } else { ++ builder.add_rust_test_threads(&mut cmd); ++ } + + if builder.config.sanitizers_enabled(target) { + cmd.env("RUSTC_SANITIZER_SUPPORT", "1"); +@@ -3058,11 +3058,39 @@ + .arg("--strip-components=1") + .current_dir(&dir) + .run(builder); +- command("./configure") +- .args(&builder.config.configure_args) +- .arg("--enable-vendor") +- .current_dir(&dir) +- .run(builder); ++ let configure_has_vendor = builder ++ .config ++ .configure_args ++ .iter() ++ .any(|arg| arg == "--enable-vendor" || arg == "--disable-vendor"); ++ let configure_has_gdb = builder ++ .config ++ .configure_args ++ .iter() ++ .enumerate() ++ .any(|(index, arg)| { ++ arg.strip_prefix("--set=") ++ .is_some_and(|value| value.starts_with("build.gdb=")) ++ || arg == "--set" ++ && builder ++ .config ++ .configure_args ++ .get(index + 1) ++ .is_some_and(|value| value.starts_with("build.gdb=")) ++ }); ++ let mut configure = command("./configure"); ++ configure.args(&builder.config.configure_args); ++ if !configure_has_vendor { ++ configure.arg("--enable-vendor"); ++ } ++ if !configure_has_gdb { ++ if let Some(gdb) = &builder.config.gdb { ++ configure ++ .arg("--set") ++ .arg(format!("build.gdb={}", gdb.display())); ++ } ++ } ++ configure.current_dir(&dir).run(builder); + command(helpers::make(&builder.config.build.triple)) + .arg("check") + .current_dir(&dir) diff --git a/1.86.0/patches/patch-src_bootstrap_src_core_builder_mod.rs b/1.86.0/patches/patch-src_bootstrap_src_core_builder_mod.rs new file mode 100644 index 0000000..4290efd --- /dev/null +++ b/1.86.0/patches/patch-src_bootstrap_src_core_builder_mod.rs @@ -0,0 +1,11 @@ +--- src/bootstrap/src/core/builder/mod.rs.orig 2025-01-27 23:20:59 UTC ++++ src/bootstrap/src/core/builder/mod.rs +@@ -1121,7 +1121,7 @@ impl<'a> Builder<'a> { + /// Returns if `std` should be statically linked into `rustc_driver`. + /// It's currently not done on `windows-gnu` due to linker bugs. + pub fn link_std_into_rustc_driver(&self, target: TargetSelection) -> bool { +- !target.triple.ends_with("-windows-gnu") ++ !target.triple.ends_with("-windows-gnu") && !target.triple.ends_with("dragonfly") + } + + /// Obtain a compiler at a given stage and for a given host (i.e., this is the target that the diff --git a/1.86.0/patches/patch-src_bootstrap_src_core_config_tests.rs b/1.86.0/patches/patch-src_bootstrap_src_core_config_tests.rs new file mode 100644 index 0000000..e9073ee --- /dev/null +++ b/1.86.0/patches/patch-src_bootstrap_src_core_config_tests.rs @@ -0,0 +1,23 @@ +--- src/bootstrap/src/core/config/tests.rs 2025-03-16 00:27:19.000000000 +0800 ++++ src/bootstrap/src/core/config/tests.rs 2026-06-11 15:11:28.372563000 +0800 +@@ -37,6 +37,10 @@ + let config = parse("llvm.download-ci-llvm = false"); + assert!(!config.llvm_from_ci); + ++ if config.rust_info.is_from_tarball() { ++ return; ++ } ++ + let if_unchanged_config = parse("llvm.download-ci-llvm = \"if-unchanged\""); + if if_unchanged_config.llvm_from_ci { + let has_changes = if_unchanged_config +@@ -444,6 +448,9 @@ + .collect(); + + for p in normalised_allowed_paths { ++ if config.rust_info.is_from_tarball() && p == "triagebot.toml" { ++ continue; ++ } + assert!(config.src.join(p).exists(), "{p} doesn't exist."); + } + } diff --git a/1.86.0/patches/patch-src_llvm-project_llvm_lib_Support_Unix_Path.inc b/1.86.0/patches/patch-src_llvm-project_llvm_lib_Support_Unix_Path.inc new file mode 100644 index 0000000..e3f56be --- /dev/null +++ b/1.86.0/patches/patch-src_llvm-project_llvm_lib_Support_Unix_Path.inc @@ -0,0 +1,28 @@ +--- src/llvm-project/llvm/lib/Support/Unix/Path.inc.orig 2023-05-31 19:29:26 UTC ++++ src/llvm-project/llvm/lib/Support/Unix/Path.inc +@@ -74,13 +74,14 @@ extern char **environ; + + #include + #if !defined(__APPLE__) && !defined(__OpenBSD__) && !defined(__FreeBSD__) && \ +- !defined(__linux__) && !defined(__FreeBSD_kernel__) && !defined(_AIX) ++ !defined(__linux__) && !defined(__FreeBSD_kernel__) && !defined(_AIX) && \ ++ !defined(__DragonFly__) + #include + #define STATVFS statvfs + #define FSTATVFS fstatvfs + #define STATVFS_F_FRSIZE(vfs) vfs.f_frsize + #else +-#if defined(__OpenBSD__) || defined(__FreeBSD__) ++#if defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__DragonFly__) + #include + #include + #elif defined(__linux__) +@@ -111,7 +112,7 @@ typedef uint_t uint; + #define STATVFS_F_FRSIZE(vfs) static_cast(vfs.f_bsize) + #endif + +-#if defined(__NetBSD__) || defined(__DragonFly__) || defined(__GNU__) || \ ++#if defined(__NetBSD__) || defined(__GNU__) || \ + defined(__MVS__) + #define STATVFS_F_FLAG(vfs) (vfs).f_flag + #else diff --git a/1.86.0/patches/patch-src_tools_compiletest_src_directive-list.rs b/1.86.0/patches/patch-src_tools_compiletest_src_directive-list.rs new file mode 100644 index 0000000..cd3d5e8 --- /dev/null +++ b/1.86.0/patches/patch-src_tools_compiletest_src_directive-list.rs @@ -0,0 +1,10 @@ +--- src/tools/compiletest/src/directive-list.rs 2025-03-16 00:27:19.000000000 +0800 ++++ src/tools/compiletest/src/directive-list.rs 2026-06-11 15:05:01.692485000 +0800 +@@ -47,6 +47,7 @@ + "ignore-coverage-map", + "ignore-coverage-run", + "ignore-cross-compile", ++ "ignore-dragonfly", + "ignore-eabi", + "ignore-emscripten", + "ignore-endian-big", diff --git a/1.86.0/patches/patch-src_tools_compiletest_src_runtest.rs b/1.86.0/patches/patch-src_tools_compiletest_src_runtest.rs new file mode 100644 index 0000000..136b132 --- /dev/null +++ b/1.86.0/patches/patch-src_tools_compiletest_src_runtest.rs @@ -0,0 +1,16 @@ +--- src/tools/compiletest/src/runtest.rs.orig 2026-06-11 13:08:16.851080000 +0800 ++++ src/tools/compiletest/src/runtest.rs 2026-06-11 13:08:16.871080000 +0800 +@@ -1632,6 +1632,13 @@ + } + } + ++ if self.config.mode == DebugInfo && self.config.target_cfg().os == "dragonfly" { ++ // DragonFly produces PIE executables by default. GDB 15.1 on ++ // DragonFly currently sets source-line breakpoints at unresolved ++ // PIE-relative addresses for these tests, so use ET_EXEC here. ++ rustc.args(&["-C", "relocation-model=static"]); ++ } ++ + if self.props.remap_src_base { + rustc.arg(format!( + "--remap-path-prefix={}={}", diff --git a/1.86.0/patches/patch-src_tools_compiletest_src_runtest_mir-dump-dir.rs b/1.86.0/patches/patch-src_tools_compiletest_src_runtest_mir-dump-dir.rs new file mode 100644 index 0000000..a7ac11f --- /dev/null +++ b/1.86.0/patches/patch-src_tools_compiletest_src_runtest_mir-dump-dir.rs @@ -0,0 +1,15 @@ +--- src/tools/compiletest/src/runtest.rs.orig ++++ src/tools/compiletest/src/runtest.rs +@@ -1427,7 +1427,11 @@ + let mut mir_dump_dir = PathBuf::from(self.config.build_base.as_path()); + debug!("input_file: {:?}", self.testpaths.file); + mir_dump_dir.push(&self.testpaths.relative_dir); +- mir_dump_dir.push(self.testpaths.file.file_stem().unwrap()); ++ let mut dir_name = PathBuf::from(self.testpaths.file.file_stem().unwrap()); ++ if let Some(revision) = self.revision { ++ dir_name = dir_name.with_extra_extension(revision); ++ } ++ mir_dump_dir.push(dir_name); + mir_dump_dir + } + diff --git a/1.86.0/patches/patch-src_tools_rust-analyzer_crates_proc-macro-srv_src_dylib.rs b/1.86.0/patches/patch-src_tools_rust-analyzer_crates_proc-macro-srv_src_dylib.rs new file mode 100644 index 0000000..44f432e --- /dev/null +++ b/1.86.0/patches/patch-src_tools_rust-analyzer_crates_proc-macro-srv_src_dylib.rs @@ -0,0 +1,19 @@ +--- src/tools/rust-analyzer/crates/proc-macro-srv/src/dylib.rs.orig ++++ src/tools/rust-analyzer/crates/proc-macro-srv/src/dylib.rs +@@ -37,7 +37,15 @@ fn load_library(file: &Utf8Path) -> Resu + #[cfg(not(target_env = "gnu"))] + const RTLD_DEEPBIND: std::os::raw::c_int = 0x0; + +- unsafe { UnixLibrary::open(Some(file), RTLD_NOW | RTLD_DEEPBIND).map(|lib| lib.into()) } ++ const RTLD_NODELETE: std::os::raw::c_int = 0x01000; ++ ++ let flags = if cfg!(target_os = "dragonfly") { ++ RTLD_NOW | RTLD_NODELETE ++ } else { ++ RTLD_NOW | RTLD_DEEPBIND ++ }; ++ ++ unsafe { UnixLibrary::open(Some(file), flags).map(|lib| lib.into()) } + } + + #[derive(Debug)] diff --git a/1.86.0/patches/patch-tests_debuginfo_dragonfly_gdb.rs b/1.86.0/patches/patch-tests_debuginfo_dragonfly_gdb.rs new file mode 100644 index 0000000..966557e --- /dev/null +++ b/1.86.0/patches/patch-tests_debuginfo_dragonfly_gdb.rs @@ -0,0 +1,165 @@ +--- tests/debuginfo/borrowed-c-style-enum.rs.orig 2026-06-11 13:10:46.901110000 +0800 ++++ tests/debuginfo/borrowed-c-style-enum.rs 2026-06-11 13:10:46.921110000 +0800 +@@ -5,13 +5,13 @@ + // gdb-command:run + + // gdb-command:print *the_a_ref +-// gdb-check:$1 = borrowed_c_style_enum::ABC::TheA ++// gdb-check:$1 = borrowed_c_style_enum::[...]TheA + + // gdb-command:print *the_b_ref +-// gdb-check:$2 = borrowed_c_style_enum::ABC::TheB ++// gdb-check:$2 = borrowed_c_style_enum::[...]TheB + + // gdb-command:print *the_c_ref +-// gdb-check:$3 = borrowed_c_style_enum::ABC::TheC ++// gdb-check:$3 = borrowed_c_style_enum::[...]TheC + + + // === LLDB TESTS ================================================================================== +--- tests/debuginfo/c-style-enum.rs.orig 2026-06-11 13:10:46.901110000 +0800 ++++ tests/debuginfo/c-style-enum.rs 2026-06-11 13:10:46.921110000 +0800 +@@ -5,60 +5,60 @@ + // === GDB TESTS =================================================================================== + + // gdb-command:print c_style_enum::SINGLE_VARIANT +-// gdb-check:$1 = c_style_enum::SingleVariant::TheOnlyVariant ++// gdb-check:$1 = c_style_enum::[...]TheOnlyVariant + + // gdb-command:print c_style_enum::AUTO_ONE +-// gdb-check:$2 = c_style_enum::AutoDiscriminant::One ++// gdb-check:$2 = c_style_enum::[...]One + + // gdb-command:print c_style_enum::AUTO_TWO +-// gdb-check:$3 = c_style_enum::AutoDiscriminant::One ++// gdb-check:$3 = c_style_enum::[...]One + + // gdb-command:print c_style_enum::AUTO_THREE +-// gdb-check:$4 = c_style_enum::AutoDiscriminant::One ++// gdb-check:$4 = c_style_enum::[...]One + + // gdb-command:print c_style_enum::MANUAL_ONE +-// gdb-check:$5 = c_style_enum::ManualDiscriminant::OneHundred ++// gdb-check:$5 = c_style_enum::[...]OneHundred + + // gdb-command:print c_style_enum::MANUAL_TWO +-// gdb-check:$6 = c_style_enum::ManualDiscriminant::OneHundred ++// gdb-check:$6 = c_style_enum::[...]OneHundred + + // gdb-command:print c_style_enum::MANUAL_THREE +-// gdb-check:$7 = c_style_enum::ManualDiscriminant::OneHundred ++// gdb-check:$7 = c_style_enum::[...]OneHundred + + // gdb-command:run + + // gdb-command:print auto_one +-// gdb-check:$8 = c_style_enum::AutoDiscriminant::One ++// gdb-check:$8 = c_style_enum::[...]One + + // gdb-command:print auto_two +-// gdb-check:$9 = c_style_enum::AutoDiscriminant::Two ++// gdb-check:$9 = c_style_enum::[...]Two + + // gdb-command:print auto_three +-// gdb-check:$10 = c_style_enum::AutoDiscriminant::Three ++// gdb-check:$10 = c_style_enum::[...]Three + + // gdb-command:print manual_one_hundred +-// gdb-check:$11 = c_style_enum::ManualDiscriminant::OneHundred ++// gdb-check:$11 = c_style_enum::[...]OneHundred + + // gdb-command:print manual_one_thousand +-// gdb-check:$12 = c_style_enum::ManualDiscriminant::OneThousand ++// gdb-check:$12 = c_style_enum::[...]OneThousand + + // gdb-command:print manual_one_million +-// gdb-check:$13 = c_style_enum::ManualDiscriminant::OneMillion ++// gdb-check:$13 = c_style_enum::[...]OneMillion + + // gdb-command:print single_variant +-// gdb-check:$14 = c_style_enum::SingleVariant::TheOnlyVariant ++// gdb-check:$14 = c_style_enum::[...]TheOnlyVariant + + // gdb-command:print AUTO_TWO +-// gdb-check:$15 = c_style_enum::AutoDiscriminant::Two ++// gdb-check:$15 = c_style_enum::[...]Two + + // gdb-command:print AUTO_THREE +-// gdb-check:$16 = c_style_enum::AutoDiscriminant::Three ++// gdb-check:$16 = c_style_enum::[...]Three + + // gdb-command:print MANUAL_TWO +-// gdb-check:$17 = c_style_enum::ManualDiscriminant::OneThousand ++// gdb-check:$17 = c_style_enum::[...]OneThousand + + // gdb-command:print MANUAL_THREE +-// gdb-check:$18 = c_style_enum::ManualDiscriminant::OneMillion ++// gdb-check:$18 = c_style_enum::[...]OneMillion + + + // === LLDB TESTS ================================================================================== +--- tests/debuginfo/c-style-enum-in-composite.rs.orig 2026-06-11 13:10:46.901110000 +0800 ++++ tests/debuginfo/c-style-enum-in-composite.rs 2026-06-11 13:10:46.921110000 +0800 +@@ -5,25 +5,25 @@ + // gdb-command:run + + // gdb-command:print tuple_interior_padding +-// gdb-check:$1 = (0, c_style_enum_in_composite::AnEnum::OneHundred) ++// gdb-check:$1 = (0, c_style_enum_in_composite::[...]OneHundred) + + // gdb-command:print tuple_padding_at_end +-// gdb-check:$2 = ((1, c_style_enum_in_composite::AnEnum::OneThousand), 2) ++// gdb-check:$2 = ((1, c_style_enum_in_composite::[...]OneThousand), 2) + + // gdb-command:print tuple_different_enums +-// gdb-check:$3 = (c_style_enum_in_composite::AnEnum::OneThousand, c_style_enum_in_composite::AnotherEnum::MountainView, c_style_enum_in_composite::AnEnum::OneMillion, c_style_enum_in_composite::AnotherEnum::Vienna) ++// gdb-check:$3 = (c_style_enum_in_composite::[...]OneThousand, c_style_enum_in_composite::[...]MountainView, c_style_enum_in_composite::[...]OneMillion, c_style_enum_in_composite::[...]Vienna) + + // gdb-command:print padded_struct +-// gdb-check:$4 = c_style_enum_in_composite::PaddedStruct {a: 3, b: c_style_enum_in_composite::AnEnum::OneMillion, c: 4, d: c_style_enum_in_composite::AnotherEnum::Toronto, e: 5} ++// gdb-check:$4 = c_style_enum_in_composite::PaddedStruct {a: 3, b: c_style_enum_in_composite::[...]OneMillion, c: 4, d: c_style_enum_in_composite::[...]Toronto, e: 5} + + // gdb-command:print packed_struct +-// gdb-check:$5 = c_style_enum_in_composite::PackedStruct {a: 6, b: c_style_enum_in_composite::AnEnum::OneHundred, c: 7, d: c_style_enum_in_composite::AnotherEnum::Vienna, e: 8} ++// gdb-check:$5 = c_style_enum_in_composite::PackedStruct {a: 6, b: c_style_enum_in_composite::[...]OneHundred, c: 7, d: c_style_enum_in_composite::[...]Vienna, e: 8} + + // gdb-command:print non_padded_struct +-// gdb-check:$6 = c_style_enum_in_composite::NonPaddedStruct {a: c_style_enum_in_composite::AnEnum::OneMillion, b: c_style_enum_in_composite::AnotherEnum::MountainView, c: c_style_enum_in_composite::AnEnum::OneThousand, d: c_style_enum_in_composite::AnotherEnum::Toronto} ++// gdb-check:$6 = c_style_enum_in_composite::NonPaddedStruct {a: c_style_enum_in_composite::[...]OneMillion, b: c_style_enum_in_composite::[...]MountainView, c: c_style_enum_in_composite::[...]OneThousand, d: c_style_enum_in_composite::[...]Toronto} + + // gdb-command:print struct_with_drop +-// gdb-check:$7 = (c_style_enum_in_composite::StructWithDrop {a: c_style_enum_in_composite::AnEnum::OneHundred, b: c_style_enum_in_composite::AnotherEnum::Vienna}, 9) ++// gdb-check:$7 = (c_style_enum_in_composite::StructWithDrop {a: c_style_enum_in_composite::[...]OneHundred, b: c_style_enum_in_composite::[...]Vienna}, 9) + + // === LLDB TESTS ================================================================================== + +--- tests/debuginfo/gdb-pretty-struct-and-enums.rs.orig 2026-06-11 13:10:46.901110000 +0800 ++++ tests/debuginfo/gdb-pretty-struct-and-enums.rs 2026-06-11 13:10:46.921110000 +0800 +@@ -12,13 +12,13 @@ + // gdb-check:$2 = gdb_pretty_struct_and_enums::EmptyStruct + + // gdb-command: print c_style_enum1 +-// gdb-check:$3 = gdb_pretty_struct_and_enums::CStyleEnum::CStyleEnumVar1 ++// gdb-check:$3 = gdb_pretty_struct_and_enums::[...]CStyleEnumVar1 + + // gdb-command: print c_style_enum2 +-// gdb-check:$4 = gdb_pretty_struct_and_enums::CStyleEnum::CStyleEnumVar2 ++// gdb-check:$4 = gdb_pretty_struct_and_enums::[...]CStyleEnumVar2 + + // gdb-command: print c_style_enum3 +-// gdb-check:$5 = gdb_pretty_struct_and_enums::CStyleEnum::CStyleEnumVar3 ++// gdb-check:$5 = gdb_pretty_struct_and_enums::[...]CStyleEnumVar3 + + #![allow(dead_code, unused_variables)] + +--- tests/debuginfo/pretty-std.rs.orig 2026-06-11 13:10:46.901110000 +0800 ++++ tests/debuginfo/pretty-std.rs 2026-06-11 13:10:46.921110000 +0800 +@@ -28,7 +28,7 @@ + // gdb-check:$6 = core::option::Option::None + + // gdb-command: print os_string +-// gdb-check:$7 = "IAMA OS string 😃" ++// gdb-check:$7 = "IAMA OS string [...]" + + // gdb-command: print some_string + // gdb-check:$8 = core::option::Option::Some("IAMA optional string!") diff --git a/1.86.0/patches/patch-tests_run-make_emit-to-stdout_rmake.rs b/1.86.0/patches/patch-tests_run-make_emit-to-stdout_rmake.rs new file mode 100644 index 0000000..15b00ea --- /dev/null +++ b/1.86.0/patches/patch-tests_run-make_emit-to-stdout_rmake.rs @@ -0,0 +1,68 @@ +--- tests/run-make/emit-to-stdout/rmake.rs 2025-03-16 00:27:19.000000000 +0800 ++++ tests/run-make/emit-to-stdout/rmake.rs 2026-06-11 14:52:05.000000000 +0800 +@@ -7,6 +7,8 @@ + //! See . + + use std::fs::File; ++#[cfg(target_os = "dragonfly")] ++use std::os::fd::FromRawFd; + + use run_make_support::{diff, run_in_tmpdir, rustc}; + +@@ -17,15 +19,49 @@ + diff().expected_file(name).actual_text("stdout", &out).run(); + } + ++#[cfg(not(any(windows, target_os = "dragonfly")))] ++fn terminal_file() -> File { ++ File::create("/dev/ptmx").unwrap() ++} ++ ++#[cfg(target_os = "dragonfly")] ++fn terminal_file() -> File { ++ #[link(name = "util")] ++ extern "C" { ++ fn openpty( ++ amaster: *mut i32, ++ aslave: *mut i32, ++ name: *mut std::ffi::c_char, ++ termp: *const std::ffi::c_void, ++ winp: *const std::ffi::c_void, ++ ) -> i32; ++ } ++ ++ let mut master = -1; ++ let mut slave = -1; ++ let rc = unsafe { ++ openpty( ++ &mut master, ++ &mut slave, ++ std::ptr::null_mut(), ++ std::ptr::null(), ++ std::ptr::null(), ++ ) ++ }; ++ assert_eq!(rc, 0, "openpty failed: {}", std::io::Error::last_os_error()); ++ let master = unsafe { File::from_raw_fd(master) }; ++ std::mem::forget(master); ++ unsafe { File::from_raw_fd(slave) } ++} ++ ++#[cfg(windows)] ++fn terminal_file() -> File { ++ File::options().read(true).write(true).open(r"\\.\CONOUT$").unwrap() ++} ++ + // Test that emitting binary formats to a terminal gives the correct error + fn run_terminal_err_diff(name: &str) { +- #[cfg(not(windows))] +- let terminal = File::create("/dev/ptmx").unwrap(); +- // FIXME: If this test fails and the compiler does print to the console, +- // then this will produce a lot of output. +- // We should spawn a new console instead to print stdout. +- #[cfg(windows)] +- let terminal = File::options().read(true).write(true).open(r"\\.\CONOUT$").unwrap(); ++ let terminal = terminal_file(); + + let err = File::create(name).unwrap(); + rustc().emit(format!("{name}=-")).input("test.rs").stdout(terminal).stderr(err).run_fail(); diff --git a/1.86.0/patches/patch-tests_run-make_foreign-exceptions_rmake.rs b/1.86.0/patches/patch-tests_run-make_foreign-exceptions_rmake.rs new file mode 100644 index 0000000..0f56f22 --- /dev/null +++ b/1.86.0/patches/patch-tests_run-make_foreign-exceptions_rmake.rs @@ -0,0 +1,12 @@ +--- tests/run-make/foreign-exceptions/rmake.rs 2025-03-16 00:27:19.000000000 +0800 ++++ tests/run-make/foreign-exceptions/rmake.rs 2026-06-11 14:52:42.992337000 +0800 +@@ -7,6 +7,9 @@ + + //@ needs-unwind + // Reason: this test exercises panic unwinding ++//@ ignore-dragonfly ++// Reason: DragonFly currently links libgcc_pic statically, and this C++/Rust ++// cross-language unwinding path is not supported yet. + //@ ignore-cross-compile + // Reason: the compiled binary is executed + diff --git a/1.86.0/patches/patch-tests_run-make_foreign-rust-exceptions_rmake.rs b/1.86.0/patches/patch-tests_run-make_foreign-rust-exceptions_rmake.rs new file mode 100644 index 0000000..7148b8b --- /dev/null +++ b/1.86.0/patches/patch-tests_run-make_foreign-rust-exceptions_rmake.rs @@ -0,0 +1,12 @@ +--- tests/run-make/foreign-rust-exceptions/rmake.rs 2025-03-16 00:27:19.000000000 +0800 ++++ tests/run-make/foreign-rust-exceptions/rmake.rs 2026-06-11 14:52:42.992337000 +0800 +@@ -9,6 +9,9 @@ + // Reason: the compiled binary is executed + //@ needs-unwind + // Reason: unwinding panics is exercised in this test ++//@ ignore-dragonfly ++// Reason: DragonFly currently links libgcc_pic statically, so cross-DSO Rust ++// panic classification is not supported yet. + + //@ ignore-i686-pc-windows-gnu + // Reason: This test doesn't work on 32-bit MinGW as cdylib has its own copy of unwinder diff --git a/1.86.0/patches/patch-tests_run-make_rust-lld_rmake.rs b/1.86.0/patches/patch-tests_run-make_rust-lld_rmake.rs new file mode 100644 index 0000000..b2abe5d --- /dev/null +++ b/1.86.0/patches/patch-tests_run-make_rust-lld_rmake.rs @@ -0,0 +1,12 @@ +--- tests/run-make/rust-lld/rmake.rs 2025-03-16 00:27:19.000000000 +0800 ++++ tests/run-make/rust-lld/rmake.rs 2026-06-11 14:52:42.992337000 +0800 +@@ -2,6 +2,9 @@ + // see https://github.com/rust-lang/compiler-team/issues/510 for more info + + //@ needs-rust-lld ++//@ ignore-dragonfly ++// Reason: DragonFly does not currently route the cc linker flavor through ++// bundled rust-lld. + //@ ignore-s390x lld does not yet support s390x as target + + use run_make_support::regex::Regex; diff --git a/1.86.0/patches/patch-tests_ui_amdgpu-require-explicit-cpu.rs b/1.86.0/patches/patch-tests_ui_amdgpu-require-explicit-cpu.rs new file mode 100644 index 0000000..0e3b299 --- /dev/null +++ b/1.86.0/patches/patch-tests_ui_amdgpu-require-explicit-cpu.rs @@ -0,0 +1,12 @@ +--- tests/ui/amdgpu-require-explicit-cpu.rs.orig 2025-04-03 01:01:04.000000000 +0800 ++++ tests/ui/amdgpu-require-explicit-cpu.rs 2026-06-12 01:26:00.000000000 +0800 +@@ -6,6 +6,9 @@ + //@[nocpu] error-pattern: target requires explicitly specifying a cpu + //@[nocpu] build-fail + //@[cpu] compile-flags: -Ctarget-cpu=gfx900 ++// DragonFly compiletest passes the host C compiler as target linker, but this ++// amdgcn target needs the bundled lld linker. ++//@[cpu] compile-flags: -Clinker={{sysroot-base}}/lib/rustlib/{{target}}/bin/rust-lld + //@[cpu] build-pass + + #![feature(no_core, lang_items)] diff --git a/1.86.0/patches/patch-vendor_notify-8.0.0_Cargo.toml b/1.86.0/patches/patch-vendor_notify-8.0.0_Cargo.toml new file mode 100644 index 0000000..9b08a15 --- /dev/null +++ b/1.86.0/patches/patch-vendor_notify-8.0.0_Cargo.toml @@ -0,0 +1,15 @@ +--- vendor/notify-8.0.0/Cargo.toml.orig 2025-04-01 00:00:00 UTC ++++ vendor/notify-8.0.0/Cargo.toml +@@ -53,11 +53,11 @@ macos_kqueue = [ + serde = ["notify-types/serde"] + serialization-compat-6 = ["notify-types/serialization-compat-6"] + +-[target."cfg(any(target_os=\"freebsd\", target_os=\"openbsd\", target_os = \"netbsd\", target_os = \"dragonflybsd\", target_os = \"ios\"))".dependencies.kqueue] ++[target."cfg(any(target_os=\"freebsd\", target_os=\"openbsd\", target_os = \"netbsd\", target_os = \"dragonfly\", target_os = \"ios\"))".dependencies.kqueue] + version = "1.0.8" + +-[target."cfg(any(target_os=\"freebsd\", target_os=\"openbsd\", target_os = \"netbsd\", target_os = \"dragonflybsd\", target_os = \"ios\"))".dependencies.mio] ++[target."cfg(any(target_os=\"freebsd\", target_os=\"openbsd\", target_os = \"netbsd\", target_os = \"dragonfly\", target_os = \"ios\"))".dependencies.mio] + version = "1.0" + features = ["os-ext"] + diff --git a/1.86.0/patches/patch-vendor_openssl-src-111.28.2+1.1.1w_src_lib.rs b/1.86.0/patches/patch-vendor_openssl-src-111.28.2+1.1.1w_src_lib.rs new file mode 100644 index 0000000..353d1c5 --- /dev/null +++ b/1.86.0/patches/patch-vendor_openssl-src-111.28.2+1.1.1w_src_lib.rs @@ -0,0 +1,13 @@ +--- vendor/openssl-src-111.28.2+1.1.1w/src/lib.rs.orig ++++ vendor/openssl-src-111.28.2+1.1.1w/src/lib.rs +@@ -200,6 +200,10 @@ + } + } + ++ if target.contains("dragonfly") { ++ configure.arg("no-devcryptoeng"); ++ } ++ + if target.contains("musl") { + // MUSL doesn't implement some of the libc functions that the async + // stuff depends on, and we don't bind to any of that in any case. diff --git a/checksums.sh b/checksums.sh index b43c76b..3f85f12 100644 --- a/checksums.sh +++ b/checksums.sh @@ -68,6 +68,7 @@ SHA256_rustc_1_82_0_src_tar_gz=7c53f4509eda184e174efa6ba7d5eeb586585686ce8edefc7 SHA256_rustc_1_83_0_src_tar_gz=722d773bd4eab2d828d7dd35b59f0b017ddf9a97ee2b46c1b7f7fac5c8841c6e SHA256_rustc_1_84_1_src_tar_gz=5e2fb5d49628a549f7671b2ccf9855ab379fd442831a7c2af16e0cdcc31bb375 SHA256_rustc_1_85_1_src_tar_gz=0f2995ca083598757a8d9a293939e569b035799e070f419a686b0996fb94238a +SHA256_rustc_1_86_0_src_tar_gz=022a27286df67900a044d227d9db69d4732ec3d833e4ffc259c4425ed71eed80 SHA256_cargo_0_27_0_x86_64_unknown_dragonfly_tar_xz=a0b670f797d01ea156cf3ca9f0a7aa2a76bfa8b35dfa779510cfedc1d82eb19b SHA256_rustc_1_26_0_x86_64_unknown_dragonfly_tar_xz=d14e5d973bfb671535212460d7eca2552379150ffc207712e825f06febdd57c6 From 78b2695d1a1f88b94d559b426ed00d0c89ab61a5 Mon Sep 17 00:00:00 2001 From: LI Leding Date: Tue, 23 Jun 2026 19:29:36 +0800 Subject: [PATCH 2/2] Update Rust 1.85.1 bootstrap checksums --- checksums.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/checksums.sh b/checksums.sh index 3f85f12..77dd543 100644 --- a/checksums.sh +++ b/checksums.sh @@ -302,6 +302,6 @@ SHA256_cargo_1_84_1_x86_64_unknown_dragonfly_tar_xz=521898bff2e342c801a913575d90 SHA256_rustc_1_84_1_x86_64_unknown_dragonfly_tar_xz=6fdbc3619431e5d14d0eaae97aef1b486c13e128e3ad24effca1092d19f6df85 SHA256_rust_std_1_84_1_x86_64_unknown_dragonfly_tar_xz=4c2eb3548bdba1216dfec3c57b02a61f873bffd7bf453f606de4ed907732bb83 -SHA256_cargo_1_85_1_x86_64_unknown_dragonfly_tar_xz=74809bd38062b087d86bf10ee9fa02eaa9f4fd2dafa6fc7d3c75cf475f2345bc -SHA256_rustc_1_85_1_x86_64_unknown_dragonfly_tar_xz=eb17aeac160a05d503dfc21a0e8042eda1cb17afd0ad9739e117451ede5c3aa9 -SHA256_rust_std_1_85_1_x86_64_unknown_dragonfly_tar_xz=39953a3487d841eff5e351e3b254b88a86cce57a7605c2bf6ccb5632909c032b +SHA256_cargo_1_85_1_x86_64_unknown_dragonfly_tar_xz=b97fcaf5b9281ca6b130881303012f93d94e0a565ae2ced2fa1fbf5a525e9706 +SHA256_rustc_1_85_1_x86_64_unknown_dragonfly_tar_xz=c8e57ade7283a75c72b8051bb5a1578705e8d48cd0566029b0ccb08620613129 +SHA256_rust_std_1_85_1_x86_64_unknown_dragonfly_tar_xz=04faba9954e083f6f65f2c4b19f075ef57c0d2768f251c06fe805c8e06d8629f