blob: ee97c618ad6c128c2b9a22751e60a4263e619fd6 [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 Ivanovde017802014-10-03 17:52:44 -070094# Library used by dlext tests - zipped and aligned
95# -----------------------------------------------------------------------------
96include $(CLEAR_VARS)
97bionic_2nd_arch_prefix :=
98include $(LOCAL_PATH)/Android.build.dlext_testzip.mk
99ifneq ($(TARGET_2ND_ARCH),)
100 bionic_2nd_arch_prefix := $(TARGET_2ND_ARCH_VAR_PREFIX)
101 include $(LOCAL_PATH)/Android.build.dlext_testzip.mk
102endif
103
104# -----------------------------------------------------------------------------
Dmitriy Ivanov1f5e1a32014-06-02 16:29:00 -0700105# Library used by dlfcn tests
106# -----------------------------------------------------------------------------
107libtest_simple_src_files := \
108 dlopen_testlib_simple.cpp
109
110module := libtest_simple
111build_type := target
112build_target := SHARED_LIBRARY
113include $(TEST_PATH)/Android.build.mk
114
Dmitriy Ivanovd97e9f52014-06-29 12:28:37 -0700115# -----------------------------------------------------------------------------
Dmitriy Ivanovae69a952014-09-05 16:42:53 -0700116# Libraries used by dlfcn tests to verify correct load order:
117# libtest_check_order_2_right.so
118# -----------------------------------------------------------------------------
119libtest_check_order_2_right_src_files := \
120 dlopen_testlib_answer.cpp
121
122libtest_check_order_2_right_cflags := -D__ANSWER=42
123module := libtest_check_order_2_right
124build_type := target
125build_target := SHARED_LIBRARY
126include $(TEST_PATH)/Android.build.mk
127
128# -----------------------------------------------------------------------------
129# libtest_check_order_a.so
130# -----------------------------------------------------------------------------
131libtest_check_order_a_src_files := \
132 dlopen_testlib_answer.cpp
133
134libtest_check_order_a_cflags := -D__ANSWER=1
135module := libtest_check_order_a
136build_type := target
137build_target := SHARED_LIBRARY
138include $(TEST_PATH)/Android.build.mk
139
140# -----------------------------------------------------------------------------
141# libtest_check_order_b.so
142# -----------------------------------------------------------------------------
143libtest_check_order_b_src_files := \
144 dlopen_testlib_answer.cpp
145
146libtest_check_order_b_cflags := -D__ANSWER=2 -D__ANSWER2=43
147module := libtest_check_order_b
148build_type := target
149build_target := SHARED_LIBRARY
150include $(TEST_PATH)/Android.build.mk
151
152# -----------------------------------------------------------------------------
153# libtest_check_order_c.so
154# -----------------------------------------------------------------------------
155libtest_check_order_3_c_src_files := \
156 dlopen_testlib_answer.cpp
157
158libtest_check_order_3_c_cflags := -D__ANSWER=3
159module := libtest_check_order_3_c
160build_type := target
161build_target := SHARED_LIBRARY
162include $(TEST_PATH)/Android.build.mk
163
164# -----------------------------------------------------------------------------
165# libtest_check_order_d.so
166# -----------------------------------------------------------------------------
167libtest_check_order_d_src_files := \
168 dlopen_testlib_answer.cpp
169
170libtest_check_order_d_shared_libraries := libtest_check_order_b
171libtest_check_order_d_cflags := -D__ANSWER=4 -D__ANSWER2=4
172module := libtest_check_order_d
173build_type := target
174build_target := SHARED_LIBRARY
175include $(TEST_PATH)/Android.build.mk
176
177# -----------------------------------------------------------------------------
178# libtest_check_order_left.so
179# -----------------------------------------------------------------------------
180libtest_check_order_1_left_src_files := \
181 empty.cpp
182
183libtest_check_order_1_left_shared_libraries := libtest_check_order_a libtest_check_order_b
184
185module := libtest_check_order_1_left
186build_type := target
187build_target := SHARED_LIBRARY
188include $(TEST_PATH)/Android.build.mk
189
190# -----------------------------------------------------------------------------
191# libtest_check_order.so
192# -----------------------------------------------------------------------------
193libtest_check_order_src_files := \
194 empty.cpp
195
196libtest_check_order_shared_libraries := libtest_check_order_1_left \
197 libtest_check_order_2_right libtest_check_order_3_c
198
199module := libtest_check_order
200build_type := target
201build_target := SHARED_LIBRARY
202include $(TEST_PATH)/Android.build.mk
203
204# -----------------------------------------------------------------------------
205# Library with dependency loop used by dlfcn tests
206#
207# libtest_with_dependency_loop -> a -> b -> c -> a
208# -----------------------------------------------------------------------------
Dmitriy Ivanov7d971ec2014-09-09 10:21:42 -0700209libtest_with_dependency_loop_src_files := dlopen_testlib_invalid.cpp
Dmitriy Ivanovae69a952014-09-05 16:42:53 -0700210
211libtest_with_dependency_loop_shared_libraries := \
212 libtest_with_dependency_loop_a
213
214module := libtest_with_dependency_loop
215build_type := target
216build_target := SHARED_LIBRARY
217include $(TEST_PATH)/Android.build.mk
218
219# -----------------------------------------------------------------------------
220# libtest_with_dependency_loop_a.so
221# -----------------------------------------------------------------------------
Dmitriy Ivanov7d971ec2014-09-09 10:21:42 -0700222libtest_with_dependency_loop_a_src_files := dlopen_testlib_invalid.cpp
Dmitriy Ivanovae69a952014-09-05 16:42:53 -0700223
224libtest_with_dependency_loop_a_shared_libraries := \
225 libtest_with_dependency_loop_b_tmp
226
227module := libtest_with_dependency_loop_a
228build_type := target
229build_target := SHARED_LIBRARY
230include $(TEST_PATH)/Android.build.mk
231
232# -----------------------------------------------------------------------------
233# libtest_with_dependency_loop_b.so
234#
235# this is temporary placeholder - will be removed
236# -----------------------------------------------------------------------------
Dmitriy Ivanov7d971ec2014-09-09 10:21:42 -0700237libtest_with_dependency_loop_b_tmp_src_files := dlopen_testlib_invalid.cpp
Dmitriy Ivanovae69a952014-09-05 16:42:53 -0700238libtest_with_dependency_loop_b_tmp_ldflags := -Wl,-soname=libtest_with_dependency_loop_b.so
239
240module := libtest_with_dependency_loop_b_tmp
241build_type := target
242build_target := SHARED_LIBRARY
243include $(TEST_PATH)/Android.build.mk
244
245# -----------------------------------------------------------------------------
246# libtest_with_dependency_loop_b.so
247# -----------------------------------------------------------------------------
Dmitriy Ivanov7d971ec2014-09-09 10:21:42 -0700248libtest_with_dependency_loop_b_src_files := dlopen_testlib_invalid.cpp
Dmitriy Ivanovae69a952014-09-05 16:42:53 -0700249libtest_with_dependency_loop_b_shared_libraries := libtest_with_dependency_loop_c
250
251module := libtest_with_dependency_loop_b
252build_type := target
253build_target := SHARED_LIBRARY
254include $(TEST_PATH)/Android.build.mk
255
256# -----------------------------------------------------------------------------
257# libtest_with_dependency_loop_c.so
258# -----------------------------------------------------------------------------
Dmitriy Ivanov7d971ec2014-09-09 10:21:42 -0700259libtest_with_dependency_loop_c_src_files := dlopen_testlib_invalid.cpp
Dmitriy Ivanovae69a952014-09-05 16:42:53 -0700260
261libtest_with_dependency_loop_c_shared_libraries := \
262 libtest_with_dependency_loop_a
263
264module := libtest_with_dependency_loop_c
265build_type := target
266build_target := SHARED_LIBRARY
267include $(TEST_PATH)/Android.build.mk
268
269# -----------------------------------------------------------------------------
Dmitriy Ivanov8de1dde2014-09-04 18:23:00 -0700270# libtest_relo_check_dt_needed_order.so
271# |
272# +-> libtest_relo_check_dt_needed_order_1.so
273# |
274# +-> libtest_relo_check_dt_needed_order_2.so
275# -----------------------------------------------------------------------------
276libtest_relo_check_dt_needed_order_shared_libraries := \
277 libtest_relo_check_dt_needed_order_1 libtest_relo_check_dt_needed_order_2
278
279libtest_relo_check_dt_needed_order_src_files := dlopen_testlib_relo_check_dt_needed_order.cpp
280libtest_relo_check_dt_needed_order_1_src_files := dlopen_testlib_relo_check_dt_needed_order_1.cpp
281libtest_relo_check_dt_needed_order_2_src_files := dlopen_testlib_relo_check_dt_needed_order_2.cpp
282build_type := target
283build_target := SHARED_LIBRARY
284
285module := libtest_relo_check_dt_needed_order
286include $(TEST_PATH)/Android.build.mk
287module := libtest_relo_check_dt_needed_order_1
288include $(TEST_PATH)/Android.build.mk
289module := libtest_relo_check_dt_needed_order_2
290include $(TEST_PATH)/Android.build.mk
291
292# -----------------------------------------------------------------------------
Dmitriy Ivanovdb7a17d2014-08-04 23:39:22 +0000293# Library with dependency used by dlfcn tests
294# -----------------------------------------------------------------------------
295libtest_with_dependency_src_files := \
296 dlopen_testlib_simple.cpp
297
298libtest_with_dependency_shared_libraries := libdlext_test
299
300module := libtest_with_dependency
301build_type := target
302build_target := SHARED_LIBRARY
303include $(TEST_PATH)/Android.build.mk
304
305# -----------------------------------------------------------------------------
Brigid Smith31b88da2014-07-23 11:22:25 -0700306# Library used by ifunc tests
307# -----------------------------------------------------------------------------
Dmitriy Ivanov1cd0c672014-10-01 16:26:49 -0700308ifeq ($(TARGET_ARCH),$(filter $(TARGET_ARCH),x86 x86_64))
Brigid Smith31b88da2014-07-23 11:22:25 -0700309 libtest_ifunc_src_files := \
310 dlopen_testlib_ifunc.c
311
312 LOCAL_SDK_VERSION := current
313 module := libtest_ifunc
314 build_type := target
315 build_target := SHARED_LIBRARY
Dmitriy Ivanovf4cb6312014-09-11 15:16:03 -0700316
Brigid Smith31b88da2014-07-23 11:22:25 -0700317 include $(TEST_PATH)/Android.build.mk
318endif
319
320# -----------------------------------------------------------------------------
Dmitriy Ivanov1f5e1a32014-06-02 16:29:00 -0700321# Library used by atexit tests
322# -----------------------------------------------------------------------------
323
324libtest_atexit_src_files := \
325 atexit_testlib.cpp
326
327module := libtest_atexit
328build_target := SHARED_LIBRARY
329build_type := target
330include $(TEST_PATH)/Android.build.mk
331build_type := host
332include $(TEST_PATH)/Android.build.mk
333
Dmitriy Ivanovce441662014-06-17 15:56:38 -0700334# -----------------------------------------------------------------------------
335# Library with weak function
336# -----------------------------------------------------------------------------
337libtest_dlsym_weak_func_src_files := \
338 dlsym_weak_function.cpp
339
340module := libtest_dlsym_weak_func
341build_target := SHARED_LIBRARY
342build_type := target
343include $(TEST_PATH)/Android.build.mk
344build_type := host
345include $(TEST_PATH)/Android.build.mk
Dmitriy Ivanovde017802014-10-03 17:52:44 -0700346
347LOCAL_ADDITIONAL_DEPENDENCIES := \
348 $(LOCAL_PATH)/Android.mk \
349 $(LOCAL_PATH)/Android.build.dlext_testzip.mk \
350 $(LOCAL_PATH)/Android.build.testlib.mk \
351 $(TEST_PATH)/Android.build.mk