1// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 2// 3// Copyright 2021 Google LLC 4// 5// Licensed under the Apache License v2.0 with LLVM Exceptions (the 6// "License"); you may not use this file except in compliance with the 7// License. You may obtain a copy of the License at 8// 9// https://llvm.org/LICENSE.txt 10// 11// Unless required by applicable law or agreed to in writing, software 12// distributed under the License is distributed on an "AS IS" BASIS, 13// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14// See the License for the specific language governing permissions and 15// limitations under the License. 16// 17// Author: Giuliano Procida 18 19package { 20 default_applicable_licenses: ["llvm_license"], 21} 22 23// http://go/android-license-faq 24license { 25 name: "llvm_license", 26 visibility: [":__subpackages__"], 27 license_kinds: [ 28 "SPDX-license-identifier-Apache-2.0", 29 ], 30 license_text: [ 31 "LICENSE", 32 ], 33} 34 35cc_defaults { 36 name: "defaults", 37 defaults: ["elfutils_transitive_defaults"], 38 visibility: [ 39 "//visibility:private", 40 ], 41 cpp_std: "c++20", 42 cflags: [ 43 "-DUSE_ANDROID_BUILD_NUMBER", 44 "-fexceptions", 45 "-Wno-error=unused-parameter", 46 ], 47 static_libs: [ 48 "libbpf", 49 "libbuildversion", 50 "libdw", 51 "libelf", 52 "libicuuc", 53 "libicuuc_stubdata", 54 "libjemalloc5", 55 "libprotobuf-cpp-full", 56 "libxml2", 57 ], 58 compile_multilib: "64", 59 target: { 60 darwin: { 61 enabled: false, 62 }, 63 }, 64 // TODO(b/324274771): figure out a better solution 65 native_coverage: false, 66} 67 68cc_library_host_static { 69 name: "libstg", 70 defaults: ["defaults"], 71 srcs: [ 72 "abigail_reader.cc", 73 "btf_reader.cc", 74 "comparison.cc", 75 "deduplication.cc", 76 "dwarf_processor.cc", 77 "dwarf_wrappers.cc", 78 "elf_loader.cc", 79 "elf_reader.cc", 80 "fidelity.cc", 81 "file_descriptor.cc", 82 "filter.cc", 83 "fingerprint.cc", 84 "graph.cc", 85 "input.cc", 86 "naming.cc", 87 "post_processing.cc", 88 "proto_reader.cc", 89 "proto_writer.cc", 90 "reporting.cc", 91 "runtime.cc", 92 "stable_hash.cc", 93 "stg.proto", 94 "type_normalisation.cc", 95 "type_resolution.cc", 96 "unification.cc", 97 ], 98 proto: { 99 export_proto_headers: true, 100 }, 101 102} 103 104cc_binary_host { 105 name: "stg", 106 defaults: ["defaults"], 107 srcs: [ 108 "stg.cc", 109 ], 110 static_libs: ["libstg"], 111} 112 113cc_binary_host { 114 name: "stgdiff", 115 defaults: ["defaults"], 116 srcs: [ 117 "stgdiff.cc", 118 ], 119 static_libs: ["libstg"], 120} 121