1// 2// Copyright (C) 2020 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 17package { 18 default_applicable_licenses: ["Android-Apache-2.0"], 19} 20 21cc_library_headers { 22 name: "native_bridge_guest_linker_headers", 23 export_include_dirs: ["include"], 24 host_supported: true, 25 native_bridge_supported: true, 26} 27 28cc_binary { 29 name: "native_bridge_guest_linker", 30 overrides: ["linker"], 31 stem: "linker", 32 defaults: ["linker_bin_template"], 33 srcs: [ 34 "__libc_init_main_thread.cpp", 35 "linker_tls.cpp", 36 "linker_translate_path.cpp", 37 ], 38 39 include_dirs: [ 40 "bionic/linker", 41 ], 42 43 enabled: false, 44 target: { 45 native_bridge: { 46 enabled: true, 47 } 48 }, 49 arch: { 50 arm: { 51 srcs: ["init_static_tls_arm.S"], 52 version_script: "linker.arm.map", 53 }, 54 arm64: { 55 srcs: ["init_static_tls_arm64.S"], 56 version_script: "linker.generic.map", 57 }, 58 }, 59 60 cflags: [ 61 // TODO(b/133135269): workaround to skip hardcoded 'bootstrap' directory from guest library search. 62 // See https://android-review.googlesource.com/c/platform/bionic/+/954353/7/linker/linker.cpp#1165 63 "-D__ANDROID_APEX__=native_bridge_apex", 64 ], 65 66 header_libs: ["native_bridge_guest_linker_headers"], 67 68 native_bridge_supported: true, 69 70 multilib: { 71 lib64: { 72 suffix: "64", 73 }, 74 }, 75 76 compile_multilib: "both", 77 78 static_libs: ["liblinker_debuggerd_stub"], 79} 80