1#
2# Copyright (C) 2015 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# This set of libraries are used to verify linker namespaces.
19# -----------------------------------------------------------------------------
20
21# -----------------------------------------------------------------------------
22# Test cases
23# 1. Check that private libraries loaded in different namespaces are
24#    different. Check that dlsym does not confuse them.
25# 2. Check that public libraries loaded in different namespaces are shared
26#    between them.
27# 3. Check that namespace sticks on dlopen
28#
29# Dependency tree (visibility)
30# libnstest_root.so (this should be local to the namespace)
31# +-> libnstest_public.so
32# +-> libnstest_private.so
33#
34# libnstest_dlopened.so (library in private namespace dlopened from libnstest_root.so)
35# -----------------------------------------------------------------------------
36libnstest_root_src_files := namespaces_root.cpp
37libnstest_root_shared_libraries := libnstest_public libnstest_private
38libnstest_root_install_to_out_data_dir := private_namespace_libs
39module := libnstest_root
40include $(LOCAL_PATH)/Android.build.target.testlib.mk
41
42libnstest_public_src_files := namespaces_public.cpp
43module := libnstest_public
44libnstest_public_install_to_out_data_dir := public_namespace_libs
45include $(LOCAL_PATH)/Android.build.target.testlib.mk
46
47libnstest_private_src_files := namespaces_private.cpp
48libnstest_private_install_to_out_data_dir := private_namespace_libs
49module := libnstest_private
50include $(LOCAL_PATH)/Android.build.target.testlib.mk
51
52libnstest_dlopened_src_files := namespaces_dlopened.cpp
53libnstest_dlopened_install_to_out_data_dir := private_namespace_libs
54module := libnstest_dlopened
55include $(LOCAL_PATH)/Android.build.target.testlib.mk
56
57# -----------------------------------------------------------------------------
58# This set of libraries is to test isolated namespaces
59#
60# Isolated namespaces do not allow loading of the library outside of
61# the search paths.
62#
63# This library cannot be loaded in isolated namespace because one of DT_NEEDED
64# libraries is outside of the search paths.
65#
66# libnstest_root_not_isolated.so (DT_RUNPATH = $ORIGIN/../private_namespace_libs_external/)
67# +-> libnstest_public.so
68# +-> libnstest_private_external.so (located in $ORIGIN/../private_namespace_libs_external/)
69#
70# Search path: $NATIVE_TESTS/private_namespace_libs/
71# -----------------------------------------------------------------------------
72libnstest_root_not_isolated_src_files := namespaces_root.cpp
73libnstest_root_not_isolated_shared_libraries := libnstest_public libnstest_private_external
74libnstest_root_not_isolated_install_to_out_data_dir := private_namespace_libs
75libnstest_root_not_isolated_ldflags := -Wl,--rpath,\$$ORIGIN/../private_namespace_libs_external \
76                                       -Wl,--enable-new-dtags
77
78module := libnstest_root_not_isolated
79include $(LOCAL_PATH)/Android.build.target.testlib.mk
80
81libnstest_private_external_src_files := namespaces_private.cpp
82libnstest_private_external_install_to_out_data_dir := private_namespace_libs_external
83module := libnstest_private_external
84include $(LOCAL_PATH)/Android.build.target.testlib.mk
85