| // Copyright (C) 2013 The Android Open Source Project | |
| // | |
| // Licensed under the Apache License, Version 2.0 (the "License"); | |
| // you may not use this file except in compliance with the License. | |
| // You may obtain a copy of the License at | |
| // | |
| // http://www.apache.org/licenses/LICENSE-2.0 | |
| // | |
| // Unless required by applicable law or agreed to in writing, software | |
| // distributed under the License is distributed on an "AS IS" BASIS, | |
| // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| // See the License for the specific language governing permissions and | |
| // limitations under the License. | |
| // *** THIS PACKAGE HAS SPECIAL LICENSING CONDITIONS. PLEASE | |
| // CONSULT THE OWNERS AND opensource-licensing@google.com BEFORE | |
| // DEPENDING ON IT IN YOUR PROJECT. *** | |
| package { | |
| default_applicable_licenses: ["external_elfutils_license"], | |
| } | |
| // http://go/android-license-faq | |
| license { | |
| name: "external_elfutils_license", | |
| visibility: [":__subpackages__"], | |
| license_kinds: [ | |
| "SPDX-license-identifier-Apache-2.0", | |
| "SPDX-license-identifier-BSD", | |
| "SPDX-license-identifier-GFDL", // by exception only | |
| "SPDX-license-identifier-GPL-2.0-or-later", | |
| "SPDX-license-identifier-GPL-3.0-or-later", | |
| "SPDX-license-identifier-LGPL-3.0-or-later", | |
| ], | |
| license_text: [ | |
| "COPYING", | |
| "COPYING-GPLV2", | |
| "COPYING-LGPLV3", | |
| "NOTICE", | |
| ], | |
| } | |
| // Properties to apply to all static libraries that use elfutils. | |
| // Soong doesn't have propagation for static library dependencies, | |
| // and this have to be included explicitly by elfutils users. | |
| cc_defaults { | |
| name: "elfutils_transitive_defaults", | |
| target: { | |
| android: { | |
| static_libs: [ | |
| "libzstd", | |
| ], | |
| shared_libs: [ | |
| "libz", | |
| ], | |
| }, | |
| host: { | |
| static_libs: [ | |
| "libz", | |
| "libzstd", | |
| ], | |
| }, | |
| }, | |
| } | |
| cc_defaults { | |
| name: "elfutils_defaults", | |
| defaults: ["elfutils_transitive_defaults"], | |
| cflags: [ | |
| "-DHAVE_CONFIG_H", | |
| "-D_GNU_SOURCE", | |
| // upper bound for the number of lines of the resulting mnemonic files | |
| "-DNMNES=1000", | |
| "-std=gnu99", | |
| "-Werror", | |
| // to suppress the "pointer of type ‘void *’ used in arithmetic" warning | |
| "-Wno-pointer-arith", | |
| "-Wno-typedef-redefinition", | |
| ], | |
| header_libs: [ | |
| "elfutils_headers", | |
| ], | |
| export_header_lib_headers: ["elfutils_headers"], | |
| visibility: [ | |
| "//external/dwarves:__subpackages__", | |
| "//external/elfutils:__subpackages__", | |
| "//external/libabigail:__subpackages__", | |
| "//external/libbpf:__subpackages__", | |
| "//external/stg:__subpackages__", | |
| ], | |
| } | |
| cc_library { | |
| name: "libelf", | |
| host_supported: true, | |
| native_bridge_supported: true, | |
| vendor_available: true, | |
| defaults: ["elfutils_defaults"], | |
| srcs: ["libelf/*.c"], | |
| export_include_dirs: ["libelf"], | |
| whole_static_libs: [ | |
| "libeu", | |
| ], | |
| target: { | |
| darwin: { | |
| enabled: false, | |
| }, | |
| android: { | |
| cflags: [ | |
| "-D_FILE_OFFSET_BITS=64", | |
| "-include AndroidFixup.h", | |
| ], | |
| shared: { | |
| enabled: false, | |
| }, | |
| }, | |
| musl: { | |
| cflags: [ | |
| "-include AndroidFixup.h", | |
| ], | |
| }, | |
| }, | |
| visibility: [ | |
| "//art:__subpackages__", // For use in tests only. | |
| "//device/google/contexthub/util/nanoapp_postprocess", | |
| "//external/bcc/libbpf-tools", | |
| "//external/bpftool", | |
| "//external/igt-gpu-tools", | |
| "//external/mesa3d", | |
| "//packages/modules/Connectivity/bpf/loader", // For standalone 'netbpfloader' cli test util | |
| ], | |
| apex_available: [ | |
| "//apex_available:platform", | |
| "com.android.tethering", // For standalone bpf loader binary that depends on libbpf. | |
| ], | |
| min_sdk_version: "apex_inherit", | |
| } | |
| cc_library_headers { | |
| name: "elfutils_headers", | |
| host_supported: true, | |
| native_bridge_supported: true, | |
| vendor_available: true, | |
| export_include_dirs: [ | |
| ".", | |
| "include", | |
| "lib", | |
| ], | |
| target: { | |
| android: { | |
| export_include_dirs: ["bionic-fixup"], | |
| }, | |
| musl: { | |
| export_include_dirs: ["bionic-fixup"], | |
| }, | |
| }, | |
| visibility: [":__subpackages__"], | |
| apex_available: [ | |
| "//apex_available:platform", | |
| "com.android.tethering", // For standalone bpf loader binary that depends on libbpf. | |
| ], | |
| min_sdk_version: "apex_inherit", | |
| } | |
| cc_library { | |
| name: "libdw", | |
| host_supported: true, | |
| device_supported: false, | |
| defaults: ["elfutils_defaults"], | |
| target: { | |
| darwin: { | |
| enabled: false, | |
| }, | |
| musl: { | |
| static_libs: [ | |
| "libfts", | |
| ], | |
| }, | |
| }, | |
| srcs: [ | |
| "backends/*.c", | |
| "libcpu/*_disasm.c", | |
| "libdw/*.c", | |
| "libdwelf/*.c", | |
| "libdwfl/*.c", | |
| "libdwfl_stacktrace/*.c", | |
| "libebl/*.c", | |
| ], | |
| generated_headers: [ | |
| "i386_dis", | |
| "i386_mnemonics", | |
| "x86_64_dis", | |
| "x86_64_mnemonics", | |
| ], | |
| exclude_srcs: [ | |
| // Do not enabled compression support | |
| "libdwfl/bzip2.c", | |
| "libdwfl/lzma.c", | |
| // These depend on argp which doesn't exist in musl | |
| "libdwfl/argp-std.c", | |
| // Those are common source files actually used as headers and not | |
| // compiled standalone. | |
| "backends/common-reloc.c", | |
| "backends/linux-core-note.c", | |
| "backends/linux-perf-regs.c", | |
| "backends/x86_corenote.c", | |
| "backends/x86_initreg_sample.c", | |
| ], | |
| local_include_dirs: [ | |
| "libcpu", | |
| "libasm", | |
| "libdwelf", | |
| "libdwfl", | |
| "libdwfl_stacktrace", | |
| "libebl", | |
| ], | |
| export_include_dirs: [ | |
| "libdw", | |
| ], | |
| static_libs: [ | |
| "libelf", | |
| ], | |
| whole_static_libs: [ | |
| "libeu", | |
| ], | |
| compile_multilib: "64", | |
| } |