blob: b3554881e5750f9a3337e7f2bd2917c119e8a71a [file] [log] [blame]
Dmitriy Ivanov1f5e1a32014-06-02 16:29:00 -07001#
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
17LOCAL_PATH := $(call my-dir)
18TEST_PATH := $(LOCAL_PATH)/..
19
20# -----------------------------------------------------------------------------
21# Library used by dlfcn tests.
22# -----------------------------------------------------------------------------
23ifneq ($(TARGET_ARCH),$(filter $(TARGET_ARCH),mips mips64))
24no-elf-hash-table-library_src_files := \
25 empty.cpp \
26
27no-elf-hash-table-library_ldflags := \
28 -Wl,--hash-style=gnu \
29
30module := no-elf-hash-table-library
31module_tag := optional
32build_type := target
33build_target := SHARED_LIBRARY
34include $(TEST_PATH)/Android.build.mk
35endif
36
37# -----------------------------------------------------------------------------
38# Library used by dlext tests - with GNU RELRO program header
39# -----------------------------------------------------------------------------
40libdlext_test_src_files := \
41 dlext_test_library.cpp \
42
43libdlext_test_ldflags := \
44 -Wl,-z,relro \
45
46module := libdlext_test
47module_tag := optional
48build_type := target
49build_target := SHARED_LIBRARY
50include $(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
59ifneq ($(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
63endif
64
65# -----------------------------------------------------------------------------
66# Library used by dlext tests - without GNU RELRO program header
67# -----------------------------------------------------------------------------
68libdlext_test_norelro_src_files := \
69 dlext_test_library.cpp \
70
71libdlext_test_norelro_ldflags := \
72 -Wl,-z,norelro \
73
74module := libdlext_test_norelro
75module_tag := optional
76build_type := target
77build_target := SHARED_LIBRARY
78include $(TEST_PATH)/Android.build.mk
79
80# -----------------------------------------------------------------------------
Dmitriy Ivanov04dc91a2014-07-01 14:10:16 -070081# Library used by dlext tests - different name non-default location
82# -----------------------------------------------------------------------------
83libdlext_test_fd_src_files := \
84 dlext_test_library.cpp \
85
86libdlext_test_fd_install_to_out_data := true
87module := libdlext_test_fd
88module_tag := optional
89build_type := target
90build_target := SHARED_LIBRARY
91include $(TEST_PATH)/Android.build.mk
92
93# -----------------------------------------------------------------------------
Dmitriy Ivanov1f5e1a32014-06-02 16:29:00 -070094# Library used by dlfcn tests
95# -----------------------------------------------------------------------------
96libtest_simple_src_files := \
97 dlopen_testlib_simple.cpp
98
99module := libtest_simple
100build_type := target
101build_target := SHARED_LIBRARY
102include $(TEST_PATH)/Android.build.mk
103
Dmitriy Ivanovd97e9f52014-06-29 12:28:37 -0700104# -----------------------------------------------------------------------------
Dmitriy Ivanovae69a952014-09-05 16:42:53 -0700105# Libraries used by dlfcn tests to verify correct load order:
106# libtest_check_order_2_right.so
107# -----------------------------------------------------------------------------
108libtest_check_order_2_right_src_files := \
109 dlopen_testlib_answer.cpp
110
111libtest_check_order_2_right_cflags := -D__ANSWER=42
112module := libtest_check_order_2_right
113build_type := target
114build_target := SHARED_LIBRARY
115include $(TEST_PATH)/Android.build.mk
116
117# -----------------------------------------------------------------------------
118# libtest_check_order_a.so
119# -----------------------------------------------------------------------------
120libtest_check_order_a_src_files := \
121 dlopen_testlib_answer.cpp
122
123libtest_check_order_a_cflags := -D__ANSWER=1
124module := libtest_check_order_a
125build_type := target
126build_target := SHARED_LIBRARY
127include $(TEST_PATH)/Android.build.mk
128
129# -----------------------------------------------------------------------------
130# libtest_check_order_b.so
131# -----------------------------------------------------------------------------
132libtest_check_order_b_src_files := \
133 dlopen_testlib_answer.cpp
134
135libtest_check_order_b_cflags := -D__ANSWER=2 -D__ANSWER2=43
136module := libtest_check_order_b
137build_type := target
138build_target := SHARED_LIBRARY
139include $(TEST_PATH)/Android.build.mk
140
141# -----------------------------------------------------------------------------
142# libtest_check_order_c.so
143# -----------------------------------------------------------------------------
144libtest_check_order_3_c_src_files := \
145 dlopen_testlib_answer.cpp
146
147libtest_check_order_3_c_cflags := -D__ANSWER=3
148module := libtest_check_order_3_c
149build_type := target
150build_target := SHARED_LIBRARY
151include $(TEST_PATH)/Android.build.mk
152
153# -----------------------------------------------------------------------------
154# libtest_check_order_d.so
155# -----------------------------------------------------------------------------
156libtest_check_order_d_src_files := \
157 dlopen_testlib_answer.cpp
158
159libtest_check_order_d_shared_libraries := libtest_check_order_b
160libtest_check_order_d_cflags := -D__ANSWER=4 -D__ANSWER2=4
161module := libtest_check_order_d
162build_type := target
163build_target := SHARED_LIBRARY
164include $(TEST_PATH)/Android.build.mk
165
166# -----------------------------------------------------------------------------
167# libtest_check_order_left.so
168# -----------------------------------------------------------------------------
169libtest_check_order_1_left_src_files := \
170 empty.cpp
171
172libtest_check_order_1_left_shared_libraries := libtest_check_order_a libtest_check_order_b
173
174module := libtest_check_order_1_left
175build_type := target
176build_target := SHARED_LIBRARY
177include $(TEST_PATH)/Android.build.mk
178
179# -----------------------------------------------------------------------------
180# libtest_check_order.so
181# -----------------------------------------------------------------------------
182libtest_check_order_src_files := \
183 empty.cpp
184
185libtest_check_order_shared_libraries := libtest_check_order_1_left \
186 libtest_check_order_2_right libtest_check_order_3_c
187
188module := libtest_check_order
189build_type := target
190build_target := SHARED_LIBRARY
191include $(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 Ivanov7d971ec2014-09-09 10:21:42 -0700198libtest_with_dependency_loop_src_files := dlopen_testlib_invalid.cpp
Dmitriy Ivanovae69a952014-09-05 16:42:53 -0700199
200libtest_with_dependency_loop_shared_libraries := \
201 libtest_with_dependency_loop_a
202
203module := libtest_with_dependency_loop
204build_type := target
205build_target := SHARED_LIBRARY
206include $(TEST_PATH)/Android.build.mk
207
208# -----------------------------------------------------------------------------
209# libtest_with_dependency_loop_a.so
210# -----------------------------------------------------------------------------
Dmitriy Ivanov7d971ec2014-09-09 10:21:42 -0700211libtest_with_dependency_loop_a_src_files := dlopen_testlib_invalid.cpp
Dmitriy Ivanovae69a952014-09-05 16:42:53 -0700212
213libtest_with_dependency_loop_a_shared_libraries := \
214 libtest_with_dependency_loop_b_tmp
215
216module := libtest_with_dependency_loop_a
217build_type := target
218build_target := SHARED_LIBRARY
219include $(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 Ivanov7d971ec2014-09-09 10:21:42 -0700226libtest_with_dependency_loop_b_tmp_src_files := dlopen_testlib_invalid.cpp
Dmitriy Ivanovae69a952014-09-05 16:42:53 -0700227libtest_with_dependency_loop_b_tmp_ldflags := -Wl,-soname=libtest_with_dependency_loop_b.so
228
229module := libtest_with_dependency_loop_b_tmp
230build_type := target
231build_target := SHARED_LIBRARY
232include $(TEST_PATH)/Android.build.mk
233
234# -----------------------------------------------------------------------------
235# libtest_with_dependency_loop_b.so
236# -----------------------------------------------------------------------------
Dmitriy Ivanov7d971ec2014-09-09 10:21:42 -0700237libtest_with_dependency_loop_b_src_files := dlopen_testlib_invalid.cpp
Dmitriy Ivanovae69a952014-09-05 16:42:53 -0700238libtest_with_dependency_loop_b_shared_libraries := libtest_with_dependency_loop_c
239
240module := libtest_with_dependency_loop_b
241build_type := target
242build_target := SHARED_LIBRARY
243include $(TEST_PATH)/Android.build.mk
244
245# -----------------------------------------------------------------------------
246# libtest_with_dependency_loop_c.so
247# -----------------------------------------------------------------------------
Dmitriy Ivanov7d971ec2014-09-09 10:21:42 -0700248libtest_with_dependency_loop_c_src_files := dlopen_testlib_invalid.cpp
Dmitriy Ivanovae69a952014-09-05 16:42:53 -0700249
250libtest_with_dependency_loop_c_shared_libraries := \
251 libtest_with_dependency_loop_a
252
253module := libtest_with_dependency_loop_c
254build_type := target
255build_target := SHARED_LIBRARY
256include $(TEST_PATH)/Android.build.mk
257
258# -----------------------------------------------------------------------------
Dmitriy Ivanov8de1dde2014-09-04 18:23:00 -0700259# 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# -----------------------------------------------------------------------------
265libtest_relo_check_dt_needed_order_shared_libraries := \
266 libtest_relo_check_dt_needed_order_1 libtest_relo_check_dt_needed_order_2
267
268libtest_relo_check_dt_needed_order_src_files := dlopen_testlib_relo_check_dt_needed_order.cpp
269libtest_relo_check_dt_needed_order_1_src_files := dlopen_testlib_relo_check_dt_needed_order_1.cpp
270libtest_relo_check_dt_needed_order_2_src_files := dlopen_testlib_relo_check_dt_needed_order_2.cpp
271build_type := target
272build_target := SHARED_LIBRARY
273
274module := libtest_relo_check_dt_needed_order
275include $(TEST_PATH)/Android.build.mk
276module := libtest_relo_check_dt_needed_order_1
277include $(TEST_PATH)/Android.build.mk
278module := libtest_relo_check_dt_needed_order_2
279include $(TEST_PATH)/Android.build.mk
280
281# -----------------------------------------------------------------------------
Dmitriy Ivanovdb7a17d2014-08-04 23:39:22 +0000282# Library with dependency used by dlfcn tests
283# -----------------------------------------------------------------------------
284libtest_with_dependency_src_files := \
285 dlopen_testlib_simple.cpp
286
287libtest_with_dependency_shared_libraries := libdlext_test
288
289module := libtest_with_dependency
290build_type := target
291build_target := SHARED_LIBRARY
292include $(TEST_PATH)/Android.build.mk
293
294# -----------------------------------------------------------------------------
Brigid Smith31b88da2014-07-23 11:22:25 -0700295# Library used by ifunc tests
296# -----------------------------------------------------------------------------
Dmitriy Ivanov1cd0c672014-10-01 16:26:49 -0700297ifeq ($(TARGET_ARCH),$(filter $(TARGET_ARCH),x86 x86_64))
Brigid Smith31b88da2014-07-23 11:22:25 -0700298 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 Ivanovf4cb6312014-09-11 15:16:03 -0700305
Brigid Smith31b88da2014-07-23 11:22:25 -0700306 include $(TEST_PATH)/Android.build.mk
307endif
308
309# -----------------------------------------------------------------------------
Dmitriy Ivanov1f5e1a32014-06-02 16:29:00 -0700310# Library used by atexit tests
311# -----------------------------------------------------------------------------
312
313libtest_atexit_src_files := \
314 atexit_testlib.cpp
315
316module := libtest_atexit
317build_target := SHARED_LIBRARY
318build_type := target
319include $(TEST_PATH)/Android.build.mk
320build_type := host
321include $(TEST_PATH)/Android.build.mk
322
Dmitriy Ivanovce441662014-06-17 15:56:38 -0700323# -----------------------------------------------------------------------------
324# Library with weak function
325# -----------------------------------------------------------------------------
326libtest_dlsym_weak_func_src_files := \
327 dlsym_weak_function.cpp
328
329module := libtest_dlsym_weak_func
330build_target := SHARED_LIBRARY
331build_type := target
332include $(TEST_PATH)/Android.build.mk
333build_type := host
334include $(TEST_PATH)/Android.build.mk