aboutsummaryrefslogtreecommitdiffstats
path: root/Android.bp
diff options
context:
space:
mode:
authorMatthias Maennich <maennich@google.com>2020-06-23 11:05:49 +0200
committerMatthias Maennich <maennich@google.com>2020-08-26 21:40:56 +0100
commitf95012c7844c6d5864e66c560acdb98ceef5060b (patch)
treedf2b5520a531308ceef412593119139eee7f883c /Android.bp
parent7023156a379099d3dd869ac15f596daf54db0871 (diff)
downloadplatform_external_elfutils-f95012c7844c6d5864e66c560acdb98ceef5060b.tar.gz
platform_external_elfutils-f95012c7844c6d5864e66c560acdb98ceef5060b.tar.bz2
platform_external_elfutils-f95012c7844c6d5864e66c560acdb98ceef5060b.zip
Add build description for libdw
This adds build description for more elfutils libraries in order support users that require libdw, such as pahole and libabigail. While the remaining libraries could be considered standalone, they are not really suitable to be built standalone in soong as they have circular dependencies and are usually anyway built as one unit. Hence only build libdw and include all libraries into it. This then works as an extension for libelf. The generated files in libcpu are now all generated from sources. No really significant generated file is now checked in. Left are config.h and version.h, which are generated at update time via post_update.sh. The build rules for the generated files have been reverse engineered from the autotools build. This mostly making m4, bison and flex work what we want them to, but builtin rules in soong made that possible without being overly verbose. An additional library - libeu - needed to be added as a generator dependency. In order to not overload the main Android.bp with all the little generator details, subpackages have been reintroduced and visibility adjusted accordingly. Bug: 159682555 Change-Id: Ie6f0713812f10b5b12f4e0bdfca27d0369bb71a4 Signed-off-by: Matthias Maennich <maennich@google.com>
Diffstat (limited to 'Android.bp')
-rw-r--r--Android.bp54
1 files changed, 54 insertions, 0 deletions
diff --git a/Android.bp b/Android.bp
index 992122f2..385004cf 100644
--- a/Android.bp
+++ b/Android.bp
@@ -17,6 +17,8 @@ cc_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
@@ -27,6 +29,11 @@ cc_defaults {
"elfutils_headers",
],
export_header_lib_headers: ["elfutils_headers"],
+
+ visibility: [
+ "//external/dwarves:__subpackages__",
+ "//external/elfutils:__subpackages__",
+ ],
}
cc_library {
@@ -80,3 +87,50 @@ cc_library_headers {
visibility: [":__subpackages__"],
}
+cc_library_host_static {
+ name: "libdw",
+ defaults: ["elfutils_defaults"],
+ srcs: [
+ "backends/*.c",
+ "libcpu/*_disasm.c",
+ "libdw/*.c",
+ "libdwelf/*.c",
+ "libdwfl/*.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",
+ // Those headers are incompatible with clang due to nested function
+ // definitions.
+ "libdwfl/dwfl_segment_report_module.c",
+ "libdwfl/elf-from-memory.c",
+ "libdwfl/link_map.c",
+ // Those are common source files actually used as headers and not
+ // compiled standalone.
+ "backends/common-reloc.c",
+ "backends/linux-core-note.c",
+ "backends/x86_corenote.c",
+ ],
+ local_include_dirs: [
+ "libcpu",
+ "libasm",
+ "libdwelf",
+ "libdwfl",
+ "libebl",
+ ],
+ export_include_dirs: [
+ "libdw",
+ ],
+ static_libs: [
+ "libelf"
+ ],
+}
+