Home | History | Annotate | Download | only in libs
      1 #
      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 
     21 #
     22 # Dependencies
     23 #
     24 # libtest_dt_runpath_d.so                       runpath: ${ORIGIN}/dt_runpath_b_c_x, ${ORIGIN}/dt_runpath_y/${LIB}
     25 # |-> 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)
     29 # |-> dt_runpath_y/lib[64]/libtest_dt_runpath_y.so
     30 #
     31 # This one is used to test dlopen
     32 # dt_runpath_b_c_x/libtest_dt_runpath_x.so
     33 #
     34 
     35 # A leaf library in a non-standard directory.
     36 libtest_dt_runpath_a_src_files := \
     37     empty.cpp
     38 
     39 libtest_dt_runpath_a_relative_path := dt_runpath_a
     40 module := libtest_dt_runpath_a
     41 include $(LOCAL_PATH)/Android.build.testlib.mk
     42 
     43 # Depends on library A with a DT_RUNPATH
     44 libtest_dt_runpath_b_src_files := \
     45     empty.cpp
     46 
     47 libtest_dt_runpath_b_shared_libraries := libtest_dt_runpath_a
     48 libtest_dt_runpath_b_ldflags := -Wl,--rpath,\$${ORIGIN}/../dt_runpath_a -Wl,--enable-new-dtags
     49 libtest_dt_runpath_b_relative_path := dt_runpath_b_c_x
     50 module := libtest_dt_runpath_b
     51 include $(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.
     56 libtest_dt_runpath_c_src_files := \
     57     empty.cpp
     58 
     59 libtest_dt_runpath_c_shared_libraries := libtest_dt_runpath_a
     60 libtest_dt_runpath_c_ldflags := -Wl,--rpath,\$${ORIGIN}/invalid_dt_runpath -Wl,--enable-new-dtags
     61 libtest_dt_runpath_c_relative_path := dt_runpath_b_c_x
     62 module := libtest_dt_runpath_c
     63 include $(LOCAL_PATH)/Android.build.testlib.mk
     64 
     65 # D depends on B, C, and Y with DT_RUNPATH.
     66 libtest_dt_runpath_d_src_files := \
     67     dlopen_b.cpp
     68 
     69 libtest_dt_runpath_d_shared_libraries := \
     70     libtest_dt_runpath_b \
     71     libtest_dt_runpath_c \
     72     libtest_dt_runpath_y
     73 libtest_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
     77 libtest_dt_runpath_d_ldlibs := -ldl
     78 module := libtest_dt_runpath_d
     79 include $(LOCAL_PATH)/Android.build.testlib.mk
     80 
     81 # D version for open-from-zip test with runpath
     82 module := libtest_dt_runpath_d_zip
     83 
     84 libtest_dt_runpath_d_zip_src_files := \
     85     dlopen_b.cpp
     86 
     87 libtest_dt_runpath_d_zip_shared_libraries := \
     88     libtest_dt_runpath_b \
     89     libtest_dt_runpath_c \
     90     libtest_dt_runpath_y
     91 libtest_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
     95 libtest_dt_runpath_d_zip_ldlibs := -ldl
     96 libtest_dt_runpath_d_zip_install_to_native_tests_dir := $(module)
     97 
     98 module_tag := optional
     99 build_type := target
    100 build_target := SHARED_LIBRARY
    101 include $(TEST_PATH)/Android.build.mk
    102 
    103 
    104 # A leaf library in a directory library D has DT_RUNPATH for.
    105 libtest_dt_runpath_x_src_files := \
    106     empty.cpp
    107 
    108 libtest_dt_runpath_x_relative_path := dt_runpath_b_c_x
    109 module := libtest_dt_runpath_x
    110 include $(LOCAL_PATH)/Android.build.testlib.mk
    111 
    112 # A leaf library in lib or lib64 directory
    113 libtest_dt_runpath_y_src_files := \
    114     empty.cpp
    115 
    116 ifeq ($(TARGET_TRANSLATE_2ND_ARCH),true)
    117 libtest_dt_runpath_y_install_to_native_tests_dir_32 := bionic-loader-test-libs/dt_runpath_y/lib/$(TARGET_2ND_ARCH)
    118 else
    119 libtest_dt_runpath_y_install_to_native_tests_dir_32 := bionic-loader-test-libs/dt_runpath_y/lib
    120 endif
    121 ifeq ($(TARGET_IS_64_BIT),true)
    122 libtest_dt_runpath_y_install_to_native_tests_dir_64 := bionic-loader-test-libs/dt_runpath_y/lib64
    123 else
    124 libtest_dt_runpath_y_install_to_native_tests_dir_64 := bionic-loader-test-libs/dt_runpath_y/lib
    125 endif
    126 
    127 module := libtest_dt_runpath_y
    128 include $(LOCAL_PATH)/Android.build.testlib.mk
    129