1// Copyright (C) 2023 The Android Open Source Project 2// 3// Licensed under the Apache License, Version 2.0 (the "License"); 4// you may not use this file except in compliance with the License. 5// You may obtain a copy of the License at 6// 7// http://www.apache.org/licenses/LICENSE-2.0 8// 9// Unless required by applicable law or agreed to in writing, software 10// distributed under the License is distributed on an "AS IS" BASIS, 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12// See the License for the specific language governing permissions and 13// limitations under the License. 14// 15 16package { 17 default_applicable_licenses: ["Android-Apache-2.0"], 18} 19 20cc_library_headers { 21 name: "libberberis_runtime_headers", 22 defaults: ["berberis_defaults"], 23 host_supported: true, 24 export_include_dirs: ["include"], 25} 26 27filegroup { 28 name: "berberis_runtime_library_x86_64_srcs", 29 srcs: [ 30 "runtime_library_x86_64.cc", 31 ], 32} 33 34cc_defaults { 35 name: "berberis_runtime_library_x86_64_defaults", 36 arch: { 37 x86_64: { 38 srcs: [":berberis_runtime_library_x86_64_srcs"], 39 header_libs: [ 40 "libberberis_base_headers", 41 "libberberis_runtime_primitives_headers", 42 ], 43 }, 44 }, 45 // Targets using these defaults must provide the following guest-specific fields: 46 // header_libs: ["libberberis_guest_state_<guest>_headers"], 47 // export_header_lib_headers: ["libberberis_guest_state_<guest>_headers"], 48} 49 50cc_library_static { 51 name: "libberberis_runtime_riscv64_to_x86_64", 52 defaults: [ 53 "berberis_defaults_64", 54 "berberis_runtime_library_x86_64_defaults", 55 ], 56 host_supported: true, 57 srcs: [ 58 "init_guest_arch.cc", 59 "run_guest_call_riscv64.cc", 60 "translator_riscv64.cc", 61 ], 62 whole_static_libs: ["libberberis_runtime"], 63 header_libs: [ 64 "libberberis_base_headers", 65 "libberberis_calling_conventions_headers", 66 "libberberis_guest_abi_riscv64_headers", 67 "libberberis_guest_os_primitives_headers", 68 "libberberis_guest_state_riscv64_headers", 69 "libberberis_heavy_optimizer_riscv64_headers", 70 "libberberis_instrument_headers", 71 "libberberis_interpreter_riscv64_headers", 72 "libberberis_lite_translator_headers", 73 "libberberis_runtime_headers", 74 "libberberis_runtime_primitives_headers", 75 ], 76 export_header_lib_headers: [ 77 "libberberis_runtime_headers", 78 ], 79} 80 81cc_library_static { 82 name: "libberberis_runtime", 83 defaults: ["berberis_defaults"], 84 host_supported: true, 85 header_libs: [ 86 "libberberis_base_headers", 87 "libberberis_guest_state_headers", 88 "libberberis_guest_os_primitives_headers", 89 "libberberis_runtime_headers", 90 "libberberis_runtime_primitives_headers", 91 ], 92 export_header_lib_headers: [ 93 "libberberis_runtime_headers", 94 ], 95 srcs: [ 96 "berberis.cc", 97 "execute_guest.cc", 98 "execute_guest_call.cc", 99 "runtime_library.cc", 100 "translator.cc", 101 ], 102} 103 104cc_test_library { 105 name: "libberberis_runtime_riscv64_unit_tests", 106 defaults: ["berberis_test_library_defaults_64"], 107 srcs: [ 108 "execute_guest_test.cc", 109 "translator_riscv64_test.cc", 110 ], 111 header_libs: [ 112 "libberberis_base_headers", 113 "libberberis_guest_state_riscv64_headers", 114 "libberberis_runtime_headers", 115 "libberberis_guest_os_primitives_headers", 116 "libberberis_lite_translator_headers", 117 "libberberis_runtime_primitives_headers", 118 ], 119} 120