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

Sanitizer: Set useLegacyPackaging for asan #970

Merged
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
18 changes: 18 additions & 0 deletions sanitizers/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ android {

defaultConfig {
applicationId "com.example.sanitizers"
// If you raise minSdk to 23 or higher, make sure you've read the note
// below about useLegacyPackaging.
minSdk 21
targetSdk 32
versionCode 1
Expand Down Expand Up @@ -37,6 +39,22 @@ android {
asan {
initWith debug
debuggable true
packagingOptions {
jniLibs {
// Without legacy packaging, the Android package manager
// will not extract the libraries from the APK, and the app
// will instead load them directly from the APK. That saves
// space on disk so is generally preferable, but ASan
// doesn't work in that configuration, so we need to
// opt-out of the new behavior.
//
// Note that this won't actually do anything to the sample
// in its default configuration. The sample uses minSdk 21,
// and legacy packaging is the default for all builds below
// minSdk 23.
useLegacyPackaging true
}
}
externalNativeBuild {
cmake {
arguments "-DANDROID_ARM_MODE=arm", "-DANDROID_STL=c++_shared", "-DSANITIZE=asan"
Expand Down
Loading