Dmitriy Ivanov | 42d5fcb | 2015-10-29 17:01:24 -0700 | [diff] [blame] | 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 |
Dimitry Ivanov | 7a34b9d | 2017-02-03 14:07:34 -0800 | [diff] [blame] | 28 | # 4. Check that having access to shared library (libnstest_public.so) |
| 29 | # does not expose symbols from dependent library (libnstest_public_internal.so) |
Dmitriy Ivanov | 42d5fcb | 2015-10-29 17:01:24 -0700 | [diff] [blame] | 30 | # |
| 31 | # Dependency tree (visibility) |
| 32 | # libnstest_root.so (this should be local to the namespace) |
| 33 | # +-> libnstest_public.so |
Dimitry Ivanov | 7a34b9d | 2017-02-03 14:07:34 -0800 | [diff] [blame] | 34 | # +-> libnstest_public_internal.so |
Dmitriy Ivanov | 42d5fcb | 2015-10-29 17:01:24 -0700 | [diff] [blame] | 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 |
Dimitry Ivanov | a36e59b | 2016-09-01 11:37:39 -0700 | [diff] [blame] | 41 | libnstest_root_relative_install_path := private_namespace_libs |
Dmitriy Ivanov | 42d5fcb | 2015-10-29 17:01:24 -0700 | [diff] [blame] | 42 | module := libnstest_root |
Dimitry Ivanov | a36e59b | 2016-09-01 11:37:39 -0700 | [diff] [blame] | 43 | include $(LOCAL_PATH)/Android.build.testlib.target.mk |
Dmitriy Ivanov | 42d5fcb | 2015-10-29 17:01:24 -0700 | [diff] [blame] | 44 | |
Dimitry Ivanov | 7a34b9d | 2017-02-03 14:07:34 -0800 | [diff] [blame] | 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 | |
Dmitriy Ivanov | 42d5fcb | 2015-10-29 17:01:24 -0700 | [diff] [blame] | 50 | libnstest_public_src_files := namespaces_public.cpp |
Dimitry Ivanov | 7a34b9d | 2017-02-03 14:07:34 -0800 | [diff] [blame] | 51 | libnstest_public_shared_libraries := libnstest_public_internal |
Dmitriy Ivanov | 42d5fcb | 2015-10-29 17:01:24 -0700 | [diff] [blame] | 52 | module := libnstest_public |
Dimitry Ivanov | a36e59b | 2016-09-01 11:37:39 -0700 | [diff] [blame] | 53 | libnstest_public_relative_install_path := public_namespace_libs |
| 54 | include $(LOCAL_PATH)/Android.build.testlib.target.mk |
Dmitriy Ivanov | 42d5fcb | 2015-10-29 17:01:24 -0700 | [diff] [blame] | 55 | |
| 56 | libnstest_private_src_files := namespaces_private.cpp |
Dimitry Ivanov | a36e59b | 2016-09-01 11:37:39 -0700 | [diff] [blame] | 57 | libnstest_private_relative_install_path := private_namespace_libs |
Dmitriy Ivanov | 42d5fcb | 2015-10-29 17:01:24 -0700 | [diff] [blame] | 58 | module := libnstest_private |
Dimitry Ivanov | a36e59b | 2016-09-01 11:37:39 -0700 | [diff] [blame] | 59 | include $(LOCAL_PATH)/Android.build.testlib.target.mk |
Dmitriy Ivanov | 42d5fcb | 2015-10-29 17:01:24 -0700 | [diff] [blame] | 60 | |
| 61 | libnstest_dlopened_src_files := namespaces_dlopened.cpp |
Dimitry Ivanov | a36e59b | 2016-09-01 11:37:39 -0700 | [diff] [blame] | 62 | libnstest_dlopened_relative_install_path := private_namespace_libs |
Dmitriy Ivanov | 42d5fcb | 2015-10-29 17:01:24 -0700 | [diff] [blame] | 63 | module := libnstest_dlopened |
Dimitry Ivanov | a36e59b | 2016-09-01 11:37:39 -0700 | [diff] [blame] | 64 | include $(LOCAL_PATH)/Android.build.testlib.target.mk |
Dmitriy Ivanov | 42d5fcb | 2015-10-29 17:01:24 -0700 | [diff] [blame] | 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 |
Dimitry Ivanov | a36e59b | 2016-09-01 11:37:39 -0700 | [diff] [blame] | 83 | libnstest_root_not_isolated_relative_install_path := private_namespace_libs |
Dmitriy Ivanov | 42d5fcb | 2015-10-29 17:01:24 -0700 | [diff] [blame] | 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 |
Dimitry Ivanov | a36e59b | 2016-09-01 11:37:39 -0700 | [diff] [blame] | 88 | include $(LOCAL_PATH)/Android.build.testlib.target.mk |
Dmitriy Ivanov | 42d5fcb | 2015-10-29 17:01:24 -0700 | [diff] [blame] | 89 | |
| 90 | libnstest_private_external_src_files := namespaces_private.cpp |
Dimitry Ivanov | a36e59b | 2016-09-01 11:37:39 -0700 | [diff] [blame] | 91 | libnstest_private_external_relative_install_path := private_namespace_libs_external |
Dmitriy Ivanov | 42d5fcb | 2015-10-29 17:01:24 -0700 | [diff] [blame] | 92 | module := libnstest_private_external |
Dimitry Ivanov | a36e59b | 2016-09-01 11:37:39 -0700 | [diff] [blame] | 93 | include $(LOCAL_PATH)/Android.build.testlib.target.mk |