| Orion Hodson | 9b16e34 | 2019-10-09 13:29:16 +0100 | [diff] [blame] | 1 | // Shared library for target |
| 2 | // ======================================================== |
| Bob Badour | 9150de6 | 2021-02-26 03:22:24 -0800 | [diff] [blame] | 3 | package { |
| 4 | // See: http://go/android-license-faq |
| 5 | // A large-scale-change added 'default_applicable_licenses' to import |
| 6 | // all of the 'license_kinds' from "art_license" |
| 7 | // to get the below license kinds: |
| 8 | // SPDX-license-identifier-Apache-2.0 |
| 9 | default_applicable_licenses: ["art_license"], |
| 10 | } |
| 11 | |
| Orion Hodson | 9b16e34 | 2019-10-09 13:29:16 +0100 | [diff] [blame] | 12 | cc_defaults { |
| 13 | name: "libnativeloader-defaults", |
| Martin Stjernholm | 3bb009a | 2019-10-17 21:29:01 +0100 | [diff] [blame] | 14 | defaults: ["art_defaults"], |
| Orion Hodson | 9b16e34 | 2019-10-09 13:29:16 +0100 | [diff] [blame] | 15 | cppflags: [ |
| 16 | "-fvisibility=hidden", |
| 17 | ], |
| 18 | header_libs: ["libnativeloader-headers"], |
| 19 | export_header_lib_headers: ["libnativeloader-headers"], |
| 20 | } |
| 21 | |
| David Srbecky | 1cf46a3 | 2020-06-22 15:39:00 +0100 | [diff] [blame] | 22 | art_cc_library { |
| Orion Hodson | 9b16e34 | 2019-10-09 13:29:16 +0100 | [diff] [blame] | 23 | name: "libnativeloader", |
| 24 | defaults: ["libnativeloader-defaults"], |
| Orion Hodson | c78860b | 2019-10-11 11:30:01 +0100 | [diff] [blame] | 25 | visibility: [ |
| Orion Hodson | c78860b | 2019-10-11 11:30:01 +0100 | [diff] [blame] | 26 | "//frameworks/base/cmds/app_process", |
| Martin Stjernholm | 3bb009a | 2019-10-17 21:29:01 +0100 | [diff] [blame] | 27 | // TODO(b/133140750): Clean this up. |
| Orion Hodson | c78860b | 2019-10-11 11:30:01 +0100 | [diff] [blame] | 28 | "//frameworks/base/native/webview/loader", |
| 29 | ], |
| Jiyong Park | 066dd902 | 2019-12-19 02:11:59 +0000 | [diff] [blame] | 30 | apex_available: [ |
| Martin Stjernholm | 3e9abfc | 2020-10-09 22:17:51 +0100 | [diff] [blame] | 31 | "com.android.art", |
| Jiyong Park | 066dd902 | 2019-12-19 02:11:59 +0000 | [diff] [blame] | 32 | "com.android.art.debug", |
| 33 | ], |
| Orion Hodson | 9b16e34 | 2019-10-09 13:29:16 +0100 | [diff] [blame] | 34 | host_supported: true, |
| 35 | srcs: [ |
| 36 | "native_loader.cpp", |
| 37 | ], |
| Orion Hodson | 00cb81d | 2020-04-03 06:47:07 +0100 | [diff] [blame] | 38 | header_libs: [ |
| 39 | "libnativehelper_header_only", |
| 40 | ], |
| Orion Hodson | 9b16e34 | 2019-10-09 13:29:16 +0100 | [diff] [blame] | 41 | shared_libs: [ |
| Orion Hodson | 9b16e34 | 2019-10-09 13:29:16 +0100 | [diff] [blame] | 42 | "liblog", |
| 43 | "libnativebridge", |
| 44 | "libbase", |
| 45 | ], |
| 46 | target: { |
| David Srbecky | c4b50b3 | 2020-07-01 15:10:23 +0100 | [diff] [blame] | 47 | // Library search path needed for running host tests remotely (from testcases directory). |
| 48 | linux_glibc_x86: { |
| 49 | ldflags: [ |
| 50 | "-Wl,-rpath,$ORIGIN/../art_common/out/host/linux-x86/lib", |
| 51 | "-Wl,--enable-new-dtags", |
| 52 | ], |
| 53 | }, |
| 54 | linux_glibc_x86_64: { |
| 55 | ldflags: [ |
| 56 | "-Wl,-rpath,$ORIGIN/../art_common/out/host/linux-x86/lib64", |
| 57 | "-Wl,--enable-new-dtags", |
| 58 | ], |
| 59 | }, |
| Orion Hodson | 9b16e34 | 2019-10-09 13:29:16 +0100 | [diff] [blame] | 60 | android: { |
| 61 | srcs: [ |
| 62 | "library_namespaces.cpp", |
| 63 | "native_loader_namespace.cpp", |
| 64 | "public_libraries.cpp", |
| 65 | ], |
| 66 | shared_libs: [ |
| 67 | "libdl_android", |
| 68 | ], |
| Martin Stjernholm | 2b84cf8 | 2021-01-28 22:54:14 +0000 | [diff] [blame] | 69 | static_libs: [ |
| Justin Yun | 3db26d5 | 2019-12-16 14:09:39 +0900 | [diff] [blame] | 70 | "PlatformProperties", |
| 71 | ], |
| Orion Hodson | 9b16e34 | 2019-10-09 13:29:16 +0100 | [diff] [blame] | 72 | }, |
| 73 | }, |
| Orion Hodson | 9b16e34 | 2019-10-09 13:29:16 +0100 | [diff] [blame] | 74 | stubs: { |
| 75 | symbol_file: "libnativeloader.map.txt", |
| 76 | versions: ["1"], |
| 77 | }, |
| 78 | } |
| 79 | |
| 80 | // TODO(b/124250621) eliminate the need for this library |
| 81 | cc_library { |
| 82 | name: "libnativeloader_lazy", |
| 83 | defaults: ["libnativeloader-defaults"], |
| Orion Hodson | c78860b | 2019-10-11 11:30:01 +0100 | [diff] [blame] | 84 | visibility: [ |
| 85 | "//frameworks/base/core/jni", |
| 86 | "//frameworks/native/opengl/libs", |
| 87 | "//frameworks/native/vulkan/libvulkan", |
| 88 | ], |
| Martin Stjernholm | b5ed330 | 2020-10-30 02:27:23 +0000 | [diff] [blame] | 89 | apex_available: [ |
| 90 | "//apex_available:platform", |
| Martin Stjernholm | 694f012 | 2020-10-30 02:23:24 +0000 | [diff] [blame] | 91 | "com.android.media", |
| 92 | "com.android.media.swcodec", |
| Martin Stjernholm | b5ed330 | 2020-10-30 02:27:23 +0000 | [diff] [blame] | 93 | ], |
| Orion Hodson | 9b16e34 | 2019-10-09 13:29:16 +0100 | [diff] [blame] | 94 | host_supported: false, |
| 95 | srcs: ["native_loader_lazy.cpp"], |
| Martin Stjernholm | b5ed330 | 2020-10-30 02:27:23 +0000 | [diff] [blame] | 96 | runtime_libs: ["libnativeloader"], |
| Mitch Phillips | 5472d6f | 2020-07-01 09:43:16 -0700 | [diff] [blame] | 97 | shared_libs: ["liblog"], |
| Orion Hodson | 9b16e34 | 2019-10-09 13:29:16 +0100 | [diff] [blame] | 98 | } |
| 99 | |
| 100 | cc_library_headers { |
| 101 | name: "libnativeloader-headers", |
| Jiyong Park | 71f661c | 2020-04-28 18:20:43 +0900 | [diff] [blame] | 102 | apex_available: [ |
| 103 | "//apex_available:platform", |
| Martin Stjernholm | 3e9abfc | 2020-10-09 22:17:51 +0100 | [diff] [blame] | 104 | "com.android.art", |
| Jiyong Park | 71f661c | 2020-04-28 18:20:43 +0900 | [diff] [blame] | 105 | "com.android.art.debug", |
| Martin Stjernholm | 694f012 | 2020-10-30 02:23:24 +0000 | [diff] [blame] | 106 | "com.android.media", |
| Jiyong Park | 71f661c | 2020-04-28 18:20:43 +0900 | [diff] [blame] | 107 | ], |
| Orion Hodson | c78860b | 2019-10-11 11:30:01 +0100 | [diff] [blame] | 108 | visibility: [ |
| Martin Stjernholm | 3bb009a | 2019-10-17 21:29:01 +0100 | [diff] [blame] | 109 | "//art:__subpackages__", |
| 110 | // TODO(b/133140750): Clean this up. |
| Orion Hodson | c78860b | 2019-10-11 11:30:01 +0100 | [diff] [blame] | 111 | "//frameworks/av/media/libstagefright", |
| 112 | "//frameworks/native/libs/graphicsenv", |
| 113 | "//frameworks/native/vulkan/libvulkan", |
| 114 | ], |
| Orion Hodson | 9b16e34 | 2019-10-09 13:29:16 +0100 | [diff] [blame] | 115 | host_supported: true, |
| 116 | export_include_dirs: ["include"], |
| Orion Hodson | 00cb81d | 2020-04-03 06:47:07 +0100 | [diff] [blame] | 117 | header_libs: ["jni_headers"], |
| 118 | export_header_lib_headers: ["jni_headers"], |
| Orion Hodson | 9b16e34 | 2019-10-09 13:29:16 +0100 | [diff] [blame] | 119 | } |
| 120 | |
| Martin Stjernholm | b309240 | 2020-09-04 00:49:44 +0100 | [diff] [blame] | 121 | art_cc_test { |
| Orion Hodson | 9b16e34 | 2019-10-09 13:29:16 +0100 | [diff] [blame] | 122 | name: "libnativeloader_test", |
| 123 | srcs: [ |
| 124 | "native_loader_test.cpp", |
| 125 | "native_loader.cpp", |
| 126 | "library_namespaces.cpp", |
| 127 | "native_loader_namespace.cpp", |
| 128 | "public_libraries.cpp", |
| 129 | ], |
| 130 | cflags: ["-DANDROID"], |
| 131 | static_libs: [ |
| 132 | "libbase", |
| 133 | "liblog", |
| Orion Hodson | 9b16e34 | 2019-10-09 13:29:16 +0100 | [diff] [blame] | 134 | "libgmock", |
| Justin Yun | 3db26d5 | 2019-12-16 14:09:39 +0900 | [diff] [blame] | 135 | "PlatformProperties", |
| Orion Hodson | 9b16e34 | 2019-10-09 13:29:16 +0100 | [diff] [blame] | 136 | ], |
| 137 | header_libs: [ |
| 138 | "libnativebridge-headers", |
| Orion Hodson | 6dc0a43 | 2020-02-06 14:28:28 +0000 | [diff] [blame] | 139 | "libnativehelper_header_only", |
| Orion Hodson | 9b16e34 | 2019-10-09 13:29:16 +0100 | [diff] [blame] | 140 | "libnativeloader-headers", |
| 141 | ], |
| Orion Hodson | 4346499 | 2019-10-11 11:10:03 +0100 | [diff] [blame] | 142 | // native_loader_test.cpp mocks libdl APIs so system_shared_libs |
| 143 | // are used to include C libraries without libdl. |
| Orion Hodson | 9b16e34 | 2019-10-09 13:29:16 +0100 | [diff] [blame] | 144 | system_shared_libs: [ |
| 145 | "libc", |
| 146 | "libm", |
| 147 | ], |
| 148 | test_suites: ["device-tests"], |
| 149 | } |