Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mrustc: update to 20221110 #16284

Merged
merged 1 commit into from
Nov 11, 2022
Merged

mrustc: update to 20221110 #16284

merged 1 commit into from
Nov 11, 2022

Conversation

catap
Copy link
Contributor

@catap catap commented Oct 3, 2022

Description

Here the initial support of arm64.

Type(s)
  • enhancement
Tested on

macOS 12.6 21G115 arm64
Xcode 13.1 13A1030d

macOS 12.6 21G115 x86_64
Xcode 14.0.1 14A400

Verification

Have you

@catap catap marked this pull request as draft October 3, 2022 22:52
@barracuda156
Copy link
Contributor

barracuda156 commented Oct 7, 2022

@catap Why is it blocked by upstream though? arm64 is only going to get bigger. Intel is a thing of the past.
And then, Power systems are there (though not on Macs anymore).

@catap
Copy link
Contributor Author

catap commented Oct 11, 2022

@barracuda156 it requires unmerged patches to upstream :)

@pmetzger
Copy link
Member

This has been sitting around for quite a while...

@catap
Copy link
Contributor Author

catap commented Oct 26, 2022

@pmetzger I'm waiting for upstream to react to the thepowersgang/mrustc#292

This is a bit tricky and can broke something => I prefer to keep it as draft until it is reviewed and merged by upstream.

@catap catap marked this pull request as ready for review November 10, 2022 09:14
@catap
Copy link
Contributor Author

catap commented Nov 10, 2022

@pmetzger upstream is merged all required patches.

I've worked very hard to bring mrustc to arm64 and here it is.

To best of my knowledge it is as good as it can be and ready to merge.

@barracuda156
Copy link
Contributor

@catap So arch hardcoding is gone? We can try PPC?

@catap
Copy link
Contributor Author

catap commented Nov 10, 2022

@barracuda156 I've replaced the hardcoded place to support arm64 :)

Anyway, PPC requires future patches, at least it should be defined here: https://github.com/thepowersgang/mrustc/blob/b4556a7bb4519831e03d3a95448e0881923a16e0/src/trans/target.cpp#L570-L595 and it requires to define ARCH_POWERPC at beginning of this file.

i386 seems that it might work out of the box. But I haven't tested it or tried it.

So, short summary:

  • mrustc is quite possible to be ready to support ppc with some work, and i386 out of box;
  • I assume that i386 version of rustc which is bootstraped by mrustc is also durable.

Anyway, I suggest to wait with ppc until mrustc can bootstrap a rust which can use gcc as backend, that makes things much easy to support ppc.

@catap catap changed the title mrustc: update to 20221001 mrustc: update to 20221110 Nov 11, 2022
@catap
Copy link
Contributor Author

catap commented Nov 11, 2022

@reneeotten I'm a maintainer of this port. May I ask you to merge this PR? Thanks.

@kencu kencu merged commit eb7b394 into macports:master Nov 11, 2022
@catap catap deleted the mrustc branch November 11, 2022 18:22
@catap
Copy link
Contributor Author

catap commented Nov 11, 2022

Thanks Ken!

@barracuda156
Copy link
Contributor

@catap I get this:

Failed to parse file lang/mrustc/Portfile: can't read "rust_platforms()": no such element in array

@catap
Copy link
Contributor Author

catap commented Nov 12, 2022

@barracuda156 seems that you've tried it on unsupported (yet) platforms => if so, feel free to add your platform to this list.

I really doubt that PPC works. But i386 might. You may ass i386 i686 to platforms array, that should allow you to test it.

@barracuda156
Copy link
Contributor

I really doubt that PPC works. But i386 might. You may ass i386 i686 to platforms array, that should allow you to test it.

Well, parsing the portfile should work on all platforms, I guess? I am aware that building for PPC is not [yet] supported.

@catap
Copy link
Contributor Author

catap commented Nov 12, 2022

@barracuda156 indeed.

#16653

@barracuda156
Copy link
Contributor

@catap Just for the record, it still fails trying to build an x86 component:

(0/13) BUILDING core v0.0.0
> /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_mrustc/mrustc/work/mrustc-1b1416bb2b44e2c331c7201833305cac29d571e8/bin/mrustc rustc-1.54.0-src/library/core/src/lib.rs -o output-1.54.0/libcore.rlib --crate-name core --crate-type rlib -C emit-depfile=output-1.54.0/libcore.rlib.d --crate-tag 0_0_0 --cfg debug_assertions -O -L output-1.54.0 --edition 2018
rustc-1.54.0-src/library/core/src/../../stdarch/crates/core_arch/src/x86/avx2.rs:520: error:0:Type mismatch between [u32; 8] and [u32; 576460752303423488] - sizes differ
rustc-1.54.0-src/library/core/src/../../stdarch/crates/core_arch/src/x86/avx2.rs:520: note: From here
Process was terminated with signal 6

@catap
Copy link
Contributor Author

catap commented Nov 13, 2022

@barracuda156 seems that cross compilation doesn't detects the CPU features right :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

5 participants