Bob Badour | 051ef78 | 2021-02-12 17:07:05 -0800 | [diff] [blame] | 1 | package { |
| 2 | default_applicable_licenses: ["frameworks_base_cmds_app_process_license"], |
| 3 | } |
| 4 | |
| 5 | // Added automatically by a large-scale-change |
| 6 | // See: http://go/android-license-faq |
| 7 | license { |
| 8 | name: "frameworks_base_cmds_app_process_license", |
| 9 | visibility: [":__subpackages__"], |
| 10 | license_kinds: [ |
| 11 | "SPDX-license-identifier-Apache-2.0", |
| 12 | ], |
| 13 | license_text: [ |
| 14 | "NOTICE", |
| 15 | ], |
| 16 | } |
| 17 | |
Colin Cross | 45c0d71 | 2019-03-28 22:31:35 -0700 | [diff] [blame] | 18 | cc_binary { |
| 19 | name: "app_process", |
| 20 | |
| 21 | srcs: ["app_main.cpp"], |
| 22 | |
| 23 | multilib: { |
| 24 | lib32: { |
Roland Levillain | 7103a89 | 2019-06-05 18:26:44 +0100 | [diff] [blame] | 25 | suffix: "32", |
Colin Cross | 45c0d71 | 2019-03-28 22:31:35 -0700 | [diff] [blame] | 26 | }, |
| 27 | lib64: { |
Roland Levillain | 7103a89 | 2019-06-05 18:26:44 +0100 | [diff] [blame] | 28 | suffix: "64", |
Colin Cross | 45c0d71 | 2019-03-28 22:31:35 -0700 | [diff] [blame] | 29 | }, |
| 30 | }, |
| 31 | |
Ryan Prichard | 6b86dfb | 2021-06-04 13:24:10 -0700 | [diff] [blame] | 32 | // Symbols exported from the executable in .dynsym interpose symbols in every |
| 33 | // linker namespace, including an app's classloader namespace. Provide this |
| 34 | // version script to prevent unwanted interposition. |
| 35 | // |
| 36 | // By default, the static linker doesn't export most of an executable's symbols, |
| 37 | // but it will export a symbol that appears to override a symbol in a needed DSO. |
| 38 | // This commonly happens with C++ vaguely-linked entities, such as template |
| 39 | // functions or type_info variables. Hence, a version script is needed even for |
| 40 | // an executable. |
| 41 | version_script: "version-script.txt", |
Colin Cross | 45c0d71 | 2019-03-28 22:31:35 -0700 | [diff] [blame] | 42 | |
| 43 | shared_libs: [ |
| 44 | "libandroid_runtime", |
| 45 | "libbinder", |
| 46 | "libcutils", |
| 47 | "libdl", |
Steven Moreland | ef6a7da | 2019-06-17 15:23:41 -0700 | [diff] [blame] | 48 | "libhidlbase", |
Colin Cross | 45c0d71 | 2019-03-28 22:31:35 -0700 | [diff] [blame] | 49 | "liblog", |
| 50 | "libnativeloader", |
Nicolas Geoffray | 26949ec | 2021-03-05 09:48:48 +0000 | [diff] [blame] | 51 | |
| 52 | // Even though app_process doesn't call into libsigchain, we need to |
| 53 | // make sure it's in the DT list of app_process, as we want all code |
| 54 | // in app_process and the libraries it loads to find libsigchain |
| 55 | // symbols before libc symbols. |
| 56 | "libsigchain", |
| 57 | |
Colin Cross | 45c0d71 | 2019-03-28 22:31:35 -0700 | [diff] [blame] | 58 | "libutils", |
| 59 | |
| 60 | // This is a list of libraries that need to be included in order to avoid |
| 61 | // bad apps. This prevents a library from having a mismatch when resolving |
| 62 | // new/delete from an app shared library. |
| 63 | // See b/21032018 for more details. |
| 64 | "libwilhelm", |
| 65 | ], |
| 66 | |
Colin Cross | 45c0d71 | 2019-03-28 22:31:35 -0700 | [diff] [blame] | 67 | compile_multilib: "both", |
| 68 | |
| 69 | cflags: [ |
| 70 | "-Wall", |
| 71 | "-Werror", |
| 72 | "-Wunused", |
| 73 | "-Wunreachable-code", |
| 74 | ], |
| 75 | |
| 76 | // If SANITIZE_LITE is revived this will need: |
| 77 | //product_variables: { |
| 78 | // sanitize_lite: { |
| 79 | // // In SANITIZE_LITE mode, we create the sanitized binary in a separate location (but reuse |
| 80 | // // the same module). Using the same module also works around an issue with make: binaries |
| 81 | // // that depend on sanitized libraries will be relinked, even if they set LOCAL_SANITIZE := never. |
| 82 | // // |
| 83 | // // Also pull in the asanwrapper helper. |
| 84 | // relative_install_path: "asan", |
| 85 | // required: ["asanwrapper"], |
| 86 | // }, |
| 87 | //}, |
| 88 | |
| 89 | // Create a symlink from app_process to app_process32 or 64 |
| 90 | // depending on the target configuration. |
| 91 | symlink_preferred_arch: true, |
Mitch Phillips | 17de889 | 2021-01-13 14:37:08 -0800 | [diff] [blame] | 92 | |
| 93 | // Enable ASYNC MTE in the zygote, in order to allow apps and the system |
| 94 | // server to use MTE. We use ASYNC because we don't expect the pre-fork |
| 95 | // zygote to have substantial memory corruption bugs (as it's primarily Java |
| 96 | // code), and we don't want to waste memory recording malloc/free stack |
| 97 | // traces (which happens in SYNC mode). |
| 98 | sanitize: { |
| 99 | memtag_heap: true, |
| 100 | }, |
Colin Cross | 45c0d71 | 2019-03-28 22:31:35 -0700 | [diff] [blame] | 101 | } |