pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

rust183: apply fix for cross-compile problem.



Module Name:	pkgsrc-wip
Committed By:	Havard Eidnes <he%NetBSD.org@localhost>
Pushed By:	he
Date:		Thu Jan 23 17:00:12 2025 +0000
Changeset:	9a9c9c8998d7d4b9f540b8ac02a5aacb551b63f2

Modified Files:
	rust183/Makefile
	rust183/distinfo
	rust183/patches/patch-src_bootstrap_src_core_builder.rs

Log Message:
rust183: apply fix for cross-compile problem.

This is https://github.com/rust-lang/rust/issues/133629

and this undoes the following commit:

https://github.com/rust-lang/rust/pull/130899/commits/68034f837a39387e49fc7d7c5b088f5372a1127e

per the discussion in that issue.
Thanks to Fabian-Gruenbichler from Debian for the suggestion / fix.

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=9a9c9c8998d7d4b9f540b8ac02a5aacb551b63f2

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 rust183/Makefile                                   |  1 +
 rust183/distinfo                                   |  6 +--
 .../patch-src_bootstrap_src_core_builder.rs        | 48 ++++++++++++++++------
 3 files changed, 40 insertions(+), 15 deletions(-)

diffs:
diff --git a/rust183/Makefile b/rust183/Makefile
index 7b0dc2c5aa..183b776489 100644
--- a/rust183/Makefile
+++ b/rust183/Makefile
@@ -61,6 +61,7 @@ CONFIGURE_ARGS+=	${ADD_CONFIGURE_ARGS}
 # uncommenting the LD_LIBRARY_PATH setting may be required to run
 # the bootstrap
 PKGSRC_MAKE_ENV+=	LD_LIBRARY_PATH=${RUST_BOOTSTRAP_PATH:Q}/lib
+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.
diff --git a/rust183/distinfo b/rust183/distinfo
index 697ccc0d22..2b5f555882 100644
--- a/rust183/distinfo
+++ b/rust183/distinfo
@@ -121,13 +121,13 @@ SHA1 (patch-library_backtrace_src_symbolize_gimli.rs) = 9d5ef634c5a454e474ea5fee
 SHA1 (patch-library_backtrace_src_symbolize_gimli_elf.rs) = 3b84a462c6bc8245d579452e4c37e3ce13314952
 SHA1 (patch-library_std_src_sys_pal_unix_mod.rs) = bfc59ae4568547e3ed71c8b31ba5b5b5363d5d40
 SHA1 (patch-library_stdarch_crates_std__detect_tests_cpu-detection.rs) = 97c3ad8ea39c25d41256fcad80fae1e6e4970124
-SHA1 (patch-src_bootstrap_bootstrap.py) = 150a5a7e057de9edbf96f3c387207fda8ba750f9
+SHA1 (patch-src_bootstrap_bootstrap.py) = d6d6a1ae33f497429ddadb9a7e3de0d1fc07446f
 SHA1 (patch-src_bootstrap_src_core_build__steps_compile.rs) = e928203ed4734c93cc33c5a3f7879cf18dcecc83
 SHA1 (patch-src_bootstrap_src_core_build__steps_install.rs) = cc6558df42c9c9ac28fdb2ff180bdaa7f22ce816
-SHA1 (patch-src_bootstrap_src_core_builder.rs) = 6d76366201097adc56e494fa05ebbc1696bb2d98
+SHA1 (patch-src_bootstrap_src_core_builder.rs) = 952c31f21698daedf74eb9d0efece1c0ca1105bb
 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_cmake_modules_AddLLVM.cmake) = 17bdc90c83af12b983a1b45d1f2efbba8962cbe7
 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
diff --git a/rust183/patches/patch-src_bootstrap_src_core_builder.rs b/rust183/patches/patch-src_bootstrap_src_core_builder.rs
index 1f281b7ed6..fcc7555523 100644
--- a/rust183/patches/patch-src_bootstrap_src_core_builder.rs
+++ b/rust183/patches/patch-src_bootstrap_src_core_builder.rs
@@ -1,11 +1,44 @@
 $NetBSD: patch-src_bootstrap_src_core_builder.rs,v 1.5 2024/07/27 02:35:24 tnn Exp $
 
 Find external libunwind on Linux.
-Use @PREFIX@, not $ORIGIN in rpath.
+Use @PREFIX@ in rpath.
 
---- src/bootstrap/src/core/builder.rs.orig	2006-07-24 01:21:28.000000000 +0000
+Also, following up on
+https://github.com/rust-lang/rust/issues/133629, reverse
+https://github.com/rust-lang/rust/pull/130899/commits/68034f837a39387e49fc7d7c5b088f5372a1127e
+to see if this fixes the cross-compile failure.
+
+--- src/bootstrap/src/core/builder.rs.orig	2024-11-26 10:12:09.000000000 +0000
 +++ src/bootstrap/src/core/builder.rs
-@@ -2211,6 +2211,11 @@ impl<'a> Builder<'a> {
+@@ -1698,24 +1698,10 @@ impl<'a> Builder<'a> {
+         match mode {
+             Mode::Std | Mode::ToolBootstrap | Mode::ToolStd => {}
+             Mode::Rustc | Mode::Codegen | Mode::ToolRustc => {
+-                // Build proc macros both for the host and the target unless proc-macros are not
+-                // supported by the target.
++		// Build proc macros both for the host and the target
+                 if target != compiler.host && cmd_kind != Kind::Check {
+-                    let error = command(self.rustc(compiler))
+-                        .arg("--target")
+-                        .arg(target.rustc_target_arg())
+-                        .arg("--print=file-names")
+-                        .arg("--crate-type=proc-macro")
+-                        .arg("-")
+-                        .run_capture(self)
+-                        .stderr();
+-                    let not_supported = error
+-                        .lines()
+-                        .any(|line| line.contains("unsupported crate type `proc-macro`"));
+-                    if !not_supported {
+-                        cargo.arg("-Zdual-proc-macros");
+-                        rustflags.arg("-Zdual-proc-macros");
+-                    }
++		    cargo.arg("-Zdual-proc-macros");
++		    rustflags.arg("-Zdual-proc-macros");
+                 }
+             }
+         }
+@@ -2262,6 +2248,11 @@ impl<'a> Builder<'a> {
              rustdocflags.arg("--cfg=parallel_compiler");
          }
  
@@ -17,12 +50,3 @@ Use @PREFIX@, not $ORIGIN in rpath.
          Cargo {
              command: cargo,
              compiler,
-@@ -2557,7 +2562,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
-             };


Home | Main Index | Thread Index | Old Index