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

Add support for ARMv5TE architecture #37615

Merged
merged 2 commits into from
Nov 12, 2016
Merged

Conversation

atilag
Copy link
Contributor

@atilag atilag commented Nov 6, 2016

No description provided.

@rust-highfive
Copy link
Collaborator

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @nrc (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@japaric
Copy link
Member

japaric commented Nov 6, 2016

r? @alexcrichton


options: TargetOptions {
features: "+soft-float".to_string(),
max_atomic_width: Some(64),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LLVM can't lower atomic stuff to actual ARMv5 instructions because there are no instructions in the instruction set to implement atomics. This is going to require something like rust-lang/compiler-builtins#115

cc @Amanieu

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even with my PR the maximum atomic width would be 32 bits, not 64 bits.

@alexcrichton
Copy link
Member

cc @rust-lang/tools, thoughts on adding a new target?

@alexcrichton
Copy link
Member

Thanks for the PR @atilag! Could you also expand a bit on your use case for this target and why you'd like to see it in the compiler itself? (as opposed to using custom target specs)

@Amanieu
Copy link
Member

Amanieu commented Nov 7, 2016

Another question is, should we also add support for ARMv4T as a target? This is the minimum architecture that Debian armel requires.

@atilag
Copy link
Contributor Author

atilag commented Nov 7, 2016

Hi guys!
Well, me and me colleagues were trying to build a project around a hardware that, despite of being a little oldish, seems to be still very common in IoT based products. We could use other technologies, like C/C++ of course, but our experience in Rust is being very positive and we would love to keep using it and prove that Rust is a valid option even for these elderly platforms. We don't have special desires to include it as part of the compiler, so maybe using a custom target would work for us, but, is there any strong reason to not include it?
Thanks guys!
Keep up the good work!

@japaric
Copy link
Member

japaric commented Nov 7, 2016

@alexcrichton

Not the OP but if they are building std programs then having the target in-tree + binary releases of std is the most ergonomic option until we get std-aware Cargo. Or, IOW, compiling std for custom targets is a pain in the neck.

@Amanieu

Do you know for how long does Debian intent to provide ARMv4+ support?

@fabricedesre
Copy link
Contributor

Indeed we are building std programs (the OS is Linux), so having an in-tree target helps.

@Amanieu
Copy link
Member

Amanieu commented Nov 7, 2016

@japaric I don't think Debian has any intention of dropping armel any time soon. Debian currently supports only two ARM variants: armel (ARMv4t+, soft float) and armhf (ARMv7+, hard float).

@atilag
Copy link
Contributor Author

atilag commented Nov 7, 2016

@japaric @Amanieu @Amanieu so I have updated the max_atomic_width to 32 bits. I guess that we need to merge rust-lang/compiler-builtins#115 before merging this one, right?

@japaric
Copy link
Member

japaric commented Nov 7, 2016

@atilag #36992 would have to land as well.

@Amanieu
Copy link
Member

Amanieu commented Nov 7, 2016

We also need to decide whether we want to support ARMv4T, ARMv5TE, or both.

@atilag
Copy link
Contributor Author

atilag commented Nov 8, 2016

@Amanieu I guess that in case we need to support ARMv4T, this could be done in another PR.
My understanding is that supporting ARMv5TE would only increase the added value of the language, so the question would be whether there's any drawback that outperforms this support. If we don't want to deal with a potential instability because of the atomic support, is there any way to mark this support as "unstable" or "experimental" ?

@alexcrichton
Copy link
Member

Thanks for the explanation @atilag! I think we should hold off on armv4 here and perhaps add that in a future PR (if at all).

If ARMv5 doesn't have atomic instructions, though, then the current stance of the libs team is to set the max_atomic_width field to Some(0) as we can't actually create any instructions there. The fallbacks in compiler-builtins are intended to be optional for other use cases, if needed. We haven't figured out a great story yet, unfortunately, for pulling in those intrinsics on demand.

@alexcrichton
Copy link
Member

@bors: r+

Thanks @atilag! cc @rust-lang/tools, a new target, but not necessarily libstd support just yet

@bors
Copy link
Contributor

bors commented Nov 10, 2016

📌 Commit 365ea80 has been approved by alexcrichton

@brson brson added the relnotes Marks issues that should be documented in the release notes of the next release. label Nov 11, 2016
eddyb added a commit to eddyb/rust that referenced this pull request Nov 11, 2016
eddyb added a commit to eddyb/rust that referenced this pull request Nov 12, 2016
bors added a commit that referenced this pull request Nov 12, 2016
@bors bors merged commit 365ea80 into rust-lang:master Nov 12, 2016
bors added a commit that referenced this pull request Dec 28, 2017
Add armv4t-unknown-linux-gnueabi target

armv4t was left out of #37615 (armv5te addition) to be included in a [future PR](#37615 (comment)).  So this PR adds armv4t target.

armv4t target is useful because the [armel](https://wiki.debian.org/ArmEabiPort) port of Debian targets armv4t
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
relnotes Marks issues that should be documented in the release notes of the next release.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants