xref: /aosp_15_r20/external/xz-embedded/Android.bp (revision d2c16535d139cb185e89120452531bba6b36d3c6)
1package {
2    default_applicable_licenses: ["external_xz-embedded_license"],
3}
4
5// Added automatically by a large-scale-change
6// See: http://go/android-license-faq
7license {
8    name: "external_xz-embedded_license",
9    visibility: [":__subpackages__"],
10    license_kinds: [
11        "legacy_unencumbered",
12    ],
13    license_text: [
14        "COPYING",
15    ],
16}
17
18cc_library_static {
19    name: "libxz",
20    host_supported: true,
21    ramdisk_available: true,
22    vendor_ramdisk_available: true,
23    recovery_available: true,
24    visibility: [
25        "//system/update_engine:__subpackages__",
26        "//tools/security/fuzzing/llm/xz_fuzzer:__subpackages__",
27    ],
28    srcs: [
29        "linux/lib/xz/xz_crc32.c",
30        "linux/lib/xz/xz_dec_bcj.c",
31        "linux/lib/xz/xz_dec_lzma2.c",
32        "linux/lib/xz/xz_dec_stream.c",
33    ],
34    local_include_dirs: ["userspace"],
35
36    // We shouldn't enable branch/call/jump filters because they have no impact
37    // on Android OTA sizes (measured in http://b/329112384) --- the frequent
38    // function calls that this optimization is supposed to apply to will all go
39    // via the PLT, so the actual branch/call/jump instructions in the ELF file
40    // will be zeroed out anyway.
41    // Unfortunately, as long as we need to support decompressing _existing_
42    // OTA packages, we need to keep these in (but it's not worth adding new
43    // ones).
44    cflags: [
45        "-DXZ_DEC_X86",
46        "-DXZ_DEC_ARM",
47        "-DXZ_DEC_ARMTHUMB",
48        "-Wall",
49        "-Werror",
50    ],
51
52    export_include_dirs: ["linux/include/linux/"],
53}
54