Page MenuHomeFreeBSD

lang/rust: Update to 1.51.0
ClosedPublic

Authored by tobik on Mar 26 2021, 10:14 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Dec 16, 4:15 AM
Unknown Object (File)
Sat, Dec 14, 8:51 PM
Unknown Object (File)
Fri, Nov 29, 8:00 AM
Unknown Object (File)
Nov 24 2024, 9:45 PM
Unknown Object (File)
Nov 24 2024, 5:57 PM
Unknown Object (File)
Nov 24 2024, 11:08 AM
Unknown Object (File)
Nov 23 2024, 5:52 AM
Unknown Object (File)
Nov 22 2024, 1:59 PM

Details

Summary

https://blog.rust-lang.org/2021/03/25/Rust-1.51.0.html

Bootstraps are currently pre rP569007, so do not have the RUST_BACKTRACE fix, except for the aarch64 which was built with rP569245.

I've added the simple patch from D28520. Not sure which direction is actually the faster one or if they are the same, but this should be safe to make for now without causing extra work.

Test Plan

ref13-aarch64 ok
ref13-amd64 ok
ref13-i386 ok
ref13-ppc64 ok
ref12-ppc64 ok

powerpc64le does not have a reference machine AFAICT. @pkubaj Can you test it?

Exp-run: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=254578

Diff Detail

Repository
rP FreeBSD ports repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

tobik held this revision as a draft.
  • Update lang/rust-bootstrap too
tobik published this revision for review.Mar 26 2021, 10:50 AM
tobik edited the test plan for this revision. (Show Details)
tobik added a subscriber: pkubaj.
  • Unbreak ppc64 elfv1 build when LOCALBASE != /usr/local (like on ref12-ppc64 with INSTALL_AS_USER packages)

RUST_BACKTRACE seems to be broken (as in PR 253557) on ppc64 elfv1. No idea why but it also does not seem worth fixing to me. It works fine on the other tested systems.

I have compilation issues on powerpc64le (related to the spec file) and am investigating this.

If powerpc64 elfv1 is the troublesome, I'd say it would be fine to ditch it, especially since 13.0 is going out soon anyway. Firefox doesn't work on elfv1 anyway.
I wouldn't be surprised if elfv1 support in Rust got broken anyway. AFAIK all the popular ppc64 Linux distros switched to elfv2.

lang/rust/files/powerpc64le/patch-compiler_rustc__target_src_spec_powerpc64le__unknown__freebsd.rs needs to be changed to:

--- compiler/rustc_target/src/spec/powerpc64le_unknown_freebsd.rs.orig  2021-01-07 03:05:53 UTC
+++ compiler/rustc_target/src/spec/powerpc64le_unknown_freebsd.rs
@@ -0,0 +1,16 @@
+use crate::spec::{LinkerFlavor, Target, TargetOptions};
+
+pub fn target() -> Target {
+    let mut base = super::freebsd_base::opts();
+    base.cpu = "ppc64le".to_string();
+    base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap().push("-m64".to_string());
+    base.max_atomic_width = Some(64);
+
+    Target {
+       llvm_target: "powerpc64le-unknown-freebsd".to_string(),
+       pointer_width: 64,
+       data_layout: "e-m:e-i64:64-n32:64".to_string(),
+       arch: "powerpc64".to_string(),
+       options: TargetOptions { mcount: "_mcount".to_string(), ..base },
+    }
+}
  • Fix whitespace in powerpc64le patch header (copy&paste does not work that well for patches)

I have compilation issues on powerpc64le (related to the spec file) and am investigating this.

If powerpc64 elfv1 is the troublesome, I'd say it would be fine to ditch it, especially since 13.0 is going out soon anyway. Firefox doesn't work on elfv1 anyway.
I wouldn't be surprised if elfv1 support in Rust got broken anyway. AFAIK all the popular ppc64 Linux distros switched to elfv2.

Well it is working now, so no reason to remove it just yet. There are more ports that use Rust too. For example librsvg2-rust which desktop ports depend on. We could switch elfv1 to use legacy librsvg if it ever came down to it though.

In the end as long as ports still support elfv1 I think we should keep elfv1 support in Rust on a best effort basis anyway.

lang/rust/files/powerpc64le/patch-compiler_rustctarget_src_spec_powerpc64leunknown__freebsd.rs needs to be changed to:

Done, but can somebody actually upstream the powerpc64le spec? I see that it was not done yet. You or maybe @bdragon?

  • Unbreak racer (update to 2.1.44)
  • Sync patch-src_bootstrap_native.rs description with rust-nightly

The right description must have either been lost sometime ago or was never updated after the LLVM DESTDIR fix was pruned from it.

Can you also bump rust version in Mk/bsd.gecko.mk ?

Can you also bump rust version in Mk/bsd.gecko.mk ?

Sure. I really should get around to create that USES=rust at some point...

  • Bump rust version in bsd.gecko.mk too

Exp-run was fine.

Please let me know if you think this is ready on non-x86 archs.

It's ok on armv7, aarch64

This revision was not accepted when it landed; it landed in state Needs Review.Mar 29 2021, 6:07 PM
Closed by commit rP569489: lang/rust: Update to 1.51.0 (authored by tobik). · Explain Why
This revision was automatically updated to reflect the committed changes.