Skip to content

Build emutls.c on Android. #458

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

Merged
merged 1 commit into from
Mar 30, 2022
Merged
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
10 changes: 10 additions & 0 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,16 @@ mod c {
sources.remove(&["__aeabi_cdcmp", "__aeabi_cfcmp"]);
}

// Android uses emulated TLS so we need a runtime support function.
if target_os == "android" {
sources.extend(&[("__emutls_get_address", "emutls.c")]);

// Work around a bug in the NDK headers (fixed in
// https://r.android.com/2038949 which will be released in a future
// NDK version) by providing a definition of LONG_BIT.
cfg.define("LONG_BIT", "(8 * sizeof(long))");
}

// When compiling the C code we require the user to tell us where the
// source code is, and this is largely done so when we're compiling as
// part of rust-lang/rust we can use the same llvm-project repository as
Expand Down