Matthias Maennich | f267989 | 2020-07-14 09:41:44 +0200 | [diff] [blame] | 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 | |
Bob Badour | ceeee15 | 2021-02-03 17:32:49 -0800 | [diff] [blame] | 15 | // *** THIS PACKAGE HAS SPECIAL LICENSING CONDITIONS. PLEASE |
| 16 | // CONSULT THE OWNERS AND opensource-licensing@google.com BEFORE |
| 17 | // DEPENDING ON IT IN YOUR PROJECT. *** |
| 18 | package { |
| 19 | default_applicable_licenses: ["external_elfutils_license"], |
| 20 | } |
| 21 | |
| 22 | // http://go/android-license-faq |
| 23 | license { |
| 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 | |
Matthias Maennich | f267989 | 2020-07-14 09:41:44 +0200 | [diff] [blame] | 42 | cc_defaults { |
| 43 | name: "elfutils_defaults", |
| 44 | cflags: [ |
| 45 | "-DHAVE_CONFIG_H", |
| 46 | "-D_GNU_SOURCE", |
Matthias Maennich | a55c49f | 2020-06-23 11:05:49 +0200 | [diff] [blame] | 47 | // upper bound for the number of lines of the resulting mnemonic files |
| 48 | "-DNMNES=1000", |
Matthias Maennich | f267989 | 2020-07-14 09:41:44 +0200 | [diff] [blame] | 49 | "-std=gnu99", |
| 50 | "-Werror", |
| 51 | // to suppress the "pointer of type ‘void *’ used in arithmetic" warning |
| 52 | "-Wno-pointer-arith", |
| 53 | "-Wno-typedef-redefinition", |
| 54 | ], |
| 55 | header_libs: [ |
| 56 | "elfutils_headers", |
| 57 | ], |
| 58 | export_header_lib_headers: ["elfutils_headers"], |
Matthias Maennich | a55c49f | 2020-06-23 11:05:49 +0200 | [diff] [blame] | 59 | |
| 60 | visibility: [ |
| 61 | "//external/dwarves:__subpackages__", |
| 62 | "//external/elfutils:__subpackages__", |
Matthias Maennich | 2b85217 | 2020-07-11 23:07:18 +0200 | [diff] [blame] | 63 | "//external/libabigail:__subpackages__", |
Matthias Maennich | 2ba3412 | 2021-01-18 14:43:56 +0000 | [diff] [blame] | 64 | "//external/libbpf:__subpackages__", |
Matthias Maennich | 4bbc33d | 2021-11-16 11:23:02 +0000 | [diff] [blame] | 65 | "//external/stg:__subpackages__", |
Matthias Maennich | a55c49f | 2020-06-23 11:05:49 +0200 | [diff] [blame] | 66 | ], |
Matthias Maennich | f267989 | 2020-07-14 09:41:44 +0200 | [diff] [blame] | 67 | } |
| 68 | |
| 69 | cc_library { |
| 70 | name: "libelf", |
| 71 | host_supported: true, |
| 72 | vendor_available: true, |
| 73 | defaults: ["elfutils_defaults"], |
| 74 | |
| 75 | srcs: ["libelf/*.c",], |
| 76 | |
| 77 | static_libs: ["libz"], |
| 78 | |
| 79 | export_include_dirs: ["libelf"], |
| 80 | |
| 81 | target: { |
| 82 | darwin: { |
| 83 | enabled: false, |
| 84 | }, |
| 85 | android: { |
| 86 | cflags: [ |
| 87 | "-D_FILE_OFFSET_BITS=64", |
| 88 | "-include AndroidFixup.h", |
| 89 | ], |
| 90 | shared: { |
| 91 | enabled: false, |
| 92 | }, |
| 93 | }, |
Colin Cross | 78268d7 | 2021-08-30 16:51:29 -0700 | [diff] [blame] | 94 | musl: { |
| 95 | cflags: [ |
| 96 | "-include AndroidFixup.h", |
| 97 | ], |
| 98 | }, |
Matthias Maennich | f267989 | 2020-07-14 09:41:44 +0200 | [diff] [blame] | 99 | }, |
| 100 | |
| 101 | visibility: [ |
| 102 | "//device/google/contexthub/util/nanoapp_postprocess", |
Connor O'Brien | 6b137d3 | 2022-02-01 12:45:13 -0800 | [diff] [blame] | 103 | "//external/bcc/libbpf-tools", |
Connor O'Brien | e0bcd74 | 2022-02-14 17:44:37 -0800 | [diff] [blame] | 104 | "//external/bpftool", |
Matthias Maennich | f267989 | 2020-07-14 09:41:44 +0200 | [diff] [blame] | 105 | "//external/igt-gpu-tools", |
| 106 | "//external/mesa3d", |
| 107 | ], |
| 108 | } |
| 109 | |
Alistair Strachan | 4f03eb5 | 2019-05-21 15:40:17 -0700 | [diff] [blame] | 110 | cc_library_headers { |
| 111 | name: "elfutils_headers", |
Colin Cross | 25c1a40 | 2016-07-13 14:00:38 -0700 | [diff] [blame] | 112 | host_supported: true, |
Logan Chien | ffab4d1 | 2018-03-08 15:50:02 +0800 | [diff] [blame] | 113 | vendor_available: true, |
Colin Cross | 25c1a40 | 2016-07-13 14:00:38 -0700 | [diff] [blame] | 114 | export_include_dirs: [ |
| 115 | ".", |
Alistair Strachan | 4f03eb5 | 2019-05-21 15:40:17 -0700 | [diff] [blame] | 116 | "include", |
Colin Cross | 25c1a40 | 2016-07-13 14:00:38 -0700 | [diff] [blame] | 117 | "lib", |
| 118 | ], |
| 119 | target: { |
| 120 | android: { |
| 121 | export_include_dirs: ["bionic-fixup"], |
| 122 | }, |
Colin Cross | 78268d7 | 2021-08-30 16:51:29 -0700 | [diff] [blame] | 123 | musl: { |
| 124 | export_include_dirs: ["bionic-fixup"], |
| 125 | }, |
Colin Cross | 25c1a40 | 2016-07-13 14:00:38 -0700 | [diff] [blame] | 126 | }, |
Elliott Hughes | eb552b6 | 2019-05-02 14:35:41 -0700 | [diff] [blame] | 127 | visibility: [":__subpackages__"], |
Colin Cross | 25c1a40 | 2016-07-13 14:00:38 -0700 | [diff] [blame] | 128 | } |
| 129 | |
Matthias Maennich | a55c49f | 2020-06-23 11:05:49 +0200 | [diff] [blame] | 130 | cc_library_host_static { |
| 131 | name: "libdw", |
| 132 | defaults: ["elfutils_defaults"], |
Ivan Lozano | 9ae4005 | 2020-09-22 09:04:49 -0400 | [diff] [blame] | 133 | target: { |
| 134 | darwin: { |
| 135 | enabled: false, |
| 136 | }, |
Colin Cross | 78268d7 | 2021-08-30 16:51:29 -0700 | [diff] [blame] | 137 | musl: { |
| 138 | static_libs: [ |
| 139 | "libfts", |
| 140 | "libz", |
| 141 | ], |
| 142 | }, |
Ivan Lozano | 9ae4005 | 2020-09-22 09:04:49 -0400 | [diff] [blame] | 143 | }, |
Matthias Maennich | a55c49f | 2020-06-23 11:05:49 +0200 | [diff] [blame] | 144 | srcs: [ |
| 145 | "backends/*.c", |
| 146 | "libcpu/*_disasm.c", |
| 147 | "libdw/*.c", |
| 148 | "libdwelf/*.c", |
| 149 | "libdwfl/*.c", |
| 150 | "libebl/*.c", |
| 151 | ], |
| 152 | generated_headers: [ |
| 153 | "i386_dis", |
| 154 | "i386_mnemonics", |
| 155 | "x86_64_dis", |
| 156 | "x86_64_mnemonics", |
| 157 | ], |
| 158 | exclude_srcs: [ |
| 159 | // Do not enabled compression support |
| 160 | "libdwfl/bzip2.c", |
| 161 | "libdwfl/lzma.c", |
Haibo Huang | c233cc1 | 2020-11-02 18:44:18 -0800 | [diff] [blame] | 162 | "libdwfl/zstd.c", |
Matthias Maennich | a55c49f | 2020-06-23 11:05:49 +0200 | [diff] [blame] | 163 | // Those headers are incompatible with clang due to nested function |
| 164 | // definitions. |
| 165 | "libdwfl/dwfl_segment_report_module.c", |
Matthias Maennich | fde31c0 | 2021-02-16 21:02:29 +0000 | [diff] [blame] | 166 | "libdwfl/debuginfod-client.c", |
Matthias Maennich | a55c49f | 2020-06-23 11:05:49 +0200 | [diff] [blame] | 167 | "libdwfl/elf-from-memory.c", |
| 168 | "libdwfl/link_map.c", |
Colin Cross | 78268d7 | 2021-08-30 16:51:29 -0700 | [diff] [blame] | 169 | // These depend on argp which doesn't exist in musl |
| 170 | "libdwfl/argp-std.c", |
Matthias Maennich | a55c49f | 2020-06-23 11:05:49 +0200 | [diff] [blame] | 171 | // Those are common source files actually used as headers and not |
| 172 | // compiled standalone. |
| 173 | "backends/common-reloc.c", |
| 174 | "backends/linux-core-note.c", |
| 175 | "backends/x86_corenote.c", |
| 176 | ], |
| 177 | local_include_dirs: [ |
| 178 | "libcpu", |
| 179 | "libasm", |
| 180 | "libdwelf", |
| 181 | "libdwfl", |
| 182 | "libebl", |
| 183 | ], |
| 184 | export_include_dirs: [ |
| 185 | "libdw", |
| 186 | ], |
| 187 | static_libs: [ |
| 188 | "libelf" |
| 189 | ], |
Colin Cross | 78268d7 | 2021-08-30 16:51:29 -0700 | [diff] [blame] | 190 | whole_static_libs: [ |
| 191 | "libeu", |
| 192 | ], |
Matthias Maennich | a55c49f | 2020-06-23 11:05:49 +0200 | [diff] [blame] | 193 | compile_multilib: "64", |
| 194 | } |