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

Apply some fixes to cross-language LTO (especially when targeting MSVC) #53031

Merged
merged 10 commits into from
Aug 9, 2018

Conversation

michaelwoerister
Copy link
Member

This PR contains a few fixes that were needed in order to get Firefox compiling with Rust/C++ cross-language ThinLTO on Windows. The commits are self-contained and should be self-explanatory.

r? @alexcrichton

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 3, 2018
@michaelwoerister
Copy link
Member Author

@bors try

@bors
Copy link
Contributor

bors commented Aug 3, 2018

⌛ Trying commit 0b253da with merge 807bbd9...

bors added a commit that referenced this pull request Aug 3, 2018
Apply some fixes to cross-language LTO (especially when targeting MSVC)

This PR contains a few fixes that were needed in order to get Firefox compiling with Rust/C++ cross-language ThinLTO on Windows. The commits are self-contained and should be self-explanatory.

r? @alexcrichton
@@ -1626,8 +1626,12 @@ fn relevant_lib(sess: &Session, lib: &NativeLibrary) -> bool {
fn is_full_lto_enabled(sess: &Session) -> bool {
Copy link
Member

Choose a reason for hiding this comment

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

With the comment below, perhaps this function could be renamed to something like are_upstream_rust_objects_already_included? (albeit a bit wordy)

Copy link
Member Author

Choose a reason for hiding this comment

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

Sounds good to me.

@@ -1331,6 +1335,11 @@ fn execute_work_item(cgcx: &CodegenContext,
let needs_lto = match cgcx.lto {
Lto::No => false,

// If the linker does LTO, we don't have to do it. Note that we
// keep doing full LTO, if it is requested, as not to break the
// assumption that the output will be a single module.
Copy link
Member

Choose a reason for hiding this comment

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

To confirm, this is a rustc bug, right? This is fixable on our end where fat LTO plus cross-lang-lto shouldn't actually run the LTO passes in rustc?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, it probably isn't too hard to do just the module merging but not the optimizations. Maybe in another PR, unless you think it's urgent.

Copy link
Member

Choose a reason for hiding this comment

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

Oh nah definitely fine to happen later, just wanted to make sure I understood!

sess.opts.cg.prefer_dynamic &&
sess.target.target.options.is_like_msvc {
sess.err("Linker plugin based LTO is not supported together with \
`-C prefer-dynamic` when targeting MSVC");
Copy link
Member

Choose a reason for hiding this comment

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

Could a comment be added above this with a brief explanation as to why the error is being emitted? AFAIK it's all b/c of DLL weirdness, right?

Copy link
Member Author

Choose a reason for hiding this comment

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

👍

@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-5.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:start:test_run-make-fulldeps
Check compiletest suite=run-make-fulldeps mode=run-make (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
[01:14:53] 
[01:14:53] running 190 tests
[01:15:23] ......................F.............................................................................
[01:16:17] .........................................................................................test [run-make] run-make-fulldeps/long-linker-command-lines has been running for over 60 seconds
[01:17:06] thread 'main' panicked at 'Some tests failed', tools/compiletest/src/main.rs:498:22
[01:17:06] failures:
[01:17:06] 
[01:17:06] 
[01:17:06] ---- [run-make] run-make-fulldeps/cross-lang-lto-upstream-rlibs stdout ----
[01:17:06] error: make failed
[01:17:06] status: exit code: 2
[01:17:06] command: "make"
[01:17:06] stdout:
[01:17:06] stdout:
[01:17:06] ------------------------------------------
[01:17:06] make[1]: Entering directory '/checkout/src/test/run-make-fulldeps/cross-lang-lto-upstream-rlibs'
[01:17:06] LD_LIBRARY_PATH="/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make-fulldeps/cross-lang-lto-upstream-rlibs/cross-lang-lto-upstream-rlibs:/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib:/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-bootstrap-tools/x86_64-unknown-linux-gnu/release/deps:/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/lib:" '/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc' --out-dir /checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make-fulldeps/cross-lang-lto-upstream-rlibs/cross-lang-lto-upstream-rlibs -L /checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make-fulldeps/cross-lang-lto-upstream-rlibs/cross-lang-lto-upstream-rlibs  upstream.rs -Z cross-lang-lto -Ccodegen-units=1
[01:17:06] # Check No LTO
[01:17:06] LD_LIBRARY_PATH="/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make-fulldeps/cross-lang-lto-upstream-rlibs/cross-lang-lto-upstream-rlibs:/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib:/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-bootstrap-tools/x86_64-unknown-linux-gnu/release/deps:/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/lib:" '/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc' --out-dir /checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make-fulldeps/cross-lang-lto-upstream-rlibs/cross-lang-lto-upstream-rlibs -L /checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make-fulldeps/cross-lang-lto-upstream-rlibs/cross-lang-lto-upstream-rlibs  staticlib.rs -Z cross-lang-lto -Ccodegen-units=1 -L. -o /checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make-fulldeps/cross-lang-lto-upstream-rlibs/cross-lang-lto-upstream-rlibs/staticlib.a
[01:17:06] (cd /checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make-fulldeps/cross-lang-lto-upstream-rlibs/cross-lang-lto-upstream-rlibs; llvm-ar x ./staticlib.a)
[01:17:06] # Make sure the upstream object file was included
[01:17:06] ls upstream.*.rcgu.o
[01:17:06] Makefile:8: recipe for target 'all' failed
[01:17:06] make[1]: Leaving directory '/checkout/src/test/run-make-fulldeps/cross-lang-lto-upstream-rlibs'
[01:17:06] ------------------------------------------
[01:17:06] stderr:
[01:17:06] ------------------------------------------
[01:17:06] ------------------------------------------
[01:17:06] warning: ignoring --out-dir flag due to -o flag
[01:17:06] 
[01:17:06] ls: cannot access 'upstream.*.rcgu.o': No such file or directory
[01:17:06] make[1]: *** [all] Error 2
[01:17:06] ------------------------------------------
[01:17:06] 
[01:17:06] 
[01:17:06] thread '[run-make] run-make-fulldeps/cross-lang-lto-upstream-rlibs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:3149:9
[01:17:06] 
[01:17:06] 

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)

@bors
Copy link
Contributor

bors commented Aug 3, 2018

☀️ Test successful - status-travis
State: approved= try=True

@michaelwoerister
Copy link
Member Author

@rust-timer build 807bbd9

@rust-timer
Copy link
Collaborator

Success: Queued 807bbd9 with parent 88e0ff1, comparison URL.

@kennytm
Copy link
Member

kennytm commented Aug 4, 2018

Perf is ready. Almost nothing is changed.

@michaelwoerister
Copy link
Member Author

Hm, there's still a bit of a regression. It might be coming from allocating the CString for the target-cpu attribute. I'll see if I can get rid of that.

@michaelwoerister
Copy link
Member Author

@bors try (target-cpu attributes are now only emitted when compiling with -Zcross-lang-lto. Let's see if that fixes performance)

@bors
Copy link
Contributor

bors commented Aug 6, 2018

⌛ Trying commit 603584d with merge 2a2b328...

bors added a commit that referenced this pull request Aug 6, 2018
Apply some fixes to cross-language LTO (especially when targeting MSVC)

This PR contains a few fixes that were needed in order to get Firefox compiling with Rust/C++ cross-language ThinLTO on Windows. The commits are self-contained and should be self-explanatory.

r? @alexcrichton
@kennytm kennytm added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Aug 6, 2018
@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-5.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.
[00:20:26]    Compiling build_helper v0.1.0 (file:///checkout/src/build_helper)
[00:20:26]    Compiling rustc_codegen_llvm v0.0.0 (file:///checkout/src/librustc_codegen_llvm)
[00:20:26]    Compiling cc v1.0.18
[00:20:27]    Compiling rustc_llvm v0.0.0 (file:///checkout/src/librustc_llvm)
[00:20:34] error[E0425]: cannot find value `CrateTypeRlib` in module `config`
[00:20:34]     --> librustc_codegen_llvm/back/write.rs:2358:70
[00:20:34]      |
[00:20:34] 2358 |         tcx.sess.crate_types.borrow().iter().any(|ct| *ct == config::CrateTypeRlib) &&
[00:20:34]      |                                                                      ^^^^^^^^^^^^^ not found in `config`
[00:20:34] 
cremental=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_incremental-4f182245385237b5.so --extern rustc_llvm=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_llvm-5ed58e76c7dace45.rlib --extern rustc_mir=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_mir-1cc3798595d9708a.so --extern rustc_platform_intrinsics=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_platform_intrinsics-2e835ba951928190.so --extern rustc_target=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_target-20eb47b9c402fee3.so --extern serialize=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libserialize-8c9bc9ee6cc9592f.so --extern serialize=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libserialize-8c9bc9ee6cc9592f.rlib --extern syntax=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libsyntax-1ed4d2103c0d7730.so --extern syntax_pos=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libsyntax_pos-899ce576c6b4bcbf.so --extern tempfile=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libtempfile-45767bac74e332c7.rlib -L native=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/build/miniz-sys-3c585aa15bfc4e69/'s/Date: //g' || true)
Mon, 06 Aug 2018 09:42:35 GMT
travis_time:end:1e5ee39f:start=1533548555399164652,finish=1533548555458225254,duration=59060602

The command "date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)

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)

@bors
Copy link
Contributor

bors commented Aug 6, 2018

💔 Test failed - status-travis

@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-review Status: Awaiting review from the assignee but also interested parties. labels Aug 6, 2018
@rust-highfive
Copy link
Collaborator

The job dist-x86_64-linux 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_fold:end:services

travis_fold:start:git.checkout
travis_time:start:0b2eaaf8
$ git clone --depth=2 --branch=try https://github.com/rust-lang/rust.git rust-lang/rust
---
[00:24:49]    Compiling build_helper v0.1.0 (file:///checkout/src/build_helper)
[00:24:49]    Compiling rustc_codegen_llvm v0.0.0 (file:///checkout/src/librustc_codegen_llvm)
[00:24:49]    Compiling cc v1.0.18
[00:24:50]    Compiling rustc_llvm v0.0.0 (file:///checkout/src/librustc_llvm)
[00:24:56] error[E0425]: cannot find value `CrateTypeRlib` in module `config`
[00:24:56]     --> librustc_codegen_llvm/back/write.rs:2358:70
[00:24:56]      |
[00:24:56] 2358 |         tcx.sess.crate_types.borrow().iter().any(|ct| *ct == config::CrateTypeRlib) &&
[00:24:56]      |                                                                      ^^^^^^^^^^^^^ not found in `config`
[00:25:01] error: aborting due to previous error
[00:25:01] 
[00:25:01] For more information about this error, try `rustc --explain E0425`.
[00:25:01] error: Could not compile `rustc_codegen_llvm`.
[00:25:01] error: Could not compile `rustc_codegen_llvm`.
[00:25:01] 
[00:25:01] Caused by:
[00:25:01]   process didn't exit successfully: `/checkout/obj/build/bootstrap/debug/rustc --crate-name rustc_codegen_llvm librustc_codegen_llvm/lib.rs --color always --error-format json --crate-type dylib --emit=dep-info,link -C prefer-dynamic -C opt-level=2 --cfg 'feature="jemalloc"' --cfg 'feature="rustc_target"' -C metadata=a8ce002136ec64b4 -C extra-filename=-a8ce002136ec64b4 --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 -C linker=clang -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 bitflags=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libbitflags-3907cba388d41ef0.rlib --extern cc=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libcc-277ca49f42ab2e53.rlib --extern env_logger=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libenv_logger-f28e2ea1414f1406.rlib --extern flate2=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libflate2-94b7c8f2f6f79e1b.rlib --extern jobserver=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libjobserver-ba31465b048d39f4.rlib --extern libc=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/liblibc-00919937f377f0bc.rlib --extern log=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/liblog-b6c566856a1e65b9.rlib --extern num_cpus=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libnum_cpus-18d8fee9014249a2.rlib --extern rustc=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc-e4f798202172c031.so --extern rustc_demangle=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_demangle-dd0a9429b0aacf96.rlib --extern rustc_allocator=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_allocator-62a891846402192d.so --extern rustc_apfloat=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_apfloat-165c205e2819b15f.rlib --extern rustc_codegen_utils=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_codegen_utils-bb3fc1dfe0105c1c.so --extern rustc_data_structures=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_data_structures-072369dae17b1893.so --extern rustc_errors=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_errors-780c150b6c3acb38.so --extern rustc_incremental=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_incremental-4f182245385237b5.so --extern rustc_llvm=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_llvm-5ed58e76c7dace45.rlib --extern rustc_mir=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_mir-1cc3798595d9708a.so --extern rustc_platform_intrinsics=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_platform_intrinsics-2e835ba951928190.so --extern rustc_target=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_target-20eb47b9c402fee3.so --extern serialize=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libserialize-8c9bc9ee6cc9592f.so --extern serialize=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libserialize-8c9bc9ee6cc9592f.rlib --extern syntax=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libsyntax-1ed4d2103c0d7730.so --extern syntax_pos=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libsyntax_pos-899ce576c6b4bcbf.so --extern tempfile=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libtempfile-45767bac74e332c7.rlib -L native=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/build/miniz-sys-3c585aa15bfc4e69/out -L native=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/build/backtrace-sys-01a673445b66da02/out -L native=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/build/rustc_llvm-71c6a17c4b962f9c/out -L native=/checkout/obj/build/x86_64-unknown-linux-gnu/llvm/build/lib -L native=/rustroot/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.8.5/../../../../lib64` (exit code: 1)
[00:25: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" "--manifest-path" "/checkout/src/librustc_codegen_llvm/Cargo.toml" "--features" " jemalloc" "--message-format" "json"
[00:25:01] expected success, got: exit code: 101
[00:25:01] thread 'main' panicked at 'cargo must succeed', bootstrap/compile.rs:1118:9
[00:25:01] travis_fold:start:stage0-rustc_codegen_llvm
travis_time:start:stage0-rustc_codegen_llvm
travis_fold:end:stage0-rustc_codegen_llvm

---
travis_time:end:2d2b4788:start=1533549117031028139,finish=1533549117038181310,duration=7153171
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:074602dd
$ 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 -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:21692f38
travis_time:start:21692f38
$ 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:0df42b4c
$ 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)

@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-5.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.
[00:43:07] ....................................................................................................
[00:43:09] ....................................................................................................
[00:43:12] ....................................................................................................
[00:43:15] ....................................................................................................
[00:43:17] iiiiiiiii...........................................................................................
[00:43:23] ....................................................................................................
[00:43:26] .....i..............................................................................................
[00:43:29] ..............i.....................................................................................
[00:43:31] ....................................................................................................
---
travis_time:start:test_codegen
Check compiletest suite=codegen mode=codegen (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
[00:50:34] 
[00:50:34] running 104 tests
heckout/obj/build/x86_64-unknown-linux-gnu/test/codegen/target-cpu-on-functions/target-cpu-on-functions.ll" "/checkout/src/test/codegen/target-cpu-on-functions.rs"
[00:50:37] ------------------------------------------
[00:50:37] 
[00:50:37] ------------------------------------------
[00:50:37] stderr:
[00:50:37] stderr:
[00:50:37] ------------------------------------------
[00:50:37] /checkout/src/test/codegen/target-cpu-on-functions.rs:28:11: error: expected string not found in input
[00:50:37] // CHECK: attributes #0 = {{.*}} "target-cpu"="x86-64"
[00:50:37]           ^
[00:50:37] /checkout/obj/build/x86_64-unknown-linux-gnu/test/codegen/target-cpu-on-functions/target-cpu-on-functions.ll:19:104: note: scanning from here
[00:50:37] define internal void @_ZN23target_cpu_on_functions12not_exported17h20a13a30b2442844E() unnamed_addr #0 {
[00:50:37]                                                                                                        ^
[00:50:37] /checkout/obj/build/x86_64-unknown-linux-gnu/test/codegen/target-cpu-on-functions/target-cpu-on-functions.ll:24:1: note: possible intended match here
[00:50:37] attributes #0 = { nounwind "probe-stack"="__rust_probestack" }
[00:50:37] 
[00:50:37] ------------------------------------------
[00:50:37] 
[00:50:37] thread '[codegen] codegen/target-cpu-on-functions.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:3149:9
---
[00:50:37] test result: FAILED. 75 passed; 1 failed; 28 ignored; 0 measured; 0 filtered out
[00:50:37] 
[00:50:37] 
[00:50:37] 
[00:50:37] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/compiletest" "--compile-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib" "--run-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib" "--rustc-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "--src-base" "/checkout/src/test/codegen" "--build-base" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/codegen" "--stage-id" "stage2-x86_64-unknown-linux-gnu" "--mode" "codegen" "--target" "x86_64-unknown-linux-gnu" "--host" "x86_64-unknown-linux-gnu" "--llvm-filecheck" "/usr/lib/llvm-5.0/bin/FileCheck" "--host-rustcflags" "-Crpath -O -Zunstable-options " "--target-rustcflags" "-Crpath -O -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--docck-python" "/usr/bin/python2.7" "--lldb-python" "/usr/bin/python2.7" "--gdb" "/usr/bin/gdb" "--quiet" "--llvm-version" "5.0.0\n" "--system-llvm" "--cc" "" "--cxx" "" "--cflags" "" "--llvm-components" "" "--llvm-cxxflags" "" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" "" "--color" "always"
[00:50:37] 
[00:50:37] 
[00:50:37] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
[00:50:37] Build completed unsuccessfully in 0:10:01
[00:50:37] Build completed unsuccessfully in 0:10:01
[00:50:37] make: *** [check] Error 1
[00:50:37] Makefile:58: recipe for target 'check' failed
34524 ./obj/build/x86_64-unknown-linux-gnu/stage0-std/release/build
34496 ./obj/build/x86_64-unknown-linux-gnu/stage1-std/release/build
34344 ./.git/modules/src/libcompiler_builtins/modules/compiler-rt/objects
34336 ./.git/modules/src/libcompiler_builtins/modules/compiler-rt/objects/pack

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)

@michaelwoerister
Copy link
Member Author

@bors try

@bors
Copy link
Contributor

bors commented Aug 6, 2018

⌛ Trying commit 1ecb0a56fd1211e1357c59cedd22e94bef989596 with merge 63d3f70a598b20ea7e9eb775348456a015daedb5...

@bors
Copy link
Contributor

bors commented Aug 9, 2018

💔 Test failed - status-travis

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

The job arm-android 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.
[01:20:57] test [codegen] codegen/mainsubprogramstart.rs ... ok
[01:20:57] test [codegen] codegen/match-optimizes-away.rs ... ok
[01:20:57] test [codegen] codegen/match.rs ... ok
[01:20:57] test [codegen] codegen/mir_zst_stores.rs ... ok
[01:20:57] test [codegen] codegen/no-dllimport-w-cross-lang-lto.rs ... ignored
[01:20:57] test [codegen] codegen/naked-functions.rs ... ok
[01:20:57] test [codegen] codegen/no-output-asm-is-volatile.rs ... ok
[01:20:57] test [codegen] codegen/nounwind.rs ... ignored
[01:20:57] test [codegen] codegen/nontemporal.rs ... ok

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)

@matthiaskrgr
Copy link
Member

[01:32:20] test collections::hash::map::test_map::test_lots_of_insertions ... ok
[01:32:21] test sync::mpsc::tests::stress_recv_timeout_two_threads ... ok
[01:32:57] test process::tests::test_process_output_fail_to_start ... test process::tests::test_process_output_fail_to_start has been running for over 60 seconds


No output has been received in the last 30m0s, this potentially indicates a stalled build or something wrong with the build itself.
Check the details on how to adjust your build configuration on: https://docs.travis-ci.com/user/common-build-problems/#Build-times-out-because-no-output-was-received

The build has been terminated

@michaelwoerister
Copy link
Member Author

Hm, everything passed except for arm-android hanging. @rust-lang/infra, is this something the occurs from time to time?

@kennytm
Copy link
Member

kennytm commented Aug 9, 2018

@bors retry #43283

@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 Aug 9, 2018
@bors
Copy link
Contributor

bors commented Aug 9, 2018

⌛ Testing commit 49972e9 with merge b73535f...

bors added a commit that referenced this pull request Aug 9, 2018
Apply some fixes to cross-language LTO (especially when targeting MSVC)

This PR contains a few fixes that were needed in order to get Firefox compiling with Rust/C++ cross-language ThinLTO on Windows. The commits are self-contained and should be self-explanatory.

r? @alexcrichton
@bors
Copy link
Contributor

bors commented Aug 9, 2018

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

@bors bors merged commit 49972e9 into rust-lang:master Aug 9, 2018
@gnzlbg
Copy link
Contributor

gnzlbg commented Aug 17, 2018

@michaelwoerister is there a guide somewhere explaining how to use Cross-Language LTO? I‘m Linking a vectorized version of libm in packed simd that gets compiled from C and would like it to be inlined into Rust. I’d also like to set this up for jemalloc.

@michaelwoerister
Copy link
Member Author

No guide yet. You basically:

  1. make sure that you use the latest nightly version of Rust,
  2. compile you're C code with clang 7 and -flto=thin,
  3. make sure that you are using LLD as your linker (e.g. with -Clinker=clang -Clink-arg=-fuse-ld=lld, and
  4. add -Zcross-lang-lto -Ccodegen-units=1 to your RUSTFLAGS.

Note that things are still experimental (although stable enough to build Firefox with it).

alexcrichton added a commit to alexcrichton/rust that referenced this pull request Aug 24, 2018
This fixes a regression from rust-lang#53031 where specifying `-C target-cpu=native` is
printing a lot of warnings from LLVM about `native` being an unknown CPU. It
turns out that `native` is indeed an unknown CPU and we have to perform a
mapping to an actual CPU name, but this mapping is only performed in one
location rather than all locations we inform LLVM about the target CPU.

This commit centralizes the mapping of `native` to LLVM's value of the native
CPU, ensuring that all locations we inform LLVM about the `target-cpu` it's
never `native`.

Closes rust-lang#53322
bors added a commit that referenced this pull request Aug 27, 2018
Fix warnings about the `native` target-cpu

This fixes a regression from #53031 where specifying `-C target-cpu=native` is
printing a lot of warnings from LLVM about `native` being an unknown CPU. It
turns out that `native` is indeed an unknown CPU and we have to perform a
mapping to an actual CPU name, but this mapping is only performed in one
location rather than all locations we inform LLVM about the target CPU.

This commit centralizes the mapping of `native` to LLVM's value of the native
CPU, ensuring that all locations we inform LLVM about the `target-cpu` it's
never `native`.

Closes #53322
alexcrichton added a commit to alexcrichton/rust that referenced this pull request Aug 27, 2018
This fixes a regression from rust-lang#53031 where specifying `-C target-cpu=native` is
printing a lot of warnings from LLVM about `native` being an unknown CPU. It
turns out that `native` is indeed an unknown CPU and we have to perform a
mapping to an actual CPU name, but this mapping is only performed in one
location rather than all locations we inform LLVM about the target CPU.

This commit centralizes the mapping of `native` to LLVM's value of the native
CPU, ensuring that all locations we inform LLVM about the `target-cpu` it's
never `native`.

Closes rust-lang#53322
bors added a commit that referenced this pull request Aug 28, 2018
Fix warnings about the `native` target-cpu

This fixes a regression from #53031 where specifying `-C target-cpu=native` is
printing a lot of warnings from LLVM about `native` being an unknown CPU. It
turns out that `native` is indeed an unknown CPU and we have to perform a
mapping to an actual CPU name, but this mapping is only performed in one
location rather than all locations we inform LLVM about the target CPU.

This commit centralizes the mapping of `native` to LLVM's value of the native
CPU, ensuring that all locations we inform LLVM about the `target-cpu` it's
never `native`.

Closes #53322
alexcrichton added a commit to alexcrichton/rust that referenced this pull request Aug 28, 2018
This fixes a regression from rust-lang#53031 where specifying `-C target-cpu=native` is
printing a lot of warnings from LLVM about `native` being an unknown CPU. It
turns out that `native` is indeed an unknown CPU and we have to perform a
mapping to an actual CPU name, but this mapping is only performed in one
location rather than all locations we inform LLVM about the target CPU.

This commit centralizes the mapping of `native` to LLVM's value of the native
CPU, ensuring that all locations we inform LLVM about the `target-cpu` it's
never `native`.

Closes rust-lang#53322
bors added a commit that referenced this pull request Aug 29, 2018
Fix warnings about the `native` target-cpu

This fixes a regression from #53031 where specifying `-C target-cpu=native` is
printing a lot of warnings from LLVM about `native` being an unknown CPU. It
turns out that `native` is indeed an unknown CPU and we have to perform a
mapping to an actual CPU name, but this mapping is only performed in one
location rather than all locations we inform LLVM about the target CPU.

This commit centralizes the mapping of `native` to LLVM's value of the native
CPU, ensuring that all locations we inform LLVM about the `target-cpu` it's
never `native`.

Closes #53322
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.

None yet

8 participants