Convert `asan.options` and `asan_extract` to Android.bp
In the original Android.mk, `asan.option` is only enabled when
"address" is present in SANITIZE_TARGET.
`asan_extract` is only enabled when `SANITIZE_TARGET_SYSTEM` is `true`
and `address` is present in SANITIZE_TARGET.
However, in the normal build system design, a module should `not`
decide when it should be enabled.
Therefore, the `ifeq` condition should be directly removed during
conversion.
The correct approach is:
Wait until converting `init.environ.rc`, then use `select` or similar
methods to determine whether it should use `asan.option` or
`asan_extract`.
Bug: 353164536
Test: SANITIZE_TARGET=address m init.environ.rc
SANITIZE_TARGET_SYSTEM=true SANITIZE_TARGET=address m init.environ.rc
Change-Id: I69af3199536a3ba9f54dcfa198295826303e2d22
diff --git a/rootdir/Android.bp b/rootdir/Android.bp
index e8f7627..7105ed5 100644
--- a/rootdir/Android.bp
+++ b/rootdir/Android.bp
@@ -114,10 +114,23 @@
sub_dir: "init",
}
+prebuilt_etc {
+ name: "asan.options",
+ src: "asan.options",
+}
+
+sh_binary {
+ name: "asan_extract",
+ src: "asan_extract.sh",
+ init_rc: ["asan_extract.rc"],
+ // We need bzip2 on device for extraction.
+ required: ["bzip2"],
+}
+
llndk_libraries_txt {
name: "llndk.libraries.txt",
}
sanitizer_libraries_txt {
name: "sanitizer.libraries.txt",
-}
\ No newline at end of file
+}