Home | History | Annotate | Download | only in libs
      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 # -----------------------------------------------------------------------------
     36 libnstest_root_src_files := namespaces_root.cpp
     37 libnstest_root_shared_libraries := libnstest_public libnstest_private
     38 libnstest_root_install_to_out_data_dir := private_namespace_libs
     39 module := libnstest_root
     40 include $(LOCAL_PATH)/Android.build.target.testlib.mk
     41 
     42 libnstest_public_src_files := namespaces_public.cpp
     43 module := libnstest_public
     44 libnstest_public_install_to_out_data_dir := public_namespace_libs
     45 include $(LOCAL_PATH)/Android.build.target.testlib.mk
     46 
     47 libnstest_private_src_files := namespaces_private.cpp
     48 libnstest_private_install_to_out_data_dir := private_namespace_libs
     49 module := libnstest_private
     50 include $(LOCAL_PATH)/Android.build.target.testlib.mk
     51 
     52 libnstest_dlopened_src_files := namespaces_dlopened.cpp
     53 libnstest_dlopened_install_to_out_data_dir := private_namespace_libs
     54 module := libnstest_dlopened
     55 include $(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 # -----------------------------------------------------------------------------
     72 libnstest_root_not_isolated_src_files := namespaces_root.cpp
     73 libnstest_root_not_isolated_shared_libraries := libnstest_public libnstest_private_external
     74 libnstest_root_not_isolated_install_to_out_data_dir := private_namespace_libs
     75 libnstest_root_not_isolated_ldflags := -Wl,--rpath,\$$ORIGIN/../private_namespace_libs_external \
     76                                        -Wl,--enable-new-dtags
     77 
     78 module := libnstest_root_not_isolated
     79 include $(LOCAL_PATH)/Android.build.target.testlib.mk
     80 
     81 libnstest_private_external_src_files := namespaces_private.cpp
     82 libnstest_private_external_install_to_out_data_dir := private_namespace_libs_external
     83 module := libnstest_private_external
     84 include $(LOCAL_PATH)/Android.build.target.testlib.mk
     85