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