Dmitriy Ivanov | 1f5e1a3 | 2014-06-02 16:29:00 -0700 | [diff] [blame] | 1 | # |
| 2 | # Copyright (C) 2012 The Android Open Source Project |
| 3 | # |
| 4 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | # you may not use this file except in compliance with the License. |
| 6 | # You may obtain a copy of the License at |
| 7 | # |
| 8 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | # |
| 10 | # Unless required by applicable law or agreed to in writing, software |
| 11 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | # See the License for the specific language governing permissions and |
| 14 | # limitations under the License. |
| 15 | # |
| 16 | |
| 17 | LOCAL_PATH := $(call my-dir) |
| 18 | TEST_PATH := $(LOCAL_PATH)/.. |
| 19 | |
| 20 | # ----------------------------------------------------------------------------- |
| 21 | # Library used by dlfcn tests. |
| 22 | # ----------------------------------------------------------------------------- |
| 23 | ifneq ($(TARGET_ARCH),$(filter $(TARGET_ARCH),mips mips64)) |
| 24 | no-elf-hash-table-library_src_files := \ |
| 25 | empty.cpp \ |
| 26 | |
| 27 | no-elf-hash-table-library_ldflags := \ |
| 28 | -Wl,--hash-style=gnu \ |
| 29 | |
| 30 | module := no-elf-hash-table-library |
| 31 | module_tag := optional |
| 32 | build_type := target |
| 33 | build_target := SHARED_LIBRARY |
| 34 | include $(TEST_PATH)/Android.build.mk |
| 35 | endif |
| 36 | |
| 37 | # ----------------------------------------------------------------------------- |
| 38 | # Library used by dlext tests - with GNU RELRO program header |
| 39 | # ----------------------------------------------------------------------------- |
| 40 | libdlext_test_src_files := \ |
| 41 | dlext_test_library.cpp \ |
| 42 | |
| 43 | libdlext_test_ldflags := \ |
| 44 | -Wl,-z,relro \ |
| 45 | |
| 46 | module := libdlext_test |
| 47 | module_tag := optional |
| 48 | build_type := target |
| 49 | build_target := SHARED_LIBRARY |
| 50 | include $(TEST_PATH)/Android.build.mk |
| 51 | |
| 52 | # ----------------------------------------------------------------------------- |
| 53 | # create symlink to libdlext_test.so for symlink test |
| 54 | # ----------------------------------------------------------------------------- |
| 55 | # Use = instead of := to defer the evaluation of $@ |
| 56 | $(LOCAL_INSTALLED_MODULE): PRIVATE_POST_INSTALL_CMD = \ |
| 57 | $(hide) cd $(dir $@) && ln -sf $(notdir $@) libdlext_test_v2.so |
| 58 | |
| 59 | ifneq ($(TARGET_2ND_ARCH),) |
| 60 | # link 64 bit .so |
| 61 | $(TARGET_OUT)/lib64/libdlext_test.so: PRIVATE_POST_INSTALL_CMD = \ |
| 62 | $(hide) cd $(dir $@) && ln -sf $(notdir $@) libdlext_test_v2.so |
| 63 | endif |
| 64 | |
| 65 | # ----------------------------------------------------------------------------- |
| 66 | # Library used by dlext tests - without GNU RELRO program header |
| 67 | # ----------------------------------------------------------------------------- |
| 68 | libdlext_test_norelro_src_files := \ |
| 69 | dlext_test_library.cpp \ |
| 70 | |
| 71 | libdlext_test_norelro_ldflags := \ |
| 72 | -Wl,-z,norelro \ |
| 73 | |
| 74 | module := libdlext_test_norelro |
| 75 | module_tag := optional |
| 76 | build_type := target |
| 77 | build_target := SHARED_LIBRARY |
| 78 | include $(TEST_PATH)/Android.build.mk |
| 79 | |
| 80 | # ----------------------------------------------------------------------------- |
Dmitriy Ivanov | 04dc91a | 2014-07-01 14:10:16 -0700 | [diff] [blame] | 81 | # Library used by dlext tests - different name non-default location |
| 82 | # ----------------------------------------------------------------------------- |
| 83 | libdlext_test_fd_src_files := \ |
| 84 | dlext_test_library.cpp \ |
| 85 | |
| 86 | libdlext_test_fd_install_to_out_data := true |
| 87 | module := libdlext_test_fd |
| 88 | module_tag := optional |
| 89 | build_type := target |
| 90 | build_target := SHARED_LIBRARY |
| 91 | include $(TEST_PATH)/Android.build.mk |
| 92 | |
| 93 | # ----------------------------------------------------------------------------- |
Dmitriy Ivanov | 1f5e1a3 | 2014-06-02 16:29:00 -0700 | [diff] [blame] | 94 | # Library used by dlfcn tests |
| 95 | # ----------------------------------------------------------------------------- |
| 96 | libtest_simple_src_files := \ |
| 97 | dlopen_testlib_simple.cpp |
| 98 | |
| 99 | module := libtest_simple |
| 100 | build_type := target |
| 101 | build_target := SHARED_LIBRARY |
| 102 | include $(TEST_PATH)/Android.build.mk |
| 103 | |
Dmitriy Ivanov | d97e9f5 | 2014-06-29 12:28:37 -0700 | [diff] [blame] | 104 | # ----------------------------------------------------------------------------- |
Dmitriy Ivanov | ae69a95 | 2014-09-05 16:42:53 -0700 | [diff] [blame] | 105 | # Libraries used by dlfcn tests to verify correct load order: |
| 106 | # libtest_check_order_2_right.so |
| 107 | # ----------------------------------------------------------------------------- |
| 108 | libtest_check_order_2_right_src_files := \ |
| 109 | dlopen_testlib_answer.cpp |
| 110 | |
| 111 | libtest_check_order_2_right_cflags := -D__ANSWER=42 |
| 112 | module := libtest_check_order_2_right |
| 113 | build_type := target |
| 114 | build_target := SHARED_LIBRARY |
| 115 | include $(TEST_PATH)/Android.build.mk |
| 116 | |
| 117 | # ----------------------------------------------------------------------------- |
| 118 | # libtest_check_order_a.so |
| 119 | # ----------------------------------------------------------------------------- |
| 120 | libtest_check_order_a_src_files := \ |
| 121 | dlopen_testlib_answer.cpp |
| 122 | |
| 123 | libtest_check_order_a_cflags := -D__ANSWER=1 |
| 124 | module := libtest_check_order_a |
| 125 | build_type := target |
| 126 | build_target := SHARED_LIBRARY |
| 127 | include $(TEST_PATH)/Android.build.mk |
| 128 | |
| 129 | # ----------------------------------------------------------------------------- |
| 130 | # libtest_check_order_b.so |
| 131 | # ----------------------------------------------------------------------------- |
| 132 | libtest_check_order_b_src_files := \ |
| 133 | dlopen_testlib_answer.cpp |
| 134 | |
| 135 | libtest_check_order_b_cflags := -D__ANSWER=2 -D__ANSWER2=43 |
| 136 | module := libtest_check_order_b |
| 137 | build_type := target |
| 138 | build_target := SHARED_LIBRARY |
| 139 | include $(TEST_PATH)/Android.build.mk |
| 140 | |
| 141 | # ----------------------------------------------------------------------------- |
| 142 | # libtest_check_order_c.so |
| 143 | # ----------------------------------------------------------------------------- |
| 144 | libtest_check_order_3_c_src_files := \ |
| 145 | dlopen_testlib_answer.cpp |
| 146 | |
| 147 | libtest_check_order_3_c_cflags := -D__ANSWER=3 |
| 148 | module := libtest_check_order_3_c |
| 149 | build_type := target |
| 150 | build_target := SHARED_LIBRARY |
| 151 | include $(TEST_PATH)/Android.build.mk |
| 152 | |
| 153 | # ----------------------------------------------------------------------------- |
| 154 | # libtest_check_order_d.so |
| 155 | # ----------------------------------------------------------------------------- |
| 156 | libtest_check_order_d_src_files := \ |
| 157 | dlopen_testlib_answer.cpp |
| 158 | |
| 159 | libtest_check_order_d_shared_libraries := libtest_check_order_b |
| 160 | libtest_check_order_d_cflags := -D__ANSWER=4 -D__ANSWER2=4 |
| 161 | module := libtest_check_order_d |
| 162 | build_type := target |
| 163 | build_target := SHARED_LIBRARY |
| 164 | include $(TEST_PATH)/Android.build.mk |
| 165 | |
| 166 | # ----------------------------------------------------------------------------- |
| 167 | # libtest_check_order_left.so |
| 168 | # ----------------------------------------------------------------------------- |
| 169 | libtest_check_order_1_left_src_files := \ |
| 170 | empty.cpp |
| 171 | |
| 172 | libtest_check_order_1_left_shared_libraries := libtest_check_order_a libtest_check_order_b |
| 173 | |
| 174 | module := libtest_check_order_1_left |
| 175 | build_type := target |
| 176 | build_target := SHARED_LIBRARY |
| 177 | include $(TEST_PATH)/Android.build.mk |
| 178 | |
| 179 | # ----------------------------------------------------------------------------- |
| 180 | # libtest_check_order.so |
| 181 | # ----------------------------------------------------------------------------- |
| 182 | libtest_check_order_src_files := \ |
| 183 | empty.cpp |
| 184 | |
| 185 | libtest_check_order_shared_libraries := libtest_check_order_1_left \ |
| 186 | libtest_check_order_2_right libtest_check_order_3_c |
| 187 | |
| 188 | module := libtest_check_order |
| 189 | build_type := target |
| 190 | build_target := SHARED_LIBRARY |
| 191 | include $(TEST_PATH)/Android.build.mk |
| 192 | |
| 193 | # ----------------------------------------------------------------------------- |
| 194 | # Library with dependency loop used by dlfcn tests |
| 195 | # |
| 196 | # libtest_with_dependency_loop -> a -> b -> c -> a |
| 197 | # ----------------------------------------------------------------------------- |
Dmitriy Ivanov | 7d971ec | 2014-09-09 10:21:42 -0700 | [diff] [blame] | 198 | libtest_with_dependency_loop_src_files := dlopen_testlib_invalid.cpp |
Dmitriy Ivanov | ae69a95 | 2014-09-05 16:42:53 -0700 | [diff] [blame] | 199 | |
| 200 | libtest_with_dependency_loop_shared_libraries := \ |
| 201 | libtest_with_dependency_loop_a |
| 202 | |
| 203 | module := libtest_with_dependency_loop |
| 204 | build_type := target |
| 205 | build_target := SHARED_LIBRARY |
| 206 | include $(TEST_PATH)/Android.build.mk |
| 207 | |
| 208 | # ----------------------------------------------------------------------------- |
| 209 | # libtest_with_dependency_loop_a.so |
| 210 | # ----------------------------------------------------------------------------- |
Dmitriy Ivanov | 7d971ec | 2014-09-09 10:21:42 -0700 | [diff] [blame] | 211 | libtest_with_dependency_loop_a_src_files := dlopen_testlib_invalid.cpp |
Dmitriy Ivanov | ae69a95 | 2014-09-05 16:42:53 -0700 | [diff] [blame] | 212 | |
| 213 | libtest_with_dependency_loop_a_shared_libraries := \ |
| 214 | libtest_with_dependency_loop_b_tmp |
| 215 | |
| 216 | module := libtest_with_dependency_loop_a |
| 217 | build_type := target |
| 218 | build_target := SHARED_LIBRARY |
| 219 | include $(TEST_PATH)/Android.build.mk |
| 220 | |
| 221 | # ----------------------------------------------------------------------------- |
| 222 | # libtest_with_dependency_loop_b.so |
| 223 | # |
| 224 | # this is temporary placeholder - will be removed |
| 225 | # ----------------------------------------------------------------------------- |
Dmitriy Ivanov | 7d971ec | 2014-09-09 10:21:42 -0700 | [diff] [blame] | 226 | libtest_with_dependency_loop_b_tmp_src_files := dlopen_testlib_invalid.cpp |
Dmitriy Ivanov | ae69a95 | 2014-09-05 16:42:53 -0700 | [diff] [blame] | 227 | libtest_with_dependency_loop_b_tmp_ldflags := -Wl,-soname=libtest_with_dependency_loop_b.so |
| 228 | |
| 229 | module := libtest_with_dependency_loop_b_tmp |
| 230 | build_type := target |
| 231 | build_target := SHARED_LIBRARY |
| 232 | include $(TEST_PATH)/Android.build.mk |
| 233 | |
| 234 | # ----------------------------------------------------------------------------- |
| 235 | # libtest_with_dependency_loop_b.so |
| 236 | # ----------------------------------------------------------------------------- |
Dmitriy Ivanov | 7d971ec | 2014-09-09 10:21:42 -0700 | [diff] [blame] | 237 | libtest_with_dependency_loop_b_src_files := dlopen_testlib_invalid.cpp |
Dmitriy Ivanov | ae69a95 | 2014-09-05 16:42:53 -0700 | [diff] [blame] | 238 | libtest_with_dependency_loop_b_shared_libraries := libtest_with_dependency_loop_c |
| 239 | |
| 240 | module := libtest_with_dependency_loop_b |
| 241 | build_type := target |
| 242 | build_target := SHARED_LIBRARY |
| 243 | include $(TEST_PATH)/Android.build.mk |
| 244 | |
| 245 | # ----------------------------------------------------------------------------- |
| 246 | # libtest_with_dependency_loop_c.so |
| 247 | # ----------------------------------------------------------------------------- |
Dmitriy Ivanov | 7d971ec | 2014-09-09 10:21:42 -0700 | [diff] [blame] | 248 | libtest_with_dependency_loop_c_src_files := dlopen_testlib_invalid.cpp |
Dmitriy Ivanov | ae69a95 | 2014-09-05 16:42:53 -0700 | [diff] [blame] | 249 | |
| 250 | libtest_with_dependency_loop_c_shared_libraries := \ |
| 251 | libtest_with_dependency_loop_a |
| 252 | |
| 253 | module := libtest_with_dependency_loop_c |
| 254 | build_type := target |
| 255 | build_target := SHARED_LIBRARY |
| 256 | include $(TEST_PATH)/Android.build.mk |
| 257 | |
| 258 | # ----------------------------------------------------------------------------- |
Dmitriy Ivanov | 8de1dde | 2014-09-04 18:23:00 -0700 | [diff] [blame] | 259 | # libtest_relo_check_dt_needed_order.so |
| 260 | # | |
| 261 | # +-> libtest_relo_check_dt_needed_order_1.so |
| 262 | # | |
| 263 | # +-> libtest_relo_check_dt_needed_order_2.so |
| 264 | # ----------------------------------------------------------------------------- |
| 265 | libtest_relo_check_dt_needed_order_shared_libraries := \ |
| 266 | libtest_relo_check_dt_needed_order_1 libtest_relo_check_dt_needed_order_2 |
| 267 | |
| 268 | libtest_relo_check_dt_needed_order_src_files := dlopen_testlib_relo_check_dt_needed_order.cpp |
| 269 | libtest_relo_check_dt_needed_order_1_src_files := dlopen_testlib_relo_check_dt_needed_order_1.cpp |
| 270 | libtest_relo_check_dt_needed_order_2_src_files := dlopen_testlib_relo_check_dt_needed_order_2.cpp |
| 271 | build_type := target |
| 272 | build_target := SHARED_LIBRARY |
| 273 | |
| 274 | module := libtest_relo_check_dt_needed_order |
| 275 | include $(TEST_PATH)/Android.build.mk |
| 276 | module := libtest_relo_check_dt_needed_order_1 |
| 277 | include $(TEST_PATH)/Android.build.mk |
| 278 | module := libtest_relo_check_dt_needed_order_2 |
| 279 | include $(TEST_PATH)/Android.build.mk |
| 280 | |
| 281 | # ----------------------------------------------------------------------------- |
Dmitriy Ivanov | db7a17d | 2014-08-04 23:39:22 +0000 | [diff] [blame] | 282 | # Library with dependency used by dlfcn tests |
| 283 | # ----------------------------------------------------------------------------- |
| 284 | libtest_with_dependency_src_files := \ |
| 285 | dlopen_testlib_simple.cpp |
| 286 | |
| 287 | libtest_with_dependency_shared_libraries := libdlext_test |
| 288 | |
| 289 | module := libtest_with_dependency |
| 290 | build_type := target |
| 291 | build_target := SHARED_LIBRARY |
| 292 | include $(TEST_PATH)/Android.build.mk |
| 293 | |
| 294 | # ----------------------------------------------------------------------------- |
Brigid Smith | 31b88da | 2014-07-23 11:22:25 -0700 | [diff] [blame] | 295 | # Library used by ifunc tests |
| 296 | # ----------------------------------------------------------------------------- |
Dmitriy Ivanov | 1cd0c67 | 2014-10-01 16:26:49 -0700 | [diff] [blame^] | 297 | ifeq ($(TARGET_ARCH),$(filter $(TARGET_ARCH),x86 x86_64)) |
Brigid Smith | 31b88da | 2014-07-23 11:22:25 -0700 | [diff] [blame] | 298 | libtest_ifunc_src_files := \ |
| 299 | dlopen_testlib_ifunc.c |
| 300 | |
| 301 | LOCAL_SDK_VERSION := current |
| 302 | module := libtest_ifunc |
| 303 | build_type := target |
| 304 | build_target := SHARED_LIBRARY |
Dmitriy Ivanov | f4cb631 | 2014-09-11 15:16:03 -0700 | [diff] [blame] | 305 | |
Brigid Smith | 31b88da | 2014-07-23 11:22:25 -0700 | [diff] [blame] | 306 | include $(TEST_PATH)/Android.build.mk |
| 307 | endif |
| 308 | |
| 309 | # ----------------------------------------------------------------------------- |
Dmitriy Ivanov | 1f5e1a3 | 2014-06-02 16:29:00 -0700 | [diff] [blame] | 310 | # Library used by atexit tests |
| 311 | # ----------------------------------------------------------------------------- |
| 312 | |
| 313 | libtest_atexit_src_files := \ |
| 314 | atexit_testlib.cpp |
| 315 | |
| 316 | module := libtest_atexit |
| 317 | build_target := SHARED_LIBRARY |
| 318 | build_type := target |
| 319 | include $(TEST_PATH)/Android.build.mk |
| 320 | build_type := host |
| 321 | include $(TEST_PATH)/Android.build.mk |
| 322 | |
Dmitriy Ivanov | ce44166 | 2014-06-17 15:56:38 -0700 | [diff] [blame] | 323 | # ----------------------------------------------------------------------------- |
| 324 | # Library with weak function |
| 325 | # ----------------------------------------------------------------------------- |
| 326 | libtest_dlsym_weak_func_src_files := \ |
| 327 | dlsym_weak_function.cpp |
| 328 | |
| 329 | module := libtest_dlsym_weak_func |
| 330 | build_target := SHARED_LIBRARY |
| 331 | build_type := target |
| 332 | include $(TEST_PATH)/Android.build.mk |
| 333 | build_type := host |
| 334 | include $(TEST_PATH)/Android.build.mk |