0
0
mirror of https://github.com/signalapp/libsignal.git synced 2024-09-19 19:42:19 +02:00

Re-apply "android: Don't strip debug info out of the AAR"

A revised version of the earlier 23192280:
- Uses --build-id for all archs, not just aarch64
- Also raises Gradle's memory limits
This commit is contained in:
Jordan Rose 2024-07-25 14:22:56 -07:00 committed by GitHub
parent 85e0de9207
commit 9d729ff083
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 14 additions and 8 deletions

View File

@ -54,6 +54,8 @@ android {
pickFirst 'lib/*/libsignal_jni.so'
pickFirst 'lib/*/libsignal_jni_testing.so'
}
// Defer stripping to the Android app project.
doNotStrip '**/*.so'
}
publishing {

View File

@ -1,4 +1,5 @@
android.enableAdditionalTestOutput=true
android.useAndroidX=true
# Don't rely on the HTML output; that's not useful in CI.
org.gradle.dependency.verification.console=verbose
org.gradle.dependency.verification.console=verbose
org.gradle.jvmargs=-Xmx4g -Xms256m -XX:MaxMetaspaceSize=1g

View File

@ -6,12 +6,15 @@
use std::env;
fn main() {
if env::var("CARGO_CFG_TARGET_ARCH").expect("set by Cargo") == "aarch64"
&& env::var("CARGO_CFG_TARGET_OS").expect("set by Cargo") == "android"
{
// HACK: Force libdl to be linked.
// Something about the Docker-based build results in it getting skipped;
// if we figure out what, we can remove this.
println!("cargo:rustc-cdylib-link-arg=-Wl,--no-as-needed,-ldl,--as-needed");
if env::var("CARGO_CFG_TARGET_OS").expect("set by Cargo") == "android" {
// --build-id ensures that Android Studio's LLDB can map stripped binaries back to their debug info
println!("cargo:rustc-cdylib-link-arg=-Wl,--build-id");
if env::var("CARGO_CFG_TARGET_ARCH").expect("set by Cargo") == "aarch64" {
// HACK: Force libdl to be linked.
// Something about the Docker-based build results in it getting skipped;
// if we figure out what, we can remove this.
println!("cargo:rustc-cdylib-link-arg=-Wl,--no-as-needed,-ldl,--as-needed");
}
}
}