1// Copyright (C) 2013 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// *** THIS PACKAGE HAS SPECIAL LICENSING CONDITIONS. PLEASE 16// CONSULT THE OWNERS AND [email protected] BEFORE 17// DEPENDING ON IT IN YOUR PROJECT. *** 18package { 19 default_applicable_licenses: ["external_elfutils_license"], 20} 21 22// http://go/android-license-faq 23license { 24 name: "external_elfutils_license", 25 visibility: [":__subpackages__"], 26 license_kinds: [ 27 "SPDX-license-identifier-Apache-2.0", 28 "SPDX-license-identifier-BSD", 29 "SPDX-license-identifier-GFDL", // by exception only 30 "SPDX-license-identifier-GPL-2.0-or-later", 31 "SPDX-license-identifier-GPL-3.0-or-later", 32 "SPDX-license-identifier-LGPL-3.0-or-later", 33 ], 34 license_text: [ 35 "COPYING", 36 "COPYING-GPLV2", 37 "COPYING-LGPLV3", 38 "NOTICE", 39 ], 40} 41 42// Properties to apply to all static libraries that use elfutils. 43// Soong doesn't have propagation for static library dependencies, 44// and this have to be included explicitly by elfutils users. 45cc_defaults { 46 name: "elfutils_transitive_defaults", 47 static_libs: [ 48 "libz", 49 "libzstd", 50 ], 51} 52 53cc_defaults { 54 name: "elfutils_defaults", 55 defaults: ["elfutils_transitive_defaults"], 56 cflags: [ 57 "-DHAVE_CONFIG_H", 58 "-D_GNU_SOURCE", 59 // upper bound for the number of lines of the resulting mnemonic files 60 "-DNMNES=1000", 61 "-std=gnu99", 62 "-Werror", 63 // to suppress the "pointer of type ‘void *’ used in arithmetic" warning 64 "-Wno-pointer-arith", 65 "-Wno-typedef-redefinition", 66 ], 67 header_libs: [ 68 "elfutils_headers", 69 ], 70 export_header_lib_headers: ["elfutils_headers"], 71 72 visibility: [ 73 "//external/dwarves:__subpackages__", 74 "//external/elfutils:__subpackages__", 75 "//external/libabigail:__subpackages__", 76 "//external/libbpf:__subpackages__", 77 "//external/stg:__subpackages__", 78 ], 79} 80 81cc_library { 82 name: "libelf", 83 host_supported: true, 84 native_bridge_supported: true, 85 vendor_available: true, 86 defaults: ["elfutils_defaults"], 87 88 srcs: ["libelf/*.c"], 89 90 export_include_dirs: ["libelf"], 91 92 target: { 93 darwin: { 94 enabled: false, 95 }, 96 android: { 97 cflags: [ 98 "-D_FILE_OFFSET_BITS=64", 99 "-include AndroidFixup.h", 100 ], 101 shared: { 102 enabled: false, 103 }, 104 }, 105 musl: { 106 cflags: [ 107 "-include AndroidFixup.h", 108 ], 109 }, 110 }, 111 112 visibility: [ 113 "//art:__subpackages__", // For use in tests only. 114 "//device/google/contexthub/util/nanoapp_postprocess", 115 "//external/bcc/libbpf-tools", 116 "//external/bpftool", 117 "//external/igt-gpu-tools", 118 "//external/mesa3d", 119 ], 120} 121 122cc_library_headers { 123 name: "elfutils_headers", 124 host_supported: true, 125 native_bridge_supported: true, 126 vendor_available: true, 127 export_include_dirs: [ 128 ".", 129 "include", 130 "lib", 131 ], 132 target: { 133 android: { 134 export_include_dirs: ["bionic-fixup"], 135 }, 136 musl: { 137 export_include_dirs: ["bionic-fixup"], 138 }, 139 }, 140 visibility: [":__subpackages__"], 141} 142 143cc_library { 144 name: "libdw", 145 host_supported: true, 146 device_supported: false, 147 defaults: ["elfutils_defaults"], 148 target: { 149 darwin: { 150 enabled: false, 151 }, 152 musl: { 153 static_libs: [ 154 "libfts", 155 ], 156 }, 157 }, 158 srcs: [ 159 "backends/*.c", 160 "libcpu/*_disasm.c", 161 "libdw/*.c", 162 "libdwelf/*.c", 163 "libdwfl/*.c", 164 "libebl/*.c", 165 ], 166 generated_headers: [ 167 "i386_dis", 168 "i386_mnemonics", 169 "x86_64_dis", 170 "x86_64_mnemonics", 171 ], 172 exclude_srcs: [ 173 // Do not enabled compression support 174 "libdwfl/bzip2.c", 175 "libdwfl/lzma.c", 176 // These depend on argp which doesn't exist in musl 177 "libdwfl/argp-std.c", 178 // Those are common source files actually used as headers and not 179 // compiled standalone. 180 "backends/common-reloc.c", 181 "backends/linux-core-note.c", 182 "backends/x86_corenote.c", 183 ], 184 local_include_dirs: [ 185 "libcpu", 186 "libasm", 187 "libdwelf", 188 "libdwfl", 189 "libebl", 190 ], 191 export_include_dirs: [ 192 "libdw", 193 ], 194 static_libs: [ 195 "libelf", 196 ], 197 whole_static_libs: [ 198 "libeu", 199 ], 200 compile_multilib: "64", 201} 202