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

backtrace-sys: Use target_pointer_width for BACKTRACE_ELF_SIZE #122

Merged
merged 1 commit into from
Aug 15, 2018

Conversation

cuviper
Copy link
Member

@cuviper cuviper commented Aug 15, 2018

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 build script can use CARGO_CFG_TARGET_POINTER_WIDTH to
reliably detect 64-bit targets.

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 build script can use `CARGO_CFG_TARGET_POINTER_WIDTH` to
reliably detect 64-bit targets.
@cuviper
Copy link
Member Author

cuviper commented Aug 15, 2018

This will need fixing in rust/src/libstd/build.rs too. I plan to do that along with a bump to backtrace-sys, once this is merged and published.

@alexcrichton
Copy link
Member

An excellent and much better idea, thanks!

@alexcrichton alexcrichton merged commit 2e126b1 into rust-lang:master Aug 15, 2018
cuviper added a commit to cuviper/rust that referenced this pull request Aug 15, 2018
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.
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.
pietroalbini pushed a commit to pietroalbini/rust that referenced this pull request Sep 1, 2018
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 added a commit to cuviper/rust that referenced this pull request Sep 4, 2018
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants