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 | a55c49f | 2020-06-23 11:05:49 +0200 | [diff] [blame] | 65 | ], |
Matthias Maennich | f267989 | 2020-07-14 09:41:44 +0200 | [diff] [blame] | 66 | } |
| 67 | |
| 68 | cc_library { |
| 69 | name: "libelf", |
| 70 | host_supported: true, |
| 71 | vendor_available: true, |
| 72 | defaults: ["elfutils_defaults"], |
| 73 | |
| 74 | srcs: ["libelf/*.c",], |
| 75 | |
| 76 | static_libs: ["libz"], |
| 77 | |
| 78 | export_include_dirs: ["libelf"], |
| 79 | |
| 80 | target: { |
| 81 | darwin: { |
| 82 | enabled: false, |
| 83 | }, |
| 84 | android: { |
| 85 | cflags: [ |
| 86 | "-D_FILE_OFFSET_BITS=64", |
| 87 | "-include AndroidFixup.h", |
| 88 | ], |
| 89 | shared: { |
| 90 | enabled: false, |
| 91 | }, |
| 92 | }, |
| 93 | }, |
| 94 | |
| 95 | visibility: [ |
| 96 | "//device/google/contexthub/util/nanoapp_postprocess", |
| 97 | "//external/igt-gpu-tools", |
| 98 | "//external/mesa3d", |
| 99 | ], |
| 100 | } |
| 101 | |
Alistair Strachan | 4f03eb5 | 2019-05-21 15:40:17 -0700 | [diff] [blame] | 102 | cc_library_headers { |
| 103 | name: "elfutils_headers", |
Colin Cross | 25c1a40 | 2016-07-13 14:00:38 -0700 | [diff] [blame] | 104 | host_supported: true, |
Logan Chien | ffab4d1 | 2018-03-08 15:50:02 +0800 | [diff] [blame] | 105 | vendor_available: true, |
Colin Cross | 25c1a40 | 2016-07-13 14:00:38 -0700 | [diff] [blame] | 106 | export_include_dirs: [ |
| 107 | ".", |
Alistair Strachan | 4f03eb5 | 2019-05-21 15:40:17 -0700 | [diff] [blame] | 108 | "include", |
Colin Cross | 25c1a40 | 2016-07-13 14:00:38 -0700 | [diff] [blame] | 109 | "lib", |
| 110 | ], |
| 111 | target: { |
| 112 | android: { |
| 113 | export_include_dirs: ["bionic-fixup"], |
| 114 | }, |
| 115 | }, |
Elliott Hughes | eb552b6 | 2019-05-02 14:35:41 -0700 | [diff] [blame] | 116 | visibility: [":__subpackages__"], |
Colin Cross | 25c1a40 | 2016-07-13 14:00:38 -0700 | [diff] [blame] | 117 | } |
| 118 | |
Matthias Maennich | a55c49f | 2020-06-23 11:05:49 +0200 | [diff] [blame] | 119 | cc_library_host_static { |
| 120 | name: "libdw", |
| 121 | defaults: ["elfutils_defaults"], |
Ivan Lozano | 9ae4005 | 2020-09-22 09:04:49 -0400 | [diff] [blame] | 122 | target: { |
| 123 | darwin: { |
| 124 | enabled: false, |
| 125 | }, |
| 126 | }, |
Matthias Maennich | a55c49f | 2020-06-23 11:05:49 +0200 | [diff] [blame] | 127 | srcs: [ |
| 128 | "backends/*.c", |
| 129 | "libcpu/*_disasm.c", |
| 130 | "libdw/*.c", |
| 131 | "libdwelf/*.c", |
| 132 | "libdwfl/*.c", |
| 133 | "libebl/*.c", |
| 134 | ], |
| 135 | generated_headers: [ |
| 136 | "i386_dis", |
| 137 | "i386_mnemonics", |
| 138 | "x86_64_dis", |
| 139 | "x86_64_mnemonics", |
| 140 | ], |
| 141 | exclude_srcs: [ |
| 142 | // Do not enabled compression support |
| 143 | "libdwfl/bzip2.c", |
| 144 | "libdwfl/lzma.c", |
Haibo Huang | c233cc1 | 2020-11-02 18:44:18 -0800 | [diff] [blame] | 145 | "libdwfl/zstd.c", |
Matthias Maennich | a55c49f | 2020-06-23 11:05:49 +0200 | [diff] [blame] | 146 | // Those headers are incompatible with clang due to nested function |
| 147 | // definitions. |
| 148 | "libdwfl/dwfl_segment_report_module.c", |
Matthias Maennich | fde31c0 | 2021-02-16 21:02:29 +0000 | [diff] [blame] | 149 | "libdwfl/debuginfod-client.c", |
Matthias Maennich | a55c49f | 2020-06-23 11:05:49 +0200 | [diff] [blame] | 150 | "libdwfl/elf-from-memory.c", |
| 151 | "libdwfl/link_map.c", |
| 152 | // Those are common source files actually used as headers and not |
| 153 | // compiled standalone. |
| 154 | "backends/common-reloc.c", |
| 155 | "backends/linux-core-note.c", |
| 156 | "backends/x86_corenote.c", |
| 157 | ], |
| 158 | local_include_dirs: [ |
| 159 | "libcpu", |
| 160 | "libasm", |
| 161 | "libdwelf", |
| 162 | "libdwfl", |
| 163 | "libebl", |
| 164 | ], |
| 165 | export_include_dirs: [ |
| 166 | "libdw", |
| 167 | ], |
| 168 | static_libs: [ |
| 169 | "libelf" |
| 170 | ], |
| 171 | compile_multilib: "64", |
| 172 | } |