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

remove build.rs for android #656

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 0 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
name = "backtrace"
version = "0.3.73"
authors = ["The Rust Project Developers"]
build = "build.rs"
license = "MIT OR Apache-2.0"
readme = "README.md"
repository = "https://github.com/rust-lang/backtrace-rs"
Expand Down Expand Up @@ -49,11 +48,6 @@ version = "0.36.0"
default-features = false
features = ['read_core', 'elf', 'macho', 'pe', 'xcoff', 'unaligned', 'archive']

[build-dependencies]
# Only needed for Android, but cannot be target dependent
# https://github.com/rust-lang/cargo/issues/4932
cc = "1.0.97"

[dev-dependencies]
dylib-dep = { path = "crates/dylib-dep" }
libloading = "0.7"
Expand Down
55 changes: 0 additions & 55 deletions build.rs

This file was deleted.

2 changes: 1 addition & 1 deletion ci/android-ndk.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
set -ex

ANDROID_NDK_URL=https://dl.google.com/android/repository
ANDROID_NDK_ARCHIVE=android-ndk-r25b-linux.zip
ANDROID_NDK_ARCHIVE=android-ndk-r26d-linux.zip

mkdir /android-toolchain
cd /android-toolchain
Expand Down
2 changes: 1 addition & 1 deletion ci/docker/arm-linux-androideabi/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ RUN /android-ndk.sh
ENV PATH=$PATH:/android-toolchain/ndk/toolchains/llvm/prebuilt/linux-x86_64/bin

# TODO: run tests in an emulator eventually
ENV CARGO_TARGET_ARM_LINUX_ANDROIDEABI_LINKER=armv7a-linux-androideabi19-clang \
ENV CARGO_TARGET_ARM_LINUX_ANDROIDEABI_LINKER=armv7a-linux-androideabi21-clang \
CARGO_TARGET_ARM_LINUX_ANDROIDEABI_RUNNER=echo
2 changes: 1 addition & 1 deletion ci/docker/armv7-linux-androideabi/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ RUN /android-ndk.sh
ENV PATH=$PATH:/android-toolchain/ndk/toolchains/llvm/prebuilt/linux-x86_64/bin

# TODO: run tests in an emulator eventually
ENV CARGO_TARGET_ARMV7_LINUX_ANDROIDEABI_LINKER=armv7a-linux-androideabi19-clang \
ENV CARGO_TARGET_ARMV7_LINUX_ANDROIDEABI_LINKER=armv7a-linux-androideabi21-clang \
CARGO_TARGET_ARMV7_LINUX_ANDROIDEABI_RUNNER=echo
2 changes: 1 addition & 1 deletion ci/docker/i686-linux-android/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ RUN /android-ndk.sh
ENV PATH=$PATH:/android-toolchain/ndk/toolchains/llvm/prebuilt/linux-x86_64/bin

# TODO: run tests in an emulator eventually
ENV CARGO_TARGET_I686_LINUX_ANDROID_LINKER=i686-linux-android19-clang \
ENV CARGO_TARGET_I686_LINUX_ANDROID_LINKER=i686-linux-android21-clang \
CARGO_TARGET_I686_LINUX_ANDROID_RUNNER=echo
1 change: 0 additions & 1 deletion crates/as-if-std/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ features = ['read_core', 'elf', 'macho', 'pe', 'xcoff', 'unaligned', 'archive']

[build-dependencies]
# Dependency of the `backtrace` crate
cc = "1.0.97"
windows-bindgen = "0.56"

[features]
Expand Down
8 changes: 0 additions & 8 deletions crates/as-if-std/build.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
// backtrace-rs requires a feature check on Android targets, so
// we need to run its build.rs as well.
#[allow(unused_extern_crates)]
#[path = "../../build.rs"]
mod backtrace_build_rs;

fn main() {
println!("cargo:rustc-cfg=backtrace_in_libstd");

backtrace_build_rs::main();
}
14 changes: 6 additions & 8 deletions src/symbolize/gimli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ impl Mapping {
// only borrow `map` and `stash` and we're preserving them below.
cx: unsafe { core::mem::transmute::<Context<'_>, Context<'static>>(cx) },
_map: data,
stash: stash,
stash,
})
}
}
Expand All @@ -122,13 +122,11 @@ impl<'data> Context<'data> {
if cfg!(not(target_os = "aix")) {
let data = object.section(stash, id.name()).unwrap_or(&[]);
Ok(EndianSlice::new(data, Endian))
} else if let Some(name) = id.xcoff_name() {
let data = object.section(stash, name).unwrap_or(&[]);
Ok(EndianSlice::new(data, Endian))
} else {
if let Some(name) = id.xcoff_name() {
let data = object.section(stash, name).unwrap_or(&[]);
Ok(EndianSlice::new(data, Endian))
} else {
Ok(EndianSlice::new(&[], Endian))
}
Ok(EndianSlice::new(&[], Endian))
}
})
.ok()?;
Expand Down Expand Up @@ -226,7 +224,7 @@ cfg_if::cfg_if! {
target_os = "hurd",
target_os = "openbsd",
target_os = "netbsd",
all(target_os = "android", feature = "dl_iterate_phdr"),
target_os = "android",
),
not(target_env = "uclibc"),
))] {
Expand Down
Loading