blob: 65c341de84406593432781c4ec8ed99ddc72503d [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 Ivanovaa0f2bd2014-07-28 17:32:20 -0700106# Library with dependency used by dlfcn tests
107# -----------------------------------------------------------------------------
108libtest_with_dependency_src_files := \
109 dlopen_testlib_simple.cpp
110
111libtest_with_dependency_shared_libraries := libdlext_test
112
113module := libtest_with_dependency
114build_type := target
115build_target := SHARED_LIBRARY
116include $(TEST_PATH)/Android.build.mk
117
118# -----------------------------------------------------------------------------
Brigid Smithc5a13ef2014-07-23 11:22:25 -0700119# Library used by ifunc tests
120# -----------------------------------------------------------------------------
121ifeq ($(TARGET_ARCH),$(filter $(TARGET_ARCH),x86 x86_64))
122 libtest_ifunc_src_files := \
123 dlopen_testlib_ifunc.c
124
125 LOCAL_SDK_VERSION := current
126 module := libtest_ifunc
127 build_type := target
128 build_target := SHARED_LIBRARY
129 include $(TEST_PATH)/Android.build.mk
130endif
131
132# -----------------------------------------------------------------------------
Dmitriy Ivanovd97e9f52014-06-29 12:28:37 -0700133# Library used to test local symbol lookup
134# -----------------------------------------------------------------------------
135libtest_local_symbol_src_files := \
136 dlsym_local_symbol_private.cpp \
137 dlsym_local_symbol_public.cpp
138
139module := libtest_local_symbol
140build_target := SHARED_LIBRARY
141libtest_local_symbol_ldflags := -Wl,--version-script=$(LOCAL_PATH)/dlsym_local_symbol.map
142libtest_local_symbol_cppflags := -std=gnu++11
143libtest_local_symbol_shared_libraries_target := libdl
144build_type := target
145include $(TEST_PATH)/Android.build.mk
Dmitriy Ivanov1f5e1a32014-06-02 16:29:00 -0700146
147# -----------------------------------------------------------------------------
148# Library used by atexit tests
149# -----------------------------------------------------------------------------
150
151libtest_atexit_src_files := \
152 atexit_testlib.cpp
153
154module := libtest_atexit
155build_target := SHARED_LIBRARY
156build_type := target
157include $(TEST_PATH)/Android.build.mk
158build_type := host
159include $(TEST_PATH)/Android.build.mk
160
Dmitriy Ivanovce441662014-06-17 15:56:38 -0700161# -----------------------------------------------------------------------------
162# Library with weak function
163# -----------------------------------------------------------------------------
164libtest_dlsym_weak_func_src_files := \
165 dlsym_weak_function.cpp
166
167module := libtest_dlsym_weak_func
168build_target := SHARED_LIBRARY
169build_type := target
170include $(TEST_PATH)/Android.build.mk
171build_type := host
172include $(TEST_PATH)/Android.build.mk