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 # 4. Check that having access to shared library (libnstest_public.so) 29 # does not expose symbols from dependent library (libnstest_public_internal.so) 30 # 31 # Dependency tree (visibility) 32 # libnstest_root.so (this should be local to the namespace) 33 # +-> libnstest_public.so 34 # +-> libnstest_public_internal.so 35 # +-> libnstest_private.so 36 # 37 # libnstest_dlopened.so (library in private namespace dlopened from libnstest_root.so) 38 # ----------------------------------------------------------------------------- 39 libnstest_root_src_files := namespaces_root.cpp 40 libnstest_root_shared_libraries := libnstest_public libnstest_private 41 libnstest_root_relative_install_path := private_namespace_libs 42 module := libnstest_root 43 include $(LOCAL_PATH)/Android.build.testlib.target.mk 44 45 libnstest_public_internal_src_files := namespaces_public_internal.cpp 46 module := libnstest_public_internal 47 libnstest_public_internal_relative_install_path := public_namespace_libs 48 include $(LOCAL_PATH)/Android.build.testlib.target.mk 49 50 libnstest_public_src_files := namespaces_public.cpp 51 libnstest_public_shared_libraries := libnstest_public_internal 52 module := libnstest_public 53 libnstest_public_relative_install_path := public_namespace_libs 54 include $(LOCAL_PATH)/Android.build.testlib.target.mk 55 56 libnstest_private_src_files := namespaces_private.cpp 57 libnstest_private_relative_install_path := private_namespace_libs 58 module := libnstest_private 59 include $(LOCAL_PATH)/Android.build.testlib.target.mk 60 61 libnstest_dlopened_src_files := namespaces_dlopened.cpp 62 libnstest_dlopened_relative_install_path := private_namespace_libs 63 module := libnstest_dlopened 64 include $(LOCAL_PATH)/Android.build.testlib.target.mk 65 66 # ----------------------------------------------------------------------------- 67 # This set of libraries is to test isolated namespaces 68 # 69 # Isolated namespaces do not allow loading of the library outside of 70 # the search paths. 71 # 72 # This library cannot be loaded in isolated namespace because one of DT_NEEDED 73 # libraries is outside of the search paths. 74 # 75 # libnstest_root_not_isolated.so (DT_RUNPATH = $ORIGIN/../private_namespace_libs_external/) 76 # +-> libnstest_public.so 77 # +-> libnstest_private_external.so (located in $ORIGIN/../private_namespace_libs_external/) 78 # 79 # Search path: $NATIVE_TESTS/private_namespace_libs/ 80 # ----------------------------------------------------------------------------- 81 libnstest_root_not_isolated_src_files := namespaces_root.cpp 82 libnstest_root_not_isolated_shared_libraries := libnstest_public libnstest_private_external 83 libnstest_root_not_isolated_relative_install_path := private_namespace_libs 84 libnstest_root_not_isolated_ldflags := -Wl,--rpath,\$$ORIGIN/../private_namespace_libs_external \ 85 -Wl,--enable-new-dtags 86 87 module := libnstest_root_not_isolated 88 include $(LOCAL_PATH)/Android.build.testlib.target.mk 89 90 libnstest_private_external_src_files := namespaces_private.cpp 91 libnstest_private_external_relative_install_path := private_namespace_libs_external 92 module := libnstest_private_external 93 include $(LOCAL_PATH)/Android.build.testlib.target.mk 94