blob: a675a4f8cb77fe75f40b15314ac17f4a21104f8b [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
Dmitriy Ivanov4571f312014-08-15 14:22:07 -070020common_cppflags += -std=gnu++11
Dmitriy Ivanov1f5e1a32014-06-02 16:29:00 -070021# -----------------------------------------------------------------------------
22# Library used by dlfcn tests.
23# -----------------------------------------------------------------------------
24ifneq ($(TARGET_ARCH),$(filter $(TARGET_ARCH),mips mips64))
25no-elf-hash-table-library_src_files := \
26 empty.cpp \
27
28no-elf-hash-table-library_ldflags := \
29 -Wl,--hash-style=gnu \
30
31module := no-elf-hash-table-library
32module_tag := optional
33build_type := target
34build_target := SHARED_LIBRARY
35include $(TEST_PATH)/Android.build.mk
36endif
37
38# -----------------------------------------------------------------------------
39# Library used by dlext tests - with GNU RELRO program header
40# -----------------------------------------------------------------------------
41libdlext_test_src_files := \
42 dlext_test_library.cpp \
43
44libdlext_test_ldflags := \
45 -Wl,-z,relro \
46
47module := libdlext_test
48module_tag := optional
49build_type := target
50build_target := SHARED_LIBRARY
51include $(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
60ifneq ($(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
64endif
65
66# -----------------------------------------------------------------------------
67# Library used by dlext tests - without GNU RELRO program header
68# -----------------------------------------------------------------------------
69libdlext_test_norelro_src_files := \
70 dlext_test_library.cpp \
71
72libdlext_test_norelro_ldflags := \
73 -Wl,-z,norelro \
74
75module := libdlext_test_norelro
76module_tag := optional
77build_type := target
78build_target := SHARED_LIBRARY
79include $(TEST_PATH)/Android.build.mk
80
81# -----------------------------------------------------------------------------
Dmitriy Ivanov04dc91a2014-07-01 14:10:16 -070082# Library used by dlext tests - different name non-default location
83# -----------------------------------------------------------------------------
84libdlext_test_fd_src_files := \
85 dlext_test_library.cpp \
86
87libdlext_test_fd_install_to_out_data := true
88module := libdlext_test_fd
89module_tag := optional
90build_type := target
91build_target := SHARED_LIBRARY
92include $(TEST_PATH)/Android.build.mk
93
94# -----------------------------------------------------------------------------
Dmitriy Ivanov1f5e1a32014-06-02 16:29:00 -070095# Library used by dlfcn tests
96# -----------------------------------------------------------------------------
97libtest_simple_src_files := \
98 dlopen_testlib_simple.cpp
99
100module := libtest_simple
101build_type := target
102build_target := SHARED_LIBRARY
103include $(TEST_PATH)/Android.build.mk
104
Dmitriy Ivanovd97e9f52014-06-29 12:28:37 -0700105# -----------------------------------------------------------------------------
Dmitriy Ivanov14669a92014-09-05 16:42:53 -0700106# Libraries used by dlfcn tests to verify correct load order:
107# libtest_check_order_2_right.so
108# -----------------------------------------------------------------------------
109libtest_check_order_2_right_src_files := \
110 dlopen_testlib_answer.cpp
111
112libtest_check_order_2_right_cflags := -D__ANSWER=42
113module := libtest_check_order_2_right
114build_type := target
115build_target := SHARED_LIBRARY
116include $(TEST_PATH)/Android.build.mk
117
118# -----------------------------------------------------------------------------
119# libtest_check_order_a.so
120# -----------------------------------------------------------------------------
121libtest_check_order_a_src_files := \
122 dlopen_testlib_answer.cpp
123
124libtest_check_order_a_cflags := -D__ANSWER=1
125module := libtest_check_order_a
126build_type := target
127build_target := SHARED_LIBRARY
128include $(TEST_PATH)/Android.build.mk
129
130# -----------------------------------------------------------------------------
131# libtest_check_order_b.so
132# -----------------------------------------------------------------------------
133libtest_check_order_b_src_files := \
134 dlopen_testlib_answer.cpp
135
136libtest_check_order_b_cflags := -D__ANSWER=2 -D__ANSWER2=43
137module := libtest_check_order_b
138build_type := target
139build_target := SHARED_LIBRARY
140include $(TEST_PATH)/Android.build.mk
141
142# -----------------------------------------------------------------------------
143# libtest_check_order_c.so
144# -----------------------------------------------------------------------------
145libtest_check_order_3_c_src_files := \
146 dlopen_testlib_answer.cpp
147
148libtest_check_order_3_c_cflags := -D__ANSWER=3
149module := libtest_check_order_3_c
150build_type := target
151build_target := SHARED_LIBRARY
152include $(TEST_PATH)/Android.build.mk
153
154# -----------------------------------------------------------------------------
155# libtest_check_order_d.so
156# -----------------------------------------------------------------------------
157libtest_check_order_d_src_files := \
158 dlopen_testlib_answer.cpp
159
160libtest_check_order_d_shared_libraries := libtest_check_order_b
161libtest_check_order_d_cflags := -D__ANSWER=4 -D__ANSWER2=4
162module := libtest_check_order_d
163build_type := target
164build_target := SHARED_LIBRARY
165include $(TEST_PATH)/Android.build.mk
166
167# -----------------------------------------------------------------------------
168# libtest_check_order_left.so
169# -----------------------------------------------------------------------------
170libtest_check_order_1_left_src_files := \
171 empty.cpp
172
173libtest_check_order_1_left_shared_libraries := libtest_check_order_a libtest_check_order_b
174
175module := libtest_check_order_1_left
176build_type := target
177build_target := SHARED_LIBRARY
178include $(TEST_PATH)/Android.build.mk
179
180# -----------------------------------------------------------------------------
181# libtest_check_order.so
182# -----------------------------------------------------------------------------
183libtest_check_order_src_files := \
184 empty.cpp
185
186libtest_check_order_shared_libraries := libtest_check_order_1_left \
187 libtest_check_order_2_right libtest_check_order_3_c
188
189module := libtest_check_order
190build_type := target
191build_target := SHARED_LIBRARY
192include $(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# -----------------------------------------------------------------------------
199libtest_with_dependency_loop_src_files := empty.cpp
200
201libtest_with_dependency_loop_shared_libraries := \
202 libtest_with_dependency_loop_a
203
204module := libtest_with_dependency_loop
205build_type := target
206build_target := SHARED_LIBRARY
207include $(TEST_PATH)/Android.build.mk
208
209# -----------------------------------------------------------------------------
210# libtest_with_dependency_loop_a.so
211# -----------------------------------------------------------------------------
212libtest_with_dependency_loop_a_src_files := empty.cpp
213
214libtest_with_dependency_loop_a_shared_libraries := \
215 libtest_with_dependency_loop_b_tmp
216
217module := libtest_with_dependency_loop_a
218build_type := target
219build_target := SHARED_LIBRARY
220include $(TEST_PATH)/Android.build.mk
221
222# -----------------------------------------------------------------------------
223# libtest_with_dependency_loop_b.so
224#
225# this is temporary placeholder - will be removed
226# -----------------------------------------------------------------------------
227libtest_with_dependency_loop_b_tmp_src_files := empty.cpp
228libtest_with_dependency_loop_b_tmp_ldflags := -Wl,-soname=libtest_with_dependency_loop_b.so
229
230module := libtest_with_dependency_loop_b_tmp
231build_type := target
232build_target := SHARED_LIBRARY
233include $(TEST_PATH)/Android.build.mk
234
235# -----------------------------------------------------------------------------
236# libtest_with_dependency_loop_b.so
237# -----------------------------------------------------------------------------
238libtest_with_dependency_loop_b_src_files := empty.cpp
239libtest_with_dependency_loop_b_shared_libraries := libtest_with_dependency_loop_c
240
241module := libtest_with_dependency_loop_b
242build_type := target
243build_target := SHARED_LIBRARY
244include $(TEST_PATH)/Android.build.mk
245
246# -----------------------------------------------------------------------------
247# libtest_with_dependency_loop_c.so
248# -----------------------------------------------------------------------------
249libtest_with_dependency_loop_c_src_files := empty.cpp
250
251libtest_with_dependency_loop_c_shared_libraries := \
252 libtest_with_dependency_loop_a
253
254module := libtest_with_dependency_loop_c
255build_type := target
256build_target := SHARED_LIBRARY
257include $(TEST_PATH)/Android.build.mk
258
259# -----------------------------------------------------------------------------
Dmitriy Ivanovb2a30ee2014-09-04 18:23:00 -0700260# 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# -----------------------------------------------------------------------------
266libtest_relo_check_dt_needed_order_shared_libraries := \
267 libtest_relo_check_dt_needed_order_1 libtest_relo_check_dt_needed_order_2
268
269libtest_relo_check_dt_needed_order_src_files := dlopen_testlib_relo_check_dt_needed_order.cpp
270libtest_relo_check_dt_needed_order_1_src_files := dlopen_testlib_relo_check_dt_needed_order_1.cpp
271libtest_relo_check_dt_needed_order_2_src_files := dlopen_testlib_relo_check_dt_needed_order_2.cpp
272build_type := target
273build_target := SHARED_LIBRARY
274
275module := libtest_relo_check_dt_needed_order
276include $(TEST_PATH)/Android.build.mk
277module := libtest_relo_check_dt_needed_order_1
278include $(TEST_PATH)/Android.build.mk
279module := libtest_relo_check_dt_needed_order_2
280include $(TEST_PATH)/Android.build.mk
281
282# -----------------------------------------------------------------------------
Dmitriy Ivanovaa0f2bd2014-07-28 17:32:20 -0700283# Library with dependency used by dlfcn tests
284# -----------------------------------------------------------------------------
285libtest_with_dependency_src_files := \
286 dlopen_testlib_simple.cpp
287
288libtest_with_dependency_shared_libraries := libdlext_test
289
290module := libtest_with_dependency
291build_type := target
292build_target := SHARED_LIBRARY
293include $(TEST_PATH)/Android.build.mk
294
295# -----------------------------------------------------------------------------
Brigid Smithc5a13ef2014-07-23 11:22:25 -0700296# Library used by ifunc tests
297# -----------------------------------------------------------------------------
Dmitriy Ivanov9aea1642014-09-11 15:16:03 -0700298ifeq ($(TARGET_ARCH),$(filter $(TARGET_ARCH),arm64 x86 x86_64))
Brigid Smithc5a13ef2014-07-23 11:22:25 -0700299 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 Ivanov9aea1642014-09-11 15:16:03 -0700306
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 Smithc5a13ef2014-07-23 11:22:25 -0700314 include $(TEST_PATH)/Android.build.mk
315endif
316
317# -----------------------------------------------------------------------------
Dmitriy Ivanov1f5e1a32014-06-02 16:29:00 -0700318# Library used by atexit tests
319# -----------------------------------------------------------------------------
320
321libtest_atexit_src_files := \
322 atexit_testlib.cpp
323
324module := libtest_atexit
325build_target := SHARED_LIBRARY
326build_type := target
327include $(TEST_PATH)/Android.build.mk
328build_type := host
329include $(TEST_PATH)/Android.build.mk
330
Dmitriy Ivanovce441662014-06-17 15:56:38 -0700331# -----------------------------------------------------------------------------
332# Library with weak function
333# -----------------------------------------------------------------------------
334libtest_dlsym_weak_func_src_files := \
335 dlsym_weak_function.cpp
336
337module := libtest_dlsym_weak_func
338build_target := SHARED_LIBRARY
339build_type := target
340include $(TEST_PATH)/Android.build.mk
341build_type := host
342include $(TEST_PATH)/Android.build.mk