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

Fix compilation errors for Armv8-M Baseline and Mainline with FPU #276

Merged
merged 3 commits into from
Mar 14, 2019

Conversation

hug-dev
Copy link
Contributor

@hug-dev hug-dev commented Mar 14, 2019

The larger goal of this pull request is to add thumbv8m.base-none-eabi and thumbv8m.main-none-eabihf targets to the Rust CI so that the artefacts are available via rustup
This pull request specifically fixes the compilation errors encountered when compiling for those targets.

On the way, I added some modifications, not strictly related with those goals and that need to be checked:

  • removed from exclusion some Arm assembly files for the FPU targets. I tried to assemble those files independantly with arm-none-eabi-gcc with the same options used by cc-rs and it was working correctly. Maybe I am missing something on why are these files excluded?
  • removed the cfg(not(thumbv6m)) from the intrinsics example as the "real" functions were compiling fine for thumbv6m (and then also thumbv8m.base)? I suppose that the intrinsics were implemented for those targets after the cfg was made. I suppose then that Operations not available on ARMv6-M targets #75 should be closed? Again, maybe I am missing something.

I was not sure how to test it so I compiled the intrinsics example for the Arm targets:

cargo build --example intrinsics --features="c compiler-builtins" --target thumbv6m-none-eabi
cargo build --example intrinsics --features="c compiler-builtins" --target thumbv6m-none-eabi
cargo build --example intrinsics --features="c compiler-builtins" --target thumbv7m-none-eabi
cargo build --example intrinsics --features="c compiler-builtins" --target thumbv7em-none-eabi
cargo build --example intrinsics --features="c compiler-builtins" --target thumbv7em-none-eabihf 

Also I patched the Rust compiler with my local modified version of compiler-builtins and produced the distribution artefacts, successfully, for all the Arm targets again:

./x.py dist --target thumbv6m-none-eabi
./x.py dist --target thumbv7m-none-eabi
./x.py dist --target thumbv7em-none-eabihf
./x.py dist --target thumbv7em-none-eabi
./x.py dist --target thumbv8m.main-none-eabi
./x.py dist --target thumbv8m.main-none-eabihf
./x.py dist --target thumbv8m.base-none-eabi

hug-dev added 3 commits March 14, 2019 12:58
Armv8-M Baseline, ie thumbv8m.base-none-eabi, is a superset of the
Armv6-M architecture profile. As it shares almost the same instruction
set, this commit copies the configuration for thumbv6m-none-eabi to
enable it.
Some files were not assembling for the Armv8-M Mainline architecture
profile with FPU extension. Reason being the same as for Armv7-M: the
conversion intrinsics including double precision floating
point variables do not work with single precision FPUs.
Also removes from exclusion files that are assembling without errors for
Armv7-M and Armv8-M Mainline.
It seems that the intrinsics that were generated for the functions in
example/intrinsics.rs where different implementations were given for
thumb6m-none-eabi target, have now been implemented in Rust so
configuration is not needed anymore.
@Amanieu
Copy link
Member

Amanieu commented Mar 14, 2019

LGTM, and travis is happy.

@alexcrichton alexcrichton merged commit 4078c99 into rust-lang:master Mar 14, 2019
@alexcrichton
Copy link
Member

Thanks @hug-dev!

@hug-dev
Copy link
Contributor Author

hug-dev commented Mar 14, 2019

Thanks!
Should a release be made prior to my pull request to the Rust repository that will use this PR changes? I could also make the PR first.

@alexcrichton
Copy link
Member

We can make a release when necessary yeah, but for now you'll probably want to use [patch] while developing. When the PR is ready to go we can publish these changes and then update the PR to use the published version

@hug-dev
Copy link
Contributor Author

hug-dev commented Mar 14, 2019

Cool, will prepare the PR :)

bors added a commit to rust-lang/rust that referenced this pull request Mar 20, 2019
Add dist builder for Armv8-M Baseline and HF

This commit adds the Armv8-M Baseline and Armv8-M Mainline with
FPU targets in the list of targets that
get their dist components built. It also update the build-manifest
so that this target gets also its dist components uploaded.

Made possible with the recent change merged in `compiler-builtins`:
rust-lang/compiler-builtins#276

A new `compiler-builtins` might be necessary for successfull compilation of the artefacts of those targets.
bors added a commit to rust-lang/rust that referenced this pull request Apr 3, 2019
Add dist builder for Armv8-M Baseline and HF

This commit adds the Armv8-M Baseline and Armv8-M Mainline with
FPU targets in the list of targets that
get their dist components built. It also update the build-manifest
so that this target gets also its dist components uploaded.

Made possible with the recent change merged in `compiler-builtins`:
rust-lang/compiler-builtins#276

A new `compiler-builtins` might be necessary for successfull compilation of the artefacts of those targets.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants