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