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 dist builder for Armv8-M Mainline #56954

Merged
merged 4 commits into from
Jan 14, 2019
Merged

Conversation

hug-dev
Copy link
Contributor

@hug-dev hug-dev commented Dec 18, 2018

This commit adds the Armv8-M Mainline target 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.

I took example on other pull requests doing the same thing for another target to make the changes. Please feel free to comment if things needs to be added or removed.

Doing ./x.py dist --target thumbv8m.main-none-eabi worked locally so I assume that this will also work on the CI.
It will (I think) however need a new release of alexcrichton/cc-rs to include the pull request rust-lang/cc-rs#363 @alexcrichton

I hope to do the HardFloat version (thumbv8m.main-none-eabihf) and Baseline (thumbv8m.base-none-eabi) later, as fixes need to be done on compiler-builtins first to support those.

@rust-highfive
Copy link
Collaborator

r? @nikomatsakis

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Dec 18, 2018
@alexcrichton
Copy link
Member

I've published 1.0.27 of cc-rs, should be good to include here!

@alexcrichton
Copy link
Member

Apart from that looks good to me to merge!

r? @alexcrichton

@hug-dev
Copy link
Contributor Author

hug-dev commented Dec 18, 2018

@alexcrichton Thanks! Is there anything I need to do here to update the cc version used by compiler-builtins? Or will cargo update automatically?

@alexcrichton
Copy link
Member

Oh there's a lock file in this repository that'll need to be updated with cargo +nightly update -p cc, and that should do the trick!

@hug-dev
Copy link
Contributor Author

hug-dev commented Dec 19, 2018

Thanks for your help, just done!

@alexcrichton
Copy link
Member

@bors: r+

@bors
Copy link
Contributor

bors commented Dec 19, 2018

📌 Commit 39ca0f9 has been approved by alexcrichton

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Dec 19, 2018
@alexcrichton
Copy link
Member

@bors: rollup

pietroalbini added a commit to pietroalbini/rust that referenced this pull request Dec 20, 2018
Add dist builder for Armv8-M Mainline

This commit adds the Armv8-M Mainline target 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.

I took example on other pull requests doing the same thing for another target to make the changes. Please feel free to comment if things needs to be added or removed.

Doing `./x.py dist --target thumbv8m.main-none-eabi` worked locally so I assume that this will also work on the CI.
It will (I think) however need a new release of alexcrichton/cc-rs to include the pull request rust-lang/cc-rs#363 @alexcrichton

I hope to do the HardFloat version (`thumbv8m.main-none-eabihf`) and Baseline (`thumbv8m.base-none-eabi`) later, as fixes need to be done on compiler-builtins first to support those.
Mark-Simulacrum added a commit to Mark-Simulacrum/rust that referenced this pull request Dec 21, 2018
Add dist builder for Armv8-M Mainline

This commit adds the Armv8-M Mainline target 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.

I took example on other pull requests doing the same thing for another target to make the changes. Please feel free to comment if things needs to be added or removed.

Doing `./x.py dist --target thumbv8m.main-none-eabi` worked locally so I assume that this will also work on the CI.
It will (I think) however need a new release of alexcrichton/cc-rs to include the pull request rust-lang/cc-rs#363 @alexcrichton

I hope to do the HardFloat version (`thumbv8m.main-none-eabihf`) and Baseline (`thumbv8m.base-none-eabi`) later, as fixes need to be done on compiler-builtins first to support those.
@pietroalbini
Copy link
Member

@bors r- rollup-
Broke the rollup:

[01:17:41] CC_thumbv8m.main-none-eabi = Some("sccache arm-none-eabi-gcc")
[01:17:41] CFLAGS_thumbv8m.main-none-eabi = Some("-ffunction-sections -fdata-sections -fPIC -mthumb -march=armv8-m.main")
[01:17:41] running: "sccache" "arm-none-eabi-gcc" "-O2" "-ffunction-sections" "-fdata-sections" "-fPIC" "-ffunction-sections" "-fdata-sections" "-fPIC" "-mthumb" "-march=armv8-m.main" "-mthumb" "-march=armv8-m.main" "-fno-builtin" "-fvisibility=hidden" "-ffreestanding" "-DVISIBILITY_HIDDEN" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-std/thumbv8m.main-none-eabi/release/build/compiler_builtins-76ec5569094432bb/out/./compiler-rt/lib/builtins/absvdi2.o" "-c" "./compiler-rt/lib/builtins/absvdi2.c"
[01:17:41] cargo:warning=arm-none-eabi-gcc: error: unrecognized argument in option '-march=armv8-m.main'
[01:17:41] cargo:warning=arm-none-eabi-gcc: note: valid arguments to '-march=' are: armv2 armv2a armv3 armv3m armv4 armv4t armv5 armv5e armv5t armv5te armv6 armv6-m armv6j armv6k armv6s-m armv6t2 armv6z armv6zk armv7 armv7-a armv7-m armv7-r armv7e-m armv7ve armv8-a armv8-a+crc iwmmxt iwmmxt2 native
[01:17:41] cargo:warning=arm-none-eabi-gcc: error: unrecognized argument in option '-march=armv8-m.main'
[01:17:41] cargo:warning=arm-none-eabi-gcc: note: valid arguments to '-march=' are: armv2 armv2a armv3 armv3m armv4 armv4t armv5 armv5e armv5t armv5te armv6 armv6-m armv6j armv6k armv6s-m armv6t2 armv6z armv6zk armv7 armv7-a armv7-m armv7-r armv7e-m armv7ve armv8-a armv8-a+crc iwmmxt iwmmxt2 native
[01:17:41] 
[01:17:41] --- stderr
[01:17:41] thread 'main' panicked at '
[01:17:41] 
[01:17:41] 
[01:17:41] Internal error occurred: Command "sccache" "arm-none-eabi-gcc" "-O2" "-ffunction-sections" "-fdata-sections" "-fPIC" "-ffunction-sections" "-fdata-sections" "-fPIC" "-mthumb" "-march=armv8-m.main" "-mthumb" "-march=armv8-m.main" "-fno-builtin" "-fvisibility=hidden" "-ffreestanding" "-DVISIBILITY_HIDDEN" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-std/thumbv8m.main-none-eabi/release/build/compiler_builtins-76ec5569094432bb/out/./compiler-rt/lib/builtins/absvdi2.o" "-c" "./compiler-rt/lib/builtins/absvdi2.c" with args "arm-none-eabi-gcc" did not execute successfully (status code exit code: 1).
[01:17:41] ', /cargo/registry/src/github.com-1ecc6299db9ec823/cc-1.0.27/src/lib.rs:2313:5

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Dec 21, 2018
@hug-dev
Copy link
Contributor Author

hug-dev commented Dec 21, 2018

@pietroalbini Thanks for the information. The error seems to come from the version of GCC for Baremetal Arm targets (arm-none-eabi-gcc). The dist-various-1 Docker uses Ubuntu 16.04 which has the package gcc-arm-none-eabi version 4.9. However, the support of Armv8-M targets has only been released on the version 5.0 (release note here).
I am on holidays currently and can not work on it, is it possible to remove this pull request from the rollup for now? I will be back in January to work on this issue (if nobody has done it before!).

@pietroalbini
Copy link
Member

is it possible to remove this pull request from the rollup for now?

Already done :)

@bors
Copy link
Contributor

bors commented Dec 25, 2018

☔ The latest upstream changes (presumably #56836) made this pull request unmergeable. Please resolve the merge conflicts.

This commit adds the Armv8-M Mainline target 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.
The version included in Ubuntu 16.04 repositories in the dist-various-1
docker, Arm GCC version 4.9, does not support the new Armv8-M
architecture.
This commit adds the team-gcc-arm-embedded PPA to get through APT a
newer version of Arm GCC.
@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-6.0 of your PR failed on Travis (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
travis_time:end:0849832b:start=1547046992661865835,finish=1547046995241109792,duration=2579243957
$ git checkout -qf FETCH_HEAD
travis_fold:end:git.checkout

Encrypted environment variables have been removed for security reasons.
See https://docs.travis-ci.com/user/pull-requests/#pull-requests-and-security-restrictions
$ export SCCACHE_BUCKET=rust-lang-ci-sccache2
$ export SCCACHE_REGION=us-west-1
Setting environment variables from .travis.yml
$ export IMAGE=x86_64-gnu-llvm-6.0
---
[00:01:59] 
######################################################################## 100.0%
[00:01:59] extracting /checkout/obj/build/cache/2019-01-04/cargo-beta-x86_64-unknown-linux-gnu.tar.gz
[00:01:59]     Updating crates.io index
[00:02:08] error: the lock file /checkout/Cargo.lock needs to be updated but --locked was passed to prevent this
[00:02:08] Build completed unsuccessfully in 0:00:21
[00:02:08] Makefile:71: recipe for target 'prepare' failed
[00:02:08] make: *** [prepare] Error 1
[00:02:09] Command failed. Attempt 2/5:
[00:02:09] Command failed. Attempt 2/5:
[00:02:09]     Updating crates.io index
[00:02:09] error: the lock file /checkout/Cargo.lock needs to be updated but --locked was passed to prevent this
[00:02:09] Build completed unsuccessfully in 0:00:00
[00:02:09] Makefile:71: recipe for target 'prepare' failed
[00:02:09] make: *** [prepare] Error 1
[00:02:11] Command failed. Attempt 3/5:
[00:02:11] Command failed. Attempt 3/5:
[00:02:11]     Updating crates.io index
[00:02:12] error: the lock file /checkout/Cargo.lock needs to be updated but --locked was passed to prevent this
[00:02:12] Build completed unsuccessfully in 0:00:00
[00:02:12] Makefile:71: recipe for target 'prepare' failed
[00:02:12] make: *** [prepare] Error 1
[00:02:15] Command failed. Attempt 4/5:
[00:02:15] Command failed. Attempt 4/5:
[00:02:15]     Updating crates.io index
[00:02:16] error: the lock file /checkout/Cargo.lock needs to be updated but --locked was passed to prevent this
[00:02:16] Build completed unsuccessfully in 0:00:01
[00:02:16] make: *** [prepare] Error 1
[00:02:16] Makefile:71: recipe for target 'prepare' failed
[00:02:20] Command failed. Attempt 5/5:
[00:02:20] Command failed. Attempt 5/5:
[00:02:20]     Updating crates.io index
[00:02:21] error: the lock file /checkout/Cargo.lock needs to be updated but --locked was passed to prevent this
[00:02:21] Build completed unsuccessfully in 0:00:00
[00:02:21] make: *** [prepare] Error 1
[00:02:21] Makefile:71: recipe for target 'prepare' failed
[00:02:21] The command has failed after 5 attempts.
---
travis_time:end:02204f58:start=1547047150540679824,finish=1547047150544866958,duration=4187134
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:29aa9860
$ ln -s . checkout && for CORE in obj/cores/core.*; do EXE=$(echo $CORE | sed 's|obj/cores/core\.[0-9]*\.!checkout!\(.*\)|\1|;y|!|/|'); if [ -f "$EXE" ]; then printf travis_fold":start:crashlog\n\033[31;1m%s\033[0m\n" "$CORE"; gdb --batch -q -c "$CORE" "$EXE" -iex 'set auto-load off' -iex 'dir src/' -iex 'set sysroot .' -ex bt -ex q; echo travis_fold":"end:crashlog; fi; done || true
travis_fold:end:after_failure.4
travis_fold:start:after_failure.5
travis_time:start:056f30d6
travis_time:start:056f30d6
$ cat ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers || true
cat: ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers: No such file or directory
travis_fold:end:after_failure.5
travis_fold:start:after_failure.6
travis_time:start:0b2bf332
$ dmesg | grep -i kill

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@hug-dev
Copy link
Contributor Author

hug-dev commented Jan 9, 2019

I have added a commit which updates the Arm GCC version on the dist-various-1 Docker to solve the error:
arm-none-eabi-gcc: error: unrecognized argument in option '-march=armv8-m.main'
I have tested it trying to execute the Docker image locally (./src/ci/docker/run.sh dist-various-1) but I faced this error:

error[E0514]: found crate `cc` compiled by an incompatible version of rustc
  --> /cargo/registry/src/github.com-1ecc6299db9ec823/compiler_builtins-0.1.4/build.rs:66:5
   |
66 |     extern crate cc;
   |     ^^^^^^^^^^^^^^^^
   |
   = help: please recompile that crate using this compiler (rustc 1.32.0-beta.11 (e64fee6a3 2019-01-04))
   = note: the following crate versions were found:
           crate `cc` compiled by rustc 1.32.0-beta.2 (a01e4761a 2018-12-08): /checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/release/deps/libcc-34c709b76b7d1d6d.rlib                                                                               

error: aborting due to previous error

I am not sure at this point if this error is due to a cleanup I should do on my machine or if it will happen as well on the CI.

@alexcrichton
Copy link
Member

@hug-dev the error on CI is that the lock file needs to be updated (which should be fixable as part of a normal ./x.py build). For the error you gisted above I think that's a bug in our build system, you'll want to probably blow away build or obj and restart the build

@hug-dev
Copy link
Contributor Author

hug-dev commented Jan 10, 2019

@alexcrichton Thanks a lot for the help! I have cleaned build and obj and executed ./x.py build which updated Cargo.lock (new commit pushed). Tried the dist-various-1 docker and worked successfully.

@alexcrichton
Copy link
Member

@bors: r+

@bors
Copy link
Contributor

bors commented Jan 10, 2019

📌 Commit 65ac315 has been approved by alexcrichton

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jan 10, 2019
bors added a commit that referenced this pull request Jan 14, 2019
Add dist builder for Armv8-M Mainline

This commit adds the Armv8-M Mainline target 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.

I took example on other pull requests doing the same thing for another target to make the changes. Please feel free to comment if things needs to be added or removed.

Doing `./x.py dist --target thumbv8m.main-none-eabi` worked locally so I assume that this will also work on the CI.
It will (I think) however need a new release of alexcrichton/cc-rs to include the pull request rust-lang/cc-rs#363 @alexcrichton

I hope to do the HardFloat version (`thumbv8m.main-none-eabihf`) and Baseline (`thumbv8m.base-none-eabi`) later, as fixes need to be done on compiler-builtins first to support those.
@bors
Copy link
Contributor

bors commented Jan 14, 2019

⌛ Testing commit 65ac315 with merge a16e1a7...

@bors
Copy link
Contributor

bors commented Jan 14, 2019

☀️ Test successful - checks-travis, status-appveyor
Approved by: alexcrichton
Pushing a16e1a7 to master...

@bors bors merged commit 65ac315 into rust-lang:master Jan 14, 2019
ehuss added a commit to ehuss/rust-forge that referenced this pull request May 15, 2020
The following targets are now built and distributed:

- aarch64-unknown-none: rust-lang/rust#68334
- mips64-unknown-linux-muslabi64: rust-lang/rust#65843
- mips64el-unknown-linux-muslabi64: rust-lang/rust#65843
- nvptx64-nvidia-cuda: rust-lang/rust#57937
- riscv32i-unknown-none-elf: rust-lang/rust#62784
- riscv64gc-unknown-linux-gnu: rust-lang/rust#68037
- thumbv8m.base-none-eabi: rust-lang/rust#59182
- thumbv8m.main-none-eabi : rust-lang/rust#56954
- thumbv8m.main-none-eabihf: rust-lang/rust#59182
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants