pkgsrc-WIP-changes archive

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

Tentatively add support for NetBSD i586/pentium build.



Module Name:	pkgsrc-wip
Committed By:	Havard Eidnes <he%NetBSD.org@localhost>
Pushed By:	he
Date:		Sun Apr 11 13:06:37 2021 +0200
Changeset:	16102b08d7d008598d03b2731ffa352e322efb90

Modified Files:
	rust/distinfo
Added Files:
	rust/patches/patch-compiler_rustc__target_src_spec_i586__unknown__netbsd.rs
	rust/patches/patch-compiler_rustc__target_src_spec_mod.rs

Log Message:
Tentatively add support for NetBSD i586/pentium build.

Does not work yet, at least as I can tell: cannot cross-build
from amd64 because the second LLVM build (for the i586 target)
fails to find and use -latomic.

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

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

diffstat:
 rust/distinfo                                      |  2 ++
 ...rustc__target_src_spec_i586__unknown__netbsd.rs | 27 ++++++++++++++++++++++
 .../patch-compiler_rustc__target_src_spec_mod.rs   | 12 ++++++++++
 3 files changed, 41 insertions(+)

diffs:
diff --git a/rust/distinfo b/rust/distinfo
index 926fd4c837..88c92f7ce5 100644
--- a/rust/distinfo
+++ b/rust/distinfo
@@ -98,6 +98,8 @@ SHA512 (rustc-1.51.0-src.tar.gz) = 694189c7d48537b29fdf39e1b4cac58166c72d8e5adef
 Size (rustc-1.51.0-src.tar.gz) = 160954811 bytes
 SHA1 (patch-compiler_rustc__codegen__ssa_src_back_linker.rs) = ce864839b3bce0755b950d914164e707a3f4eb68
 SHA1 (patch-compiler_rustc__llvm_build.rs) = b5157022f0f1942ae2db1ab78145af1526780b18
+SHA1 (patch-compiler_rustc__target_src_spec_i586__unknown__netbsd.rs) = 8016df2ef0cf1e82b62d18ef156da9806988cb79
+SHA1 (patch-compiler_rustc__target_src_spec_mod.rs) = ddeea167481f6e09b9d927091a3452eb3699e8be
 SHA1 (patch-compiler_rustc__target_src_spec_netbsd__base.rs) = b0254ca5a13deb345716338b01f04f0a063a3902
 SHA1 (patch-compiler_rustc__target_src_spec_solaris__base.rs) = f0b41a3a5685ae33d037f8ded0b1fa6f1acb0867
 SHA1 (patch-library_backtrace_crates_backtrace-sys_src_libbacktrace_configure) = 5dc1cfc843894156b513c86453db5032917a5529
diff --git a/rust/patches/patch-compiler_rustc__target_src_spec_i586__unknown__netbsd.rs b/rust/patches/patch-compiler_rustc__target_src_spec_i586__unknown__netbsd.rs
new file mode 100644
index 0000000000..8506d30539
--- /dev/null
+++ b/rust/patches/patch-compiler_rustc__target_src_spec_i586__unknown__netbsd.rs
@@ -0,0 +1,27 @@
+$NetBSD$
+
+Add an i586 / pentium variant, in an effort to support AMD Geode etc.
+
+--- compiler/rustc_target/src/speci586_unknown_netbsd.rs.orig	2021-04-11 00:12:43.084770395 +0200
++++ compiler/rustc_target/src/spec/i586_unknown_netbsd.rs	2021-04-11 00:15:29.313073646 +0200
+@@ -0,0 +1,20 @@
++use crate::spec::{LinkerFlavor, StackProbeType, Target, TargetOptions};
++
++pub fn target() -> Target {
++    let mut base = super::netbsd_base::opts();
++    base.cpu = "pentium".to_string();
++    base.max_atomic_width = Some(64);
++    base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap().push("-m32".to_string());
++    // don't use probe-stack=inline-asm until rust-lang/rust#83139 is resolved.
++    base.stack_probes = StackProbeType::Call;
++
++    Target {
++        llvm_target: "i586-unknown-netbsdelf".to_string(),
++        pointer_width: 32,
++        data_layout: "e-m:e-p:32:32-p270:32:32-p271:32:32-p272:64:64-\
++            f64:32:64-f80:32-n8:16:32-S128"
++            .to_string(),
++        arch: "x86".to_string(),
++        options: TargetOptions { mcount: "__mcount".to_string(), ..base },
++    }
++}
diff --git a/rust/patches/patch-compiler_rustc__target_src_spec_mod.rs b/rust/patches/patch-compiler_rustc__target_src_spec_mod.rs
new file mode 100644
index 0000000000..22bfc7d33b
--- /dev/null
+++ b/rust/patches/patch-compiler_rustc__target_src_spec_mod.rs
@@ -0,0 +1,12 @@
+$NetBSD$
+
+--- compiler/rustc_target/src/spec/mod.rs.orig	2021-03-23 16:15:10.000000000 +0000
++++ compiler/rustc_target/src/spec/mod.rs
+@@ -697,6 +697,7 @@ supported_targets! {
+     ("aarch64-unknown-netbsd", aarch64_unknown_netbsd),
+     ("armv6-unknown-netbsd-eabihf", armv6_unknown_netbsd_eabihf),
+     ("armv7-unknown-netbsd-eabihf", armv7_unknown_netbsd_eabihf),
++    ("i586-unknown-netbsd", i586_unknown_netbsd),
+     ("i686-unknown-netbsd", i686_unknown_netbsd),
+     ("powerpc-unknown-netbsd", powerpc_unknown_netbsd),
+     ("sparc64-unknown-netbsd", sparc64_unknown_netbsd),


Home | Main Index | Thread Index | Old Index