blob: b0d8e4b80b2cd8524fcbe9a7ab1936d90d4a8748 [file] [log] [blame]
Evgenii Stepanov68650822015-06-10 13:38:39 -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
17# -----------------------------------------------------------------------------
18# Libraries used by dt_runpath tests.
19# -----------------------------------------------------------------------------
20
Dmitriy Ivanova1feb112015-10-01 18:41:57 -070021#
22# Dependencies
23#
Jiyong Parkd7ca6782019-01-20 01:41:42 +090024# libtest_dt_runpath_d.so runpath: ${ORIGIN}/dt_runpath_b_c_x, ${ORIGIN}/dt_runpath_y/${LIB}
Dmitriy Ivanova1feb112015-10-01 18:41:57 -070025# |-> dt_runpath_b_c_x/libtest_dt_runpath_b.so runpath: ${ORIGIN}/../dt_runpath_a
26# | |-> dt_runpath_a/libtest_dt_runpath_a.so
27# |-> dt_runpath_b_c_x/libtest_dt_runpath_c.so runpath: ${ORIGIN}/invalid_dt_runpath
28# | |-> libtest_dt_runpath_a.so (soname)
Jiyong Parkd7ca6782019-01-20 01:41:42 +090029# |-> dt_runpath_y/lib[64]/libtest_dt_runpath_y.so
Dmitriy Ivanova1feb112015-10-01 18:41:57 -070030#
31# This one is used to test dlopen
32# dt_runpath_b_c_x/libtest_dt_runpath_x.so
33#
34
Evgenii Stepanov68650822015-06-10 13:38:39 -070035# A leaf library in a non-standard directory.
36libtest_dt_runpath_a_src_files := \
37 empty.cpp
38
39libtest_dt_runpath_a_relative_path := dt_runpath_a
40module := libtest_dt_runpath_a
41include $(LOCAL_PATH)/Android.build.testlib.mk
42
43# Depends on library A with a DT_RUNPATH
44libtest_dt_runpath_b_src_files := \
45 empty.cpp
46
47libtest_dt_runpath_b_shared_libraries := libtest_dt_runpath_a
Dmitriy Ivanov3fef96f2015-07-20 10:47:49 -070048libtest_dt_runpath_b_ldflags := -Wl,--rpath,\$${ORIGIN}/../dt_runpath_a -Wl,--enable-new-dtags
Evgenii Stepanov68650822015-06-10 13:38:39 -070049libtest_dt_runpath_b_relative_path := dt_runpath_b_c_x
50module := libtest_dt_runpath_b
51include $(LOCAL_PATH)/Android.build.testlib.mk
52
53# Depends on library A with an incorrect DT_RUNPATH. This does not matter
54# because B is the first in the D (below) dependency order, and library A
55# is already loaded using the correct DT_RUNPATH from library B.
56libtest_dt_runpath_c_src_files := \
57 empty.cpp
58
59libtest_dt_runpath_c_shared_libraries := libtest_dt_runpath_a
Dmitriy Ivanov3fef96f2015-07-20 10:47:49 -070060libtest_dt_runpath_c_ldflags := -Wl,--rpath,\$${ORIGIN}/invalid_dt_runpath -Wl,--enable-new-dtags
Evgenii Stepanov68650822015-06-10 13:38:39 -070061libtest_dt_runpath_c_relative_path := dt_runpath_b_c_x
62module := libtest_dt_runpath_c
63include $(LOCAL_PATH)/Android.build.testlib.mk
64
Jiyong Parkd7ca6782019-01-20 01:41:42 +090065# D depends on B, C, and Y with DT_RUNPATH.
Evgenii Stepanov68650822015-06-10 13:38:39 -070066libtest_dt_runpath_d_src_files := \
67 dlopen_b.cpp
68
Jiyong Parkd7ca6782019-01-20 01:41:42 +090069libtest_dt_runpath_d_shared_libraries := \
70 libtest_dt_runpath_b \
71 libtest_dt_runpath_c \
72 libtest_dt_runpath_y
73libtest_dt_runpath_d_ldflags := \
74 -Wl,--rpath,\$${ORIGIN}/dt_runpath_b_c_x \
75 -Wl,--rpath,\$${ORIGIN}/dt_runpath_y/\$${LIB} \
76 -Wl,--enable-new-dtags
Colin Crossd0ba52e2016-10-20 10:39:50 -070077libtest_dt_runpath_d_ldlibs := -ldl
Evgenii Stepanov68650822015-06-10 13:38:39 -070078module := libtest_dt_runpath_d
79include $(LOCAL_PATH)/Android.build.testlib.mk
80
Dmitriy Ivanova1feb112015-10-01 18:41:57 -070081# D version for open-from-zip test with runpath
Dimitry Ivanovb16e4432016-08-29 13:15:38 -070082module := libtest_dt_runpath_d_zip
83
Dmitriy Ivanova1feb112015-10-01 18:41:57 -070084libtest_dt_runpath_d_zip_src_files := \
85 dlopen_b.cpp
86
Jiyong Parkd7ca6782019-01-20 01:41:42 +090087libtest_dt_runpath_d_zip_shared_libraries := \
88 libtest_dt_runpath_b \
89 libtest_dt_runpath_c \
90 libtest_dt_runpath_y
91libtest_dt_runpath_d_zip_ldflags := \
92 -Wl,--rpath,\$${ORIGIN}/dt_runpath_b_c_x \
93 -Wl,--rpath,\$${ORIGIN}/dt_runpath_y/\$${LIB} \
94 -Wl,--enable-new-dtags
Colin Crossd0ba52e2016-10-20 10:39:50 -070095libtest_dt_runpath_d_zip_ldlibs := -ldl
Kevin Brodskyee2952e2016-12-09 09:54:42 +000096libtest_dt_runpath_d_zip_install_to_native_tests_dir := $(module)
Dimitry Ivanovb16e4432016-08-29 13:15:38 -070097
Dmitriy Ivanova1feb112015-10-01 18:41:57 -070098module_tag := optional
99build_type := target
100build_target := SHARED_LIBRARY
101include $(TEST_PATH)/Android.build.mk
102
103
Evgenii Stepanov68650822015-06-10 13:38:39 -0700104# A leaf library in a directory library D has DT_RUNPATH for.
105libtest_dt_runpath_x_src_files := \
106 empty.cpp
107
108libtest_dt_runpath_x_relative_path := dt_runpath_b_c_x
109module := libtest_dt_runpath_x
110include $(LOCAL_PATH)/Android.build.testlib.mk
Dmitriy Ivanova1feb112015-10-01 18:41:57 -0700111
Jiyong Parkd7ca6782019-01-20 01:41:42 +0900112# A leaf library in lib or lib64 directory
113libtest_dt_runpath_y_src_files := \
114 empty.cpp
115
116ifeq ($(TARGET_TRANSLATE_2ND_ARCH),true)
117libtest_dt_runpath_y_install_to_native_tests_dir_32 := bionic-loader-test-libs/dt_runpath_y/lib/$(TARGET_2ND_ARCH)
118else
119libtest_dt_runpath_y_install_to_native_tests_dir_32 := bionic-loader-test-libs/dt_runpath_y/lib
120endif
121ifeq ($(TARGET_IS_64_BIT),true)
122libtest_dt_runpath_y_install_to_native_tests_dir_64 := bionic-loader-test-libs/dt_runpath_y/lib64
123else
124libtest_dt_runpath_y_install_to_native_tests_dir_64 := bionic-loader-test-libs/dt_runpath_y/lib
125endif
126
127module := libtest_dt_runpath_y
128include $(LOCAL_PATH)/Android.build.testlib.mk