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

Disable debug sections when optimization flags is set for LLD. #52887

Merged
merged 1 commit into from
Aug 3, 2018

Conversation

yurydelendik
Copy link
Contributor

Currently LLD does not error when optimization is set and debugging information sections are present. (See discussion at https://reviews.llvm.org/D47901)

Using --strip-debug along with the -O option.

@rust-highfive
Copy link
Collaborator

r? @petrochenkov

(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 Jul 31, 2018
@yurydelendik yurydelendik force-pushed the disable-lld-symbols branch from 083287b to e9509d7 Compare July 31, 2018 00:58
@alexcrichton
Copy link
Member

@bors: r+

@bors
Copy link
Contributor

bors commented Jul 31, 2018

📌 Commit e9509d7 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 Jul 31, 2018
@bors
Copy link
Contributor

bors commented Aug 2, 2018

⌛ Testing commit e9509d7 with merge b76cec425cc1337e49f29ffaa507c30b46a430ca...

@bors
Copy link
Contributor

bors commented Aug 2, 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 2, 2018
@rust-highfive
Copy link
Collaborator

The job dist-mips-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.
[00:46:21] [RUSTC-TIMING] proc_macro test:false 11.366
[00:46:21]    Compiling syntax_ext v0.0.0 (file:///checkout/src/libsyntax_ext)
[00:46:46] [RUSTC-TIMING] syntax_ext test:false 24.694

Broadcast message from root@travis-job-94b6900e-aaca-4d2d-b25c-82baabd955aa
 (unknown) at 8:23 ...
The system is going down for power off NOW!
[00:48:27] 
[00:48:27] Session terminated, terminating shell... ...terminated.

The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 143.
travis_time:start:1b629d73
$ 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)

@kennytm
Copy link
Member

kennytm commented Aug 2, 2018

@bors retry travis-ci/travis-ci#4924

@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 2, 2018
cramertj added a commit to cramertj/rust that referenced this pull request Aug 2, 2018
…=alexcrichton

Disable debug sections when optimization flags is set for LLD.

Currently LLD does not error when optimization is set and debugging information sections are present. (See discussion at https://reviews.llvm.org/D47901)

Using `--strip-debug` along with the `-O` option.
cramertj added a commit to cramertj/rust that referenced this pull request Aug 2, 2018
…=alexcrichton

Disable debug sections when optimization flags is set for LLD.

Currently LLD does not error when optimization is set and debugging information sections are present. (See discussion at https://reviews.llvm.org/D47901)

Using `--strip-debug` along with the `-O` option.
@bors
Copy link
Contributor

bors commented Aug 3, 2018

⌛ Testing commit e9509d7 with merge 3a82002a034c903939a3139b68ec2db50cdf43fa...

@bors
Copy link
Contributor

bors commented Aug 3, 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 3, 2018
@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-tools 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:23:27] test actions::hover::test::test_extract_docs_empty_line_before_decl ... ok
[01:23:27] test actions::hover::test::test_extract_docs_module_docs ... ok
[01:23:27] test actions::hover::test::test_extract_docs_module_docs_no_copyright ... ok
[01:23:27] test actions::diagnostics::diagnostic_suggestion_test::suggest_mut_when_not_mut ... ok
[01:23:27] test actions::hover::test::test_extract_docs_module_docs_with_attribute ... ok
[01:23:27] test actions::hover::test::test_process_docs_bash_block ... ok
[01:23:27] test actions::hover::test::test_format_method ... ok
[01:23:27] test actions::hover::test::test_process_docs_rust_blocks ... ok
[01:23:27] test actions::hover::test::test_tooltip ... ignored
[01:23:27] test actions::hover::test::test_format_object ... ok
[01:23:27] test actions::hover::test::test_process_docs_racer_returns_extra_slashes ... ok
[01:23:27] test actions::requests::test::test_sort_deglob_str ... ok
[01:23:27] test actions::hover::test::test_noindent ... ok
[01:23:27] test cmd::url_workaround_unc_canonicals ... ok
[01:23:27] test server::io::tests::read_message_fails_on_empty_input ... ok
---
[01:23:36]     }
[01:23:36] ]
[01:23:36] expect_messages_unordered:
[01:23:36]   results: [
[01:23:36]     "{\"jsonrpc\":\"2.0\",\"method\":\"textDocument/publishDiagnostics\",\"params\":{\"diagnostics\":[{\"code\":\"unused_variables\",\"message\":\"unused variable: `val`\\n\\nnote: #[warn(unused_variables)] on by default\\nhelp: consider using `_val` instead: `_val`\",\"range\":{\"end\":{\"character\":27,\"line\":4},\"start\":{\"character\":24,\"line\":4}},\"severity\":2,\"source\":\"rustc\"}],\"uri\":\"file:///checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/rlsit/t0/simple_workspace/binary/src/main.rs\"}}",
[01:23:36]     "{\"jsonrpc\":\"2.0\",\"method\":\"textDocument/publishDiagnostics\",\"params\":{\"diagnostics\":[{\"code\":\"unused_variables\",\"message\":\"unused variable: `unused`\\n\\nnote: #[warn(unused_variables)] on by default\\nhelp: consider using `_unused` instead: `_unused`\",\"range\":{\"end\":{\"character\":30,\"line\":2},\"start\":{\"character\":24,\"line\":2}},\"severity\":2,\"source\":\"rustc\"},{\"code\":\"unused_variables\",\"message\":\"unused variable: `test_val`\\n\\nhelp: consider using `_test_val` instead: `_test_val`\",\"range\":{\"end\":{\"character\":36,\"line\":9},\"start\":{\"character\":28,\"line\":9}},\"severity\":2,\"source\":\"rustc\"}],\"uri\":\"file:///checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/rlsit/t0/simple_workspace/library/src/lib.rs\"}}"
[01:23:36]   expected: [
[01:23:36]     ExpectedMessage {
[01:23:36]         id: None,
[01:23:36]         contains: [
---
[01:23:37]     }
[01:23:37] ]
[01:23:37] expect_messages_unordered:
[01:23:37]   results: [
[01:23:37]     "{\"jsonrpc\":\"2.0\",\"method\":\"textDocument/publishDiagnostics\",\"params\":{\"diagnostics\":[{\"code\":\"E0308\",\"message\":\"mismatched types\\n\\nexpected u32, found u64\",\"range\":{\"end\":{\"character\":55,\"line\":4},\"start\":{\"character\":35,\"line\":4}},\"severity\":1,\"source\":\"rustc\"}],\"uri\":\"file:///checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/rlsit/t0/simple_workspace/binary/src/main.rs\"}}",
[01:23:37]     "{\"jsonrpc\":\"2.0\",\"method\":\"textDocument/publishDiagnostics\",\"params\":{\"diagnostics\":[{\"code\":\"E0308\",\"message\":\"mismatched types\\n\\nexpected u32, found u64\",\"range\":{\"end\":{\"character\":62,\"line\":9},\"start\":{\"character\":44,\"line\":9}},\"severity\":1,\"source\":\"rustc\"},{\"code\":\"unused_variables\",\"message\":\"unused variable: `unused`\\n\\nnote: #[warn(unused_variables)] on by default\\nhelp: consider using `_unused` instead: `_unused`\",\"range\":{\"end\":{\"character\":30,\"line\":2},\"start\":{\"character\":24,\"line\":2}},\"severity\":2,\"source\":\"rustc\"}],\"uri\":\"file:///checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/rlsit/t0/simple_workspace/library/src/lib.rs\"}}"
[01:23:37]   expected: [
[01:23:37]     ExpectedMessage {
[01:23:37]         id: None,
[01:23:37]         contains: [
[01:23:37]         contains: [
[01:23:37]             "publishDiagnostics",
[01:23:37]             "library/src/lib.rs",
[01:23:37]             "unused variable: `unused`",
[01:23:37]             "expected u32, found u64"
[01:23:37]     },
[01:23:37]     ExpectedMessage {
[01:23:37]         id: None,
[01:23:37]         contains: [
[01:23:37]         contains: [
[01:23:37]             "publishDiagnostics",
[01:23:37]             "binary/src/main.rs",
[01:23:37]             "expected u32, found u64"
[01:23:37]     }
[01:23:37] ]
[01:23:37] expect_messages:
[01:23:37]   results: [
---
[01:23:39]     }
[01:23:39] ]
[01:23:39] expect_messages_unordered:
[01:23:39]   results: [
[01:23:39]     "{\"jsonrpc\":\"2.0\",\"method\":\"textDocument/publishDiagnostics\",\"params\":{\"diagnostics\":[{\"code\":\"unused_variables\",\"message\":\"unused variable: `val`\\n\\nnote: #[warn(unused_variables)] on by default\\nhelp: consider using `_val` instead: `_val`\",\"range\":{\"end\":{\"character\":27,\"line\":4},\"start\":{\"character\":24,\"line\":4}},\"severity\":2,\"source\":\"rustc\"}],\"uri\":\"file:///checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/rlsit/t0/simple_workspace/binary/src/main.rs\"}}",
[01:23:39]     "{\"jsonrpc\":\"2.0\",\"method\":\"textDocument/publishDiagnostics\",\"params\":{\"diagnostics\":[{\"code\":\"unused_variables\",\"message\":\"unused variable: `unused`\\n\\nnote: #[warn(unused_variables)] on by default\\nhelp: consider using `_unused` instead: `_unused`\",\"range\":{\"end\":{\"character\":30,\"line\":2},\"start\":{\"character\":24,\"line\":2}},\"severity\":2,\"source\":\"rustc\"},{\"code\":\"unused_variables\",\"message\":\"unused variable: `test_val`\\n\\nhelp: consider using `_test_val` instead: `_test_val`\",\"range\":{\"end\":{\"character\":36,\"line\":9},\"start\":{\"character\":28,\"line\":9}},\"severity\":2,\"source\":\"rustc\"}],\"uri\":\"file:///checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/rlsit/t0/simple_workspace/library/src/lib.rs\"}}"
[01:23:39]   expected: [
[01:23:39]     ExpectedMessage {
[01:23:39]         id: None,
[01:23:39]         contains: [
---
[01:29:01] test config::file_lines::test::test_range_contains ... ok
[01:29:01] test config::file_lines::test::test_range_merge ... ok
[01:29:01] test config::file_lines::test::test_range_intersects ... ok
[01:29:01] test config::file_lines::test::test_range_adjacent_to ... ok
[01:29:01] test config::options::test_newline_style_auto_apply ... ok
[01:29:01] test config::license::test::test_parse_license_template ... ok
[01:29:01] test config::options::test_newline_style_auto_detect ... ok
[01:29:01] test config::test::test_config_used_to_toml ... ok
[01:29:01] test config::test::test_print_docs_exclude_unstable ... ok
[01:29:01] test config::test::test_print_docs_include_unstable ... ok
[01:29:01] test config::test::test_was_set ... ok
---
travis_time:end:35932cee:start=1533277998863333022,finish=1533277998873060496,duration=9727474
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:0d97bf14
$ 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:0087ec14
travis_time:start:0087ec14
$ 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:297fe164
$ 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)

@kennytm
Copy link
Member

kennytm commented Aug 3, 2018

@bors retry travis-ci/travis-ci#9696

[01:32:28] fatal: unable to access 'https://github.com/rust-lang-nursery/rust-toolstate.git/': Could not resolve host: github.com

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

bors commented Aug 3, 2018

⌛ Testing commit e9509d7 with merge 636e3d1db7cd7edc005f94301dd1501c6fd86a53...

@bors
Copy link
Contributor

bors commented Aug 3, 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 3, 2018
@rust-highfive
Copy link
Collaborator

The job dist-various-1 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:38:05]    Compiling rustc_resolve v0.0.0 (file:///checkout/src/librustc_resolve)
[00:38:06] [RUSTC-TIMING] rustc_metadata test:false 123.735
[00:38:06]    Compiling rustc_allocator v0.0.0 (file:///checkout/src/librustc_allocator)

Broadcast message from root@travis-job-c09ad44e-3cfb-4737-8ebd-a0f0d58996b3
 (unknown) at 9:21 ...
The system is going down for power off NOW!
[00:38:21] 
[00:38:21] Session terminated, terminating shell... ...terminated.

The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 143.
travis_time:start:14703fcc
$ 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)

@kennytm
Copy link
Member

kennytm commented Aug 3, 2018

@bors retry travis-ci/travis-ci#4924

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

bors commented Aug 3, 2018

⌛ Testing commit e9509d7 with merge 88e0ff1...

bors added a commit that referenced this pull request Aug 3, 2018
Disable debug sections when optimization flags is set for LLD.

Currently LLD does not error when optimization is set and debugging information sections are present. (See discussion at https://reviews.llvm.org/D47901)

Using `--strip-debug` along with the `-O` option.
@bors
Copy link
Contributor

bors commented Aug 3, 2018

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

@bors bors merged commit e9509d7 into rust-lang:master Aug 3, 2018
@Hywan
Copy link
Contributor

Hywan commented Aug 14, 2018

I suspect it creates a regression for tools using debuginfo even in release mode, like wasm-snip, see rustwasm/wasm-snip#13.

@alexcrichton
Copy link
Member

Ah excellent point @Hywan! I think I noticed this too awhile back but failed to diagnose. @yurydelendik I think what's happening here is that --strip-debug is also removing the function names section. Do you know if we can strip debuginfo without stripping that section?

@yurydelendik
Copy link
Contributor Author

/cc @sbc100

what's happening here is that --strip-debug is also removing the function names section. Do you know if we can strip debuginfo without stripping that section?

No, I don't. AFAIK the name section considered as debug info and in Firefox it forces to store wasm bytecode thus adds overhead to the runtime.

alexcrichton added a commit to alexcrichton/rust that referenced this pull request Aug 16, 2018
Originally added in rust-lang#52887 this commit disables passing `--strip-debug` to LLD
when optimized. This bring back the original bug of emitting broken debuginfo
but currently it *also* strips the `name` section which makes it very difficult
to inspect the final binary. A real fix is happening at
https://reviews.llvm.org/D50729 and we can reevaluate once we've updated LLD to
have that commit.
frewsxcv added a commit to frewsxcv/rust that referenced this pull request Aug 17, 2018
…yurydelendik

wasm: Remove --strip-debug argument to LLD

Originally added in rust-lang#52887 this commit disables passing `--strip-debug` to LLD
when optimized. This bring back the original bug of emitting broken debuginfo
but currently it *also* strips the `name` section which makes it very difficult
to inspect the final binary. A real fix is happening at
https://reviews.llvm.org/D50729 and we can reevaluate once we've updated LLD to
have that commit.
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.

7 participants