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

rust: add initial changes to support powerpc64le musl #51619

Merged
merged 1 commit into from
Jul 6, 2018

Conversation

mksully22
Copy link
Contributor

Initial changes to support rustc building on ppc64le with musl. A PR was also submitted to libc component rust-lang/libc#1023 to add changes to libc musl definitions.

A PR was submitted on Alpine alpinelinux/aports#4549 with equivalent temporary patches for building on Alpine for now.

As a verification test a github project was put together to build ppc64le versions of rustc, rust-stdlib, and cargo on Alpine, https://github.com/mksully22/ppc64le_alpine_rust_1.26.2

@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 @varkor (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.

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

The job x86_64-gnu-llvm-3.9 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.
[00:05:53]    Compiling parking_lot_core v0.2.14
[00:05:54]    Compiling tempdir v0.3.7
[00:05:56]    Compiling rls-span v0.4.0
[00:05:56]    Compiling chalk-engine v0.6.0
[00:05:57] error[E0432]: unresolved import `LinkerFlavor`
[00:05:57]   --> librustc_target/spec/powerpc64le_unknown_linux_musl.rs:11:5
[00:05:57] 11 | use LinkerFlavor;
[00:05:57] 11 | use LinkerFlavor;
[00:05:57]    |     ^^^^^^^^^^^^ no `LinkerFlavor` in the root
[00:05:57] 
[00:05:57] error[E0432]: unresolved import `target`
[00:05:57]   --> librustc_target/spec/powerpc64le_unknown_linux_musl.rs:12:5
[00:05:57]    |
[00:05:57] 12 | use target::{Target, TargetResult};
[00:05:57]    |     ^^^^^^ Maybe a missing `extern crate target;`?
[00:05:57]    Compiling rustc_apfloat v0.0.0 (file:///checkout/src/librustc_apfloat)
[00:05:59] error: aborting due to 2 previous errors
[00:05:59] 
[00:05:59] For more information about this error, try `rustc --explain E0432`.
[00:05:59] For more information about this error, try `rustc --explain E0432`.
[00:05:59] error: Could not compile `rustc_target`.
[00:05:59] 
[00:05:59] Caused by:
[00:05:59]   process didn't exit successfully: `/checkout/obj/build/bootstrap/debug/rustc --crate-name rustc_target librustc_target/lib.rs --color always --error-format json --crate-type dylib --emit=dep-info,link -C prefer-dynamic -C opt-level=2 --cfg feature="jemalloc" -C metadata=58741ed9de9aae4f -C extra-filename=-58741ed9de9aae4f --out-dir /checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps --target x86_64-unknown-linux-gnu -L dependency=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps -L dependency=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/release/deps --extern serialize=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libserialize-5d0a8a65bb9fe29f.so --extern serialize=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libserialize-5d0a8a65bb9fe29f.rlib --extern bitflags=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libbitflags-99b4534960f92449.rlib --extern rustc_cratesio_shim=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_cratesio_shim-056d8bc457dc18d8.so --extern log=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/liblog-5073f1296cd24b67.rlib` (exit code: 101)
[00:06:01] error: build failed
[00:06:01] error: build failed
[00:06:01] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "build" "--target" "x86_64-unknown-linux-gnu" "-j" "4" "--release" "--locked" "--color" "always" "--features" " jemalloc" "--manifest-path" "/checkout/src/rustc/Cargo.toml" "--message-format" "json"
[00:06:01] expected success, got: exit code: 101
[00:06:01] thread 'main' panicked at 'cargo must succeed', bootstrap/compile.rs:1091:9
[00:06:01] travis_fold:end:stage0-rustc

[00:06:01] travis_time:end:stage0-rustc:start=1529340107408390867,finish=1529340145361063440,duration=37952672573


[00:06:01] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap build
[00:06:01] Build completed unsuccessfully in 0:00:52
[00:06:01] make: *** [all] Error 1
[00:06:01] Makefile:28: recipe for target 'all' failed

The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:10a7f28c
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
---
travis_time:end:0cd65d2e:start=1529340145906491205,finish=1529340145912011310,duration=5520105
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:169a69a4
$ head -30 ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers || true
head: cannot open ‘./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers’ for reading: No such file or directory
travis_fold:end:after_failure.4
travis_fold:start:after_failure.5
travis_time:start:034ad096
$ 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)

@@ -0,0 +1,35 @@
// Copyright 2012-2016 The Rust Project Developers. See the COPYRIGHT
Copy link
Member

Choose a reason for hiding this comment

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

Nit: Copyright 2018.

@varkor
Copy link
Member

varkor commented Jun 18, 2018

Thanks! This looks right to me, but I'm unfamiliar with this part of the codebase, so I'm going to assign someone else to double-check.

r? @Mark-Simulacrum

@Mark-Simulacrum
Copy link
Member

r? @eddyb

I'm not sure what the policy is currently for adding new targets into the compiler itself. Maybe we should FCP.

@Mark-Simulacrum Mark-Simulacrum added the relnotes Marks issues that should be documented in the release notes of the next release. label Jun 19, 2018
@eddyb
Copy link
Member

eddyb commented Jun 22, 2018

r? @alexcrichton or @nagisa

@rust-highfive rust-highfive assigned alexcrichton and unassigned eddyb Jun 22, 2018
@pietroalbini pietroalbini added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 25, 2018
@alexcrichton
Copy link
Member

r=me with the year fix, thanks @mksully22!

@TimNN TimNN 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-review Status: Awaiting review from the assignee but also interested parties. labels Jul 3, 2018
@TimNN
Copy link
Contributor

TimNN commented Jul 3, 2018

Ping from triage, @mksully22: This PR requires a minor fix from you.

amend powerpc64le_unknown_linux_musl.rs to fix copyright date
@malbarbo
Copy link
Contributor

malbarbo commented Jul 4, 2018

The author did the fix.

@alexcrichton
Copy link
Member

@bors: r+

@bors
Copy link
Contributor

bors commented Jul 4, 2018

📌 Commit dd069ea 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 Jul 4, 2018
@pietroalbini
Copy link
Member

@bors rollup

kennytm added a commit to kennytm/rust that referenced this pull request Jul 5, 2018
rust: add initial changes to support powerpc64le musl

Initial changes to support rustc building on ppc64le with musl. A PR was also submitted to libc component rust-lang/libc#1023 to add changes to libc musl definitions.

A PR was submitted on Alpine alpinelinux/aports#4549 with equivalent temporary patches for building on Alpine for now.

As a verification test a github project was put together to build ppc64le versions of rustc, rust-stdlib, and cargo on Alpine, https://github.com/mksully22/ppc64le_alpine_rust_1.26.2
bors added a commit that referenced this pull request Jul 6, 2018
Rollup of 14 pull requests

Successful merges:

 - #51619 (rust: add initial changes to support powerpc64le musl)
 - #51793 (Fix variant background color on hover in search results)
 - #52005 (Update LLVM to bring in a wasm codegen fix)
 - #52016 (Deduplicate error reports for statics)
 - #52019 ([cross-lang-lto] Allow the linker to choose the LTO-plugin (which is useful when using LLD))
 - #52030 (Any docs preposition change)
 - #52031 (Strenghten synchronization in `Arc::is_unique`)
 - #52033 ([Gardening] Update outdated comments: ByVal -> Scalar)
 - #52052 (Make verbose --version show if parallel queries are supported.)
 - #52055 (Include VS 2017 in error message.)
 - #52063 (Add a link to the rustc docs)
 - #52073 (Add a punch card to weird expressions test)
 - #52080 (Improve dependency deduplication diagnostics)
 - #51953 (enable Atomic*.{load,store} for ARMv6-M / MSP430)

Failed merges:
bors added a commit that referenced this pull request Jul 6, 2018
Rollup of 14 pull requests

Successful merges:

 - #51619 (rust: add initial changes to support powerpc64le musl)
 - #51793 (Fix variant background color on hover in search results)
 - #52005 (Update LLVM to bring in a wasm codegen fix)
 - #52016 (Deduplicate error reports for statics)
 - #52019 ([cross-lang-lto] Allow the linker to choose the LTO-plugin (which is useful when using LLD))
 - #52030 (Any docs preposition change)
 - #52031 (Strenghten synchronization in `Arc::is_unique`)
 - #52033 ([Gardening] Update outdated comments: ByVal -> Scalar)
 - #52055 (Include VS 2017 in error message.)
 - #52063 (Add a link to the rustc docs)
 - #52073 (Add a punch card to weird expressions test)
 - #52080 (Improve dependency deduplication diagnostics)
 - #52093 (rustc: Update tracking issue for wasm_import_module)
 - #52096 (Fix typo in cell.rs)

Failed merges:
@bors bors merged commit dd069ea into rust-lang:master Jul 6, 2018
@gnzlbg
Copy link
Contributor

gnzlbg commented Jul 11, 2018

cc @lu-zero

@lu-zero
Copy link
Contributor

lu-zero commented Jul 11, 2018

I do not have a musl chroot handy to compile it myself right now, but from a cursory look looks fine.

netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this pull request Sep 14, 2018
Version 1.29.0 (2018-09-13)
==========================

Compiler
--------
- [Bumped minimum LLVM version to 5.0.][51899]
- [Added `powerpc64le-unknown-linux-musl` target.][51619]
- [Added `aarch64-unknown-hermit` and `x86_64-unknown-hermit` targets.][52861]

Libraries
---------
- [`Once::call_once` now no longer requires `Once` to be `'static`.][52239]
- [`BuildHasherDefault` now implements `PartialEq` and `Eq`.][52402]
- [`Box<CStr>`, `Box<OsStr>`, and `Box<Path>` now implement `Clone`.][51912]
- [Implemented `PartialEq<&str>` for `OsString` and `PartialEq<OsString>`
  for `&str`.][51178]
- [`Cell<T>` now allows `T` to be unsized.][50494]
- [`SocketAddr` is now stable on Redox.][52656]

Stabilized APIs
---------------
- [`Arc::downcast`]
- [`Iterator::flatten`]
- [`Rc::downcast`]

Cargo
-----
- [Cargo can silently fix some bad lockfiles ][cargo/5831] You can use
  `--locked` to disable this behaviour.
- [`cargo-install` will now allow you to cross compile an install
  using `--target`][cargo/5614]
- [Added the `cargo-fix` subcommand to automatically move project code from
  2015 edition to 2018.][cargo/5723]

Misc
----
- [`rustdoc` now has the `--cap-lints` option which demotes all lints above
  the specified level to that level.][52354] For example `--cap-lints warn`
  will demote `deny` and `forbid` lints to `warn`.
- [`rustc` and `rustdoc` will now have the exit code of `1` if compilation
  fails, and `101` if there is a panic.][52197]
- [A preview of clippy has been made available through rustup.][51122]
  You can install the preview with `rustup component add clippy-preview`

Compatibility Notes
-------------------
- [`str::{slice_unchecked, slice_unchecked_mut}` are now deprecated.][51807]
  Use `str::get_unchecked(begin..end)` instead.
- [`std::env::home_dir` is now deprecated for its unintuitive behaviour.][51656]
  Consider using the `home_dir` function from
  https://crates.io/crates/dirs instead.
- [`rustc` will no longer silently ignore invalid data in target spec.][52330]

[52861]: rust-lang/rust#52861
[52656]: rust-lang/rust#52656
[52239]: rust-lang/rust#52239
[52330]: rust-lang/rust#52330
[52354]: rust-lang/rust#52354
[52402]: rust-lang/rust#52402
[52103]: rust-lang/rust#52103
[52197]: rust-lang/rust#52197
[51807]: rust-lang/rust#51807
[51899]: rust-lang/rust#51899
[51912]: rust-lang/rust#51912
[51511]: rust-lang/rust#51511
[51619]: rust-lang/rust#51619
[51656]: rust-lang/rust#51656
[51178]: rust-lang/rust#51178
[51122]: rust-lang/rust#51122
[50494]: rust-lang/rust#50494
[cargo/5614]: rust-lang/cargo#5614
[cargo/5723]: rust-lang/cargo#5723
[cargo/5831]: rust-lang/cargo#5831
[`Arc::downcast`]: https://doc.rust-lang.org/std/sync/struct.Arc.html#method.downcast
[`Iterator::flatten`]: https://doc.rust-lang.org/std/iter/trait.Iterator.html#method.flatten
[`Rc::downcast`]: https://doc.rust-lang.org/std/rc/struct.Rc.html#method.downcast
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. 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.