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 emit_debug_gdb_scripts target option and .. #49728

Merged
merged 2 commits into from
Apr 7, 2018

Conversation

japaric
Copy link
Member

@japaric japaric commented Apr 6, 2018

set it to false for no-std targets like ARM Cortex-M and MSP430. For the rationale of this change see the comment in thumb_base.rs

this is a temporary workaround until #44993 is implemented

r? @alexcrichton or @michaelwoerister

set it to false for no-std targets like ARM Cortex-M and MSP430. For the rationale of this change
see the comment in thumb_base.rs
@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 6, 2018
@alexcrichton
Copy link
Member

@bors: r+

Nice!

@bors
Copy link
Contributor

bors commented Apr 6, 2018

📌 Commit 1eed662 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 Apr 6, 2018
japaric added a commit to rust-embedded/cortex-m-rt that referenced this pull request Apr 6, 2018
this commit adds LLD support by removing all INFO sections. LLD kind of supports INFO in the form of
NOLOAD but when the linker script contains NOLOAD sections LLD emits a binary with false `size`
information: for example, it reported a fake increase of 20KB in .text and a fake increase of 1KB in
.bss when compiling a program that only allocates a single Box.

As the INFO sections are gone we can no longer support the stack overflow protection added in #43 so
all the other related changes, like making _stack_start overridable, have been removed as well.
If you want to continue using stack overflow protection you can stick to v0.3.x.

As the .debug_gdb_scripts output section has been removed from the linker script these changes will
only reliably support both LD and LLD if/when rust-lang/rust#49728 lands.

closes #53
@japaric
Copy link
Member Author

japaric commented Apr 6, 2018

I forgot to cc @pftbest and @whitequark

Copy link
Member

@whitequark whitequark left a comment

Choose a reason for hiding this comment

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

Seems reasonable to me other than the macOS change.

@@ -47,6 +47,7 @@ pub fn opts() -> TargetOptions {
exe_allocation_crate: super::maybe_jemalloc(),
has_elf_tls: version >= (10, 7),
abi_return_struct_as_int: true,
emit_debug_gdb_scripts: false,
Copy link
Member

Choose a reason for hiding this comment

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

Is this really right? Does no one use gdb on macOS?

Copy link
Member Author

Choose a reason for hiding this comment

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

This doesn't directly answer your question but this is equivalent to the current logic. See the diff on src/librustc_trans/debuginfo/gdb.rs; it has !cx.sess().target.target.options.is_like_osx. So I assume the answer is that people mainly use lldb?

Copy link
Member

Choose a reason for hiding this comment

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

Ah, this makes sense!

Copy link
Contributor

Choose a reason for hiding this comment

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

@whitequark Locally gdb is a pain to use on macOS because it would need to be signed in order to have access to process information and no-one cares to actually sign it and it's not shipped with macOS. It is "usable" for target != host but not necessarily the best option.

kennytm added a commit to kennytm/rust that referenced this pull request Apr 7, 2018
…xcrichton

add emit_debug_gdb_scripts target option and ..

set it to false for no-std targets like ARM Cortex-M and MSP430. For the rationale of this change see the comment in thumb_base.rs

this is a temporary workaround until rust-lang#44993 is implemented

r? @alexcrichton or @michaelwoerister
bors added a commit that referenced this pull request Apr 7, 2018
Rollup of 9 pull requests

Successful merges:

 - #49510 (Fix anchor position on fields)
 - #49652 (Fix anchors issue when everything is collapsed)
 - #49702 (std: Inline some Termination-related methods)
 - #49728 (add emit_debug_gdb_scripts target option and ..)
 - #49731 (add THUMB targets to rustup manifest)
 - #49742 (Using X headings instead of 0.X #49739)
 - #49748 (proc_macro: Improve Debug representations)
 - #49750 (bootstrap: Remove the fast path)
 - #49503 (Inject the `compiler_builtins` crate whenever the `core` crate is injected)

Failed merges:
@bors bors merged commit 1eed662 into rust-lang:master Apr 7, 2018
japaric added a commit to rust-embedded/cortex-m-rt that referenced this pull request Apr 8, 2018
this commit adds LLD support by removing all INFO sections. LLD kind of supports INFO in the form of
NOLOAD but when the linker script contains NOLOAD sections LLD emits a binary with false `size`
information: for example, it reported a fake increase of 20KB in .text and a fake increase of 1KB in
.bss when compiling a program that only allocates a single Box.

As the INFO sections are gone we can no longer support the stack overflow protection added in #43 so
all the other related changes, like making _stack_start overridable, have been removed as well.
If you want to continue using stack overflow protection you can stick to v0.3.x.

As the .debug_gdb_scripts output section has been removed from the linker script these changes will
only reliably support both LD and LLD if/when rust-lang/rust#49728 lands.

closes #53
kennytm pushed a commit to kennytm/rust that referenced this pull request Aug 7, 2018
Same as the other embedded targets, see:
rust-lang#49728

This is a temporary workaround for rust-lang#44993.
kennytm added a commit to kennytm/rust that referenced this pull request Aug 7, 2018
…ochenkov

set emit_debug_gdb_scripts: false for riscv32imac-unknown-none target

Same as the other embedded targets, see:
rust-lang#49728

This is a temporary workaround for rust-lang#44993.
adamgreig pushed a commit to rust-embedded/cortex-m that referenced this pull request Jan 12, 2022
this commit adds LLD support by removing all INFO sections. LLD kind of supports INFO in the form of
NOLOAD but when the linker script contains NOLOAD sections LLD emits a binary with false `size`
information: for example, it reported a fake increase of 20KB in .text and a fake increase of 1KB in
.bss when compiling a program that only allocates a single Box.

As the INFO sections are gone we can no longer support the stack overflow protection added in #43 so
all the other related changes, like making _stack_start overridable, have been removed as well.
If you want to continue using stack overflow protection you can stick to v0.3.x.

As the .debug_gdb_scripts output section has been removed from the linker script these changes will
only reliably support both LD and LLD if/when rust-lang/rust#49728 lands.

closes #53
reitermarkus pushed a commit to reitermarkus/cortex-m that referenced this pull request May 4, 2022
this commit adds LLD support by removing all INFO sections. LLD kind of supports INFO in the form of
NOLOAD but when the linker script contains NOLOAD sections LLD emits a binary with false `size`
information: for example, it reported a fake increase of 20KB in .text and a fake increase of 1KB in
.bss when compiling a program that only allocates a single Box.

As the INFO sections are gone we can no longer support the stack overflow protection added in rust-embedded#43 so
all the other related changes, like making _stack_start overridable, have been removed as well.
If you want to continue using stack overflow protection you can stick to v0.3.x.

As the .debug_gdb_scripts output section has been removed from the linker script these changes will
only reliably support both LD and LLD if/when rust-lang/rust#49728 lands.

closes rust-embedded#53
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

6 participants