Mike Lockwood | e0e9e94 | 2012-10-24 11:52:57 -0700 | [diff] [blame] | 1 | LOCAL_PATH:= $(call my-dir) |
Colin Cross | 2764fce | 2014-03-19 17:47:39 -0700 | [diff] [blame] | 2 | |
Andreas Gampe | 622f511 | 2016-11-29 19:28:13 -0800 | [diff] [blame] | 3 | app_process_common_shared_libs := \ |
| 4 | libandroid_runtime \ |
| 5 | libbinder \ |
| 6 | libcutils \ |
| 7 | libdl \ |
Martijn Coenen | b69ffdb | 2017-04-19 16:40:49 -0700 | [diff] [blame] | 8 | libhwbinder \ |
Andreas Gampe | 622f511 | 2016-11-29 19:28:13 -0800 | [diff] [blame] | 9 | liblog \ |
| 10 | libnativeloader \ |
| 11 | libutils \ |
| 12 | |
Christopher Ferris | ad81791 | 2015-06-17 15:03:20 -0700 | [diff] [blame] | 13 | # This is a list of libraries that need to be included in order to avoid |
| 14 | # bad apps. This prevents a library from having a mismatch when resolving |
| 15 | # new/delete from an app shared library. |
| 16 | # See b/21032018 for more details. |
Andreas Gampe | 622f511 | 2016-11-29 19:28:13 -0800 | [diff] [blame] | 17 | app_process_common_shared_libs += \ |
Christopher Ferris | ad81791 | 2015-06-17 15:03:20 -0700 | [diff] [blame] | 18 | libwilhelm \ |
| 19 | |
Andreas Gampe | 622f511 | 2016-11-29 19:28:13 -0800 | [diff] [blame] | 20 | app_process_common_static_libs := \ |
| 21 | libsigchain \ |
| 22 | |
| 23 | app_process_src_files := \ |
| 24 | app_main.cpp \ |
| 25 | |
| 26 | app_process_cflags := \ |
| 27 | -Wall -Werror -Wunused -Wunreachable-code |
| 28 | |
| 29 | app_process_ldflags_32 := \ |
| 30 | -Wl,--version-script,art/sigchainlib/version-script32.txt -Wl,--export-dynamic |
| 31 | app_process_ldflags_64 := \ |
| 32 | -Wl,--version-script,art/sigchainlib/version-script64.txt -Wl,--export-dynamic |
| 33 | |
Mike Lockwood | e0e9e94 | 2012-10-24 11:52:57 -0700 | [diff] [blame] | 34 | include $(CLEAR_VARS) |
| 35 | |
Andreas Gampe | 622f511 | 2016-11-29 19:28:13 -0800 | [diff] [blame] | 36 | LOCAL_SRC_FILES:= $(app_process_src_files) |
Dmitriy Ivanov | 96e0cfa | 2014-10-07 13:34:42 -0700 | [diff] [blame] | 37 | |
Andreas Gampe | 622f511 | 2016-11-29 19:28:13 -0800 | [diff] [blame] | 38 | LOCAL_LDFLAGS_32 := $(app_process_ldflags_32) |
| 39 | LOCAL_LDFLAGS_64 := $(app_process_ldflags_64) |
Mike Lockwood | e0e9e94 | 2012-10-24 11:52:57 -0700 | [diff] [blame] | 40 | |
Andreas Gampe | 622f511 | 2016-11-29 19:28:13 -0800 | [diff] [blame] | 41 | LOCAL_SHARED_LIBRARIES := $(app_process_common_shared_libs) |
Mike Lockwood | e0e9e94 | 2012-10-24 11:52:57 -0700 | [diff] [blame] | 42 | |
Andreas Gampe | 622f511 | 2016-11-29 19:28:13 -0800 | [diff] [blame] | 43 | LOCAL_WHOLE_STATIC_LIBRARIES := $(app_process_common_static_libs) |
Dmitriy Ivanov | 5ba317c | 2014-10-20 14:14:39 -0700 | [diff] [blame] | 44 | |
Mike Lockwood | e0e9e94 | 2012-10-24 11:52:57 -0700 | [diff] [blame] | 45 | LOCAL_MODULE:= app_process |
Colin Cross | f130f0a | 2014-03-27 10:20:29 -0700 | [diff] [blame] | 46 | LOCAL_MULTILIB := both |
Yongqin Liu | 559484e | 2014-05-06 23:30:40 +0800 | [diff] [blame] | 47 | LOCAL_MODULE_STEM_32 := app_process32 |
Colin Cross | f130f0a | 2014-03-27 10:20:29 -0700 | [diff] [blame] | 48 | LOCAL_MODULE_STEM_64 := app_process64 |
Andreas Gampe | cfedceb | 2014-09-30 21:48:18 -0700 | [diff] [blame] | 49 | |
Andreas Gampe | 622f511 | 2016-11-29 19:28:13 -0800 | [diff] [blame] | 50 | LOCAL_CFLAGS += $(app_process_cflags) |
| 51 | |
Andreas Gampe | 2200e09 | 2016-11-30 16:35:32 -0800 | [diff] [blame] | 52 | # In SANITIZE_LITE mode, we create the sanitized binary in a separate location (but reuse |
| 53 | # the same module). Using the same module also works around an issue with make: binaries |
| 54 | # that depend on sanitized libraries will be relinked, even if they set LOCAL_SANITIZE := never. |
| 55 | # |
| 56 | # Also pull in the asanwrapper helper. |
Andreas Gampe | 622f511 | 2016-11-29 19:28:13 -0800 | [diff] [blame] | 57 | ifeq ($(SANITIZE_LITE),true) |
Andreas Gampe | 2200e09 | 2016-11-30 16:35:32 -0800 | [diff] [blame] | 58 | LOCAL_MODULE_PATH := $(TARGET_OUT_EXECUTABLES)/asan |
| 59 | LOCAL_REQUIRED_MODULES := asanwrapper |
Andreas Gampe | 622f511 | 2016-11-29 19:28:13 -0800 | [diff] [blame] | 60 | endif |
Andreas Gampe | cfedceb | 2014-09-30 21:48:18 -0700 | [diff] [blame] | 61 | |
Mike Lockwood | e0e9e94 | 2012-10-24 11:52:57 -0700 | [diff] [blame] | 62 | include $(BUILD_EXECUTABLE) |
| 63 | |
Yongqin Liu | 559484e | 2014-05-06 23:30:40 +0800 | [diff] [blame] | 64 | # Create a symlink from app_process to app_process32 or 64 |
| 65 | # depending on the target configuration. |
Andreas Gampe | 2200e09 | 2016-11-30 16:35:32 -0800 | [diff] [blame] | 66 | ifneq ($(SANITIZE_LITE),true) |
Yongqin Liu | 559484e | 2014-05-06 23:30:40 +0800 | [diff] [blame] | 67 | include $(BUILD_SYSTEM)/executable_prefer_symlink.mk |
Andreas Gampe | 2200e09 | 2016-11-30 16:35:32 -0800 | [diff] [blame] | 68 | endif |