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 "-fexceptions", 44 "-Wno-error=unused-parameter", 45 ], 46 static_libs: [ 47 "libbpf", 48 "libdw", 49 "libelf", 50 "libicuuc", 51 "libicuuc_stubdata", 52 "libjemalloc5", 53 "libprotobuf-cpp-full", 54 "libxml2", 55 ], 56 compile_multilib: "64", 57 target: { 58 darwin: { 59 enabled: false, 60 }, 61 }, 62 // TODO(b/324274771): figure out a better solution 63 native_coverage: false, 64} 65 66cc_library_host_static { 67 name: "libstg", 68 defaults: ["defaults"], 69 srcs: [ 70 "abigail_reader.cc", 71 "btf_reader.cc", 72 "comparison.cc", 73 "deduplication.cc", 74 "dwarf_processor.cc", 75 "dwarf_wrappers.cc", 76 "elf_dwarf_handle.cc", 77 "elf_loader.cc", 78 "elf_reader.cc", 79 "fidelity.cc", 80 "file_descriptor.cc", 81 "filter.cc", 82 "fingerprint.cc", 83 "graph.cc", 84 "input.cc", 85 "naming.cc", 86 "post_processing.cc", 87 "proto_reader.cc", 88 "proto_writer.cc", 89 "reporting.cc", 90 "runtime.cc", 91 "stable_hash.cc", 92 "stg.proto", 93 "type_normalisation.cc", 94 "type_resolution.cc", 95 "unification.cc", 96 ], 97 proto: { 98 export_proto_headers: true, 99 }, 100 101} 102 103cc_binary_host { 104 name: "stg", 105 defaults: ["defaults"], 106 srcs: [ 107 "stg.cc", 108 ], 109 static_libs: ["libstg"], 110} 111 112cc_binary_host { 113 name: "stgdiff", 114 defaults: ["defaults"], 115 srcs: [ 116 "stgdiff.cc", 117 ], 118 static_libs: ["libstg"], 119} 120