Skip to content

std: Use target_pointer_width for BACKTRACE_ELF_SIZE - #53377

Merged
bors merged 1 commit into
rust-lang:masterfrom
cuviper:pointer-elf_size
Aug 16, 2018
Merged

std: Use target_pointer_width for BACKTRACE_ELF_SIZE#53377
bors merged 1 commit into
rust-lang:masterfrom
cuviper:pointer-elf_size

Conversation

@cuviper

Copy link
Copy Markdown
Member

The former code used target.contains("64") to detect Elf64 targets,
but this is inaccurate in a few cases:

  • s390x-unknown-linux-gnu is 64-bit
  • sparcv9-sun-solaris is 64-bit
  • x86_64-unknown-linux-gnux32 is 32-bit

Instead the std build script can use CARGO_CFG_TARGET_POINTER_WIDTH
to reliably detect 64-bit targets for libbacktrace.

Also update to backtrace-sys 0.1.24 for rust-lang/backtrace-rs#122.

The former code used `target.contains("64")` to detect Elf64 targets,
but this is inaccurate in a few cases:
- `s390x-unknown-linux-gnu` is 64-bit
- `sparcv9-sun-solaris` is 64-bit
- `x86_64-unknown-linux-gnux32` is 32-bit
Instead the `std` build script can use `CARGO_CFG_TARGET_POINTER_WIDTH`
to reliably detect 64-bit targets for libbacktrace.
Also update to backtrace-sys 0.1.24 for rust-lang/backtrace-rs#122.
@cuviper

Copy link
Copy Markdown
MemberAuthor

r? @alexcrichton

Fixes #53372 when std has debuginfo, but I'm still seeing the backtrace tests hang when std does not have debuginfo. I will keep investigating that...

@alexcrichton

Copy link
Copy Markdown
Member

@bors: r+

@bors

bors commented Aug 15, 2018

Copy link
Copy Markdown
Collaborator

📌 Commit e0d8364 has been approved by alexcrichton

@borsbors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Aug 15, 2018
@cuvipercuviper added the beta-nominated Nominated for backporting to the compiler in the beta channel. label Aug 15, 2018
@cuvipercuviper mentioned this pull request Aug 15, 2018
kennytm added a commit to kennytm/rust that referenced this pull request Aug 16, 2018
…chton
std: Use target_pointer_width for BACKTRACE_ELF_SIZE
The former code used `target.contains("64")` to detect Elf64 targets,
but this is inaccurate in a few cases:
- `s390x-unknown-linux-gnu` is 64-bit
- `sparcv9-sun-solaris` is 64-bit
- `x86_64-unknown-linux-gnux32` is 32-bit
Instead the `std` build script can use `CARGO_CFG_TARGET_POINTER_WIDTH`
to reliably detect 64-bit targets for libbacktrace.
Also update to backtrace-sys 0.1.24 for rust-lang/backtrace-rs#122.
@kennytmkennytm mentioned this pull request Aug 16, 2018
bors added a commit that referenced this pull request Aug 16, 2018
Rollup of 10 pull requests
Successful merges:
- #52946 (Documented impl From on line 367 of libserialize/json.rs)
- #53234 (Remove Travis shutdown debug scripts, and remove CI-specific DNS settings)
- #53313 (Two small improvements)
- #53360 (Addressed #51602)
- #53364 (Warn if the user tries to use GATs)
- #53373 (Tweak unclosed delimiter parser error)
- #53377 (std: Use target_pointer_width for BACKTRACE_ELF_SIZE)
- #53395 (Use #[non_exhaustive] on internal enums)
- #53399 (Tidy: ignore non-Markdown files when linting for the Unstable Book)
- #53412 (syntax_ext: remove leftover span_err_if_not_stage0 macro.)
@bors
bors merged commit e0d8364 into rust-lang:masterAug 16, 2018
@emilyalbiniemilyalbini added the T-libs-api [DEPRECATED; DO NOT USE] label Aug 25, 2018
@emilyalbini

Copy link
Copy Markdown
Member

Ping @rust-lang/libs, should this PR be backported to beta?

@alexcrichtonalexcrichton added the beta-accepted Accepted for backporting to the compiler in the beta channel. label Aug 30, 2018
@alexcrichton

Copy link
Copy Markdown
Member

Ah certainly! This is fine to backport

@emilyalbiniemilyalbini mentioned this pull request Sep 1, 2018
@emilyalbiniemilyalbini removed the beta-nominated Nominated for backporting to the compiler in the beta channel. label Sep 1, 2018
bors added a commit that referenced this pull request Sep 1, 2018
[beta] Rollup backports
Merged and approved:
* #53653: Address two regressions
* #53377: std: Use target_pointer_width for BACKTRACE_ELF_SIZE
* #52969: rustbuild: fix local_rebuild
r? @ghost
bors added a commit that referenced this pull request Sep 4, 2018
[beta] update backtrace-sys to 0.1.24
This is the other part of #53377 that was missed in the #53880 backport.
r? @pietroalbini
@cuviper
cuviper deleted the pointer-elf_size branch March 27, 2019 22:20
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

beta-acceptedAccepted for backporting to the compiler in the beta channel.S-waiting-on-borsStatus: Waiting on bors to run and complete tests. Bors will change the label on completion.T-libs-api[DEPRECATED; DO NOT USE]

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@cuviper@alexcrichton@bors@emilyalbini