diff options
| author | Marco A L Barbosa <malbarbo@gmail.com> | 2017-05-05 17:12:05 -0300 |
|---|---|---|
| committer | Marco A L Barbosa <malbarbo@gmail.com> | 2017-05-05 17:12:05 -0300 |
| commit | 3acfa81e6b619cf2d6af896d605495f8e2ab9d41 (patch) | |
| tree | c2e22c5be689eecd69aaed5d02117a425dd74ef6 | |
| parent | 222971f7d2a098b4b8b57520452ab475bc5ea45f (diff) | |
| download | rust-3acfa81e6b619cf2d6af896d605495f8e2ab9d41.tar.gz rust-3acfa81e6b619cf2d6af896d605495f8e2ab9d41.zip | |
bootstrap: openssl android support
| -rw-r--r-- | src/bootstrap/native.rs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/bootstrap/native.rs b/src/bootstrap/native.rs index 3d87f701b2a..67edd70a156 100644 --- a/src/bootstrap/native.rs +++ b/src/bootstrap/native.rs @@ -309,11 +309,15 @@ pub fn openssl(build: &Build, target: &str) { configure.arg("no-ssl3"); let os = match target { + "aarch64-linux-android" => "linux-aarch64", "aarch64-unknown-linux-gnu" => "linux-aarch64", + "arm-linux-androideabi" => "android", "arm-unknown-linux-gnueabi" => "linux-armv4", "arm-unknown-linux-gnueabihf" => "linux-armv4", + "armv7-linux-androideabi" => "android-armv7", "armv7-unknown-linux-gnueabihf" => "linux-armv4", "i686-apple-darwin" => "darwin-i386-cc", + "i686-linux-android" => "android-x86", "i686-unknown-freebsd" => "BSD-x86-elf", "i686-unknown-linux-gnu" => "linux-elf", "i686-unknown-linux-musl" => "linux-elf", @@ -326,6 +330,7 @@ pub fn openssl(build: &Build, target: &str) { "powerpc64le-unknown-linux-gnu" => "linux-ppc64le", "s390x-unknown-linux-gnu" => "linux64-s390x", "x86_64-apple-darwin" => "darwin64-x86_64-cc", + "x86_64-linux-android" => "linux-x86_64", "x86_64-unknown-freebsd" => "BSD-x86_64", "x86_64-unknown-linux-gnu" => "linux-x86_64", "x86_64-unknown-linux-musl" => "linux-x86_64", @@ -337,6 +342,18 @@ pub fn openssl(build: &Build, target: &str) { for flag in build.cflags(target) { configure.arg(flag); } + // There is no specific os target for android aarch64 or x86_64, + // so we need to pass some extra cflags + if target == "aarch64-linux-android" || target == "x86_64-linux-android" { + configure.arg("-mandroid"); + configure.arg("-fomit-frame-pointer"); + } + // Make PIE binaries + // Non-PIE linker support was removed in Lollipop + // https://source.android.com/security/enhancements/enhancements50 + if target == "i686-linux-android" { + configure.arg("no-asm"); + } configure.current_dir(&obj); println!("Configuring openssl for {}", target); build.run_quiet(&mut configure); |
