pkgsrc-Changes archive

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

CVS commit: pkgsrc/lang/rust



Module Name:    pkgsrc
Committed By:   tnn
Date:           Thu Apr 11 19:53:50 UTC 2024

Modified Files:
        pkgsrc/lang/rust: distinfo
        pkgsrc/lang/rust/patches:
            patch-compiler_rustc__codegen__ssa_src_back_linker.rs
            patch-src_bootstrap_src_core_builder.rs

Log Message:
rust: allow linking with external libunwind on Linux


To generate a diff of this commit:
cvs rdiff -u -r1.167 -r1.168 pkgsrc/lang/rust/distinfo
cvs rdiff -u -r1.12 -r1.13 \
    pkgsrc/lang/rust/patches/patch-compiler_rustc__codegen__ssa_src_back_linker.rs
cvs rdiff -u -r1.1 -r1.2 \
    pkgsrc/lang/rust/patches/patch-src_bootstrap_src_core_builder.rs

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

Modified files:

Index: pkgsrc/lang/rust/distinfo
diff -u pkgsrc/lang/rust/distinfo:1.167 pkgsrc/lang/rust/distinfo:1.168
--- pkgsrc/lang/rust/distinfo:1.167     Sun Mar  3 14:57:30 2024
+++ pkgsrc/lang/rust/distinfo   Thu Apr 11 19:53:50 2024
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.167 2024/03/03 14:57:30 he Exp $
+$NetBSD: distinfo,v 1.168 2024/04/11 19:53:50 tnn Exp $
 
 BLAKE2s (rust-1.74.1-aarch64-apple-darwin.tar.gz) = 6cc3cfda101661332815ce9f27781eb73d5b10abead309c0fe3649d428abb2ae
 SHA512 (rust-1.74.1-aarch64-apple-darwin.tar.gz) = 26b5e2dfead0f48284dc89dde18978285c9d9d4afb310a859d2876aa2abdf1500fb69756b530312c0ceb7da4a309c0319dfa7ea539a800522edd67afd95f7ac2
@@ -114,7 +114,7 @@ Size (rust-std-1.74.1-x86_64-unknown-net
 BLAKE2s (rustc-1.75.0-src.tar.gz) = ce73634181497293f543514b5e22b059b9f7b4d102766db8beaa76fd9baf7db4
 SHA512 (rustc-1.75.0-src.tar.gz) = c0fbc7349082bdda5693664f86e2814e3a15272dd1b5028859e9d0d864b4375fae94b7039e14567d25bc9c3c4d8187734a163a2522b75cb1f267f7b9e57c3385
 Size (rustc-1.75.0-src.tar.gz) = 285857065 bytes
-SHA1 (patch-compiler_rustc__codegen__ssa_src_back_linker.rs) = 62819cf6db7d2e3e77d433fe883046c28fc20d91
+SHA1 (patch-compiler_rustc__codegen__ssa_src_back_linker.rs) = a401c9860c7d4e0f76e1e0616de50a9044382136
 SHA1 (patch-compiler_rustc__llvm_build.rs) = a4a66d449fc9eb99d648d02a041778a68f4f7ce8
 SHA1 (patch-compiler_rustc__target_src_spec_base_netbsd.rs) = 7fb6ec6d45a9bf4525c675390117e9e61b8023cd
 SHA1 (patch-compiler_rustc__target_src_spec_mod.rs) = a22b5d28997ed9a5565deec9c34322165d563d00
@@ -127,7 +127,7 @@ SHA1 (patch-library_std_src_sys_unix_thr
 SHA1 (patch-src_bootstrap_bootstrap.py) = 5cd73003292c935ce0e405edd132180233a04857
 SHA1 (patch-src_bootstrap_src_core_build__steps_compile.rs) = 4696304623232acd419ad15597f539a10a014271
 SHA1 (patch-src_bootstrap_src_core_build__steps_llvm.rs) = aba4c50ffd0a037096ea34a5e9660f8b435d997f
-SHA1 (patch-src_bootstrap_src_core_builder.rs) = 557721367140fe1078ce9948296f1a747fab56f0
+SHA1 (patch-src_bootstrap_src_core_builder.rs) = ec809ca54600aaa805cf8431cbb4a865693e6102
 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

Index: pkgsrc/lang/rust/patches/patch-compiler_rustc__codegen__ssa_src_back_linker.rs
diff -u pkgsrc/lang/rust/patches/patch-compiler_rustc__codegen__ssa_src_back_linker.rs:1.12 pkgsrc/lang/rust/patches/patch-compiler_rustc__codegen__ssa_src_back_linker.rs:1.13
--- pkgsrc/lang/rust/patches/patch-compiler_rustc__codegen__ssa_src_back_linker.rs:1.12 Wed Oct 25 05:50:43 2023
+++ pkgsrc/lang/rust/patches/patch-compiler_rustc__codegen__ssa_src_back_linker.rs      Thu Apr 11 19:53:50 2024
@@ -1,10 +1,11 @@
-$NetBSD: patch-compiler_rustc__codegen__ssa_src_back_linker.rs,v 1.12 2023/10/25 05:50:43 pin Exp $
+$NetBSD: patch-compiler_rustc__codegen__ssa_src_back_linker.rs,v 1.13 2024/04/11 19:53:50 tnn Exp $
 
 Do not use @rpath on Darwin.
+Find external linunwind on Linux.
 
---- 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.orig 2023-12-21 16:55:28.000000000 +0000
 +++ compiler/rustc_codegen_ssa/src/back/linker.rs
-@@ -325,7 +325,7 @@ impl<'a> GccLinker<'a> {
+@@ -329,7 +329,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 {
@@ -13,3 +14,14 @@ Do not use @rpath on Darwin.
                  rpath.push(out_filename.file_name().unwrap());
                  self.linker_args(&[OsString::from("-install_name"), rpath]);
              }
+@@ -455,6 +455,10 @@ impl<'a> Linker for GccLinker<'a> {
+                 self.linker_arg("--as-needed");
+             }
+         }
++        if self.sess.target.os.contains("linux") && lib == "unwind" {
++            self.linker_arg("-rpath,@PREFIX@/lib");
++            self.linker_arg("-L@PREFIX@/lib");
++        }
+     }
+     fn link_staticlib(&mut self, lib: &str, verbatim: bool) {
+         self.hint_static();

Index: pkgsrc/lang/rust/patches/patch-src_bootstrap_src_core_builder.rs
diff -u pkgsrc/lang/rust/patches/patch-src_bootstrap_src_core_builder.rs:1.1 pkgsrc/lang/rust/patches/patch-src_bootstrap_src_core_builder.rs:1.2
--- pkgsrc/lang/rust/patches/patch-src_bootstrap_src_core_builder.rs:1.1        Sun Mar  3 14:53:32 2024
+++ pkgsrc/lang/rust/patches/patch-src_bootstrap_src_core_builder.rs    Thu Apr 11 19:53:50 2024
@@ -1,8 +1,9 @@
-$NetBSD: patch-src_bootstrap_src_core_builder.rs,v 1.1 2024/03/03 14:53:32 he Exp $
+$NetBSD: patch-src_bootstrap_src_core_builder.rs,v 1.2 2024/04/11 19:53:50 tnn Exp $
 
 Use @PREFIX@, not $ORIGIN in rpath.
+Find external libunwind on Linux.
 
---- src/bootstrap/src/core/builder.rs.orig     2024-01-13 20:06:50.748741545 +0000
+--- src/bootstrap/src/core/builder.rs.orig     2023-12-21 16:55:28.000000000 +0000
 +++ src/bootstrap/src/core/builder.rs
 @@ -1678,7 +1678,7 @@ impl<'a> Builder<'a> {
                  && !target.contains("xous")
@@ -13,3 +14,15 @@ Use @PREFIX@, not $ORIGIN in rpath.
              } else {
                  None
              };
+@@ -2095,6 +2095,11 @@ impl<'a> Builder<'a> {
+             rustflags.arg("-Zinline-mir");
+         }
+ 
++        // added for pkgsrc libunwind
++        if target.contains("linux") {
++            rustflags.arg("-Clink-args=-Wl,-rpath,@PREFIX@/lib,-L@PREFIX@/lib");
++        }
++
+         // set rustc args passed from command line
+         let rustc_args =
+             self.config.cmd.rustc_args().iter().map(|s| s.to_string()).collect::<Vec<_>>();



Home | Main Index | Thread Index | Old Index