summaryrefslogtreecommitdiff
path: root/system/build/Android.bp
blob: 52a5850179f4bccfa6362a0f562844613a7b3fda (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
package {
    // See: http://go/android-license-faq
    // A large-scale-change added 'default_applicable_licenses' to import
    // all of the 'license_kinds' from "system_bt_license"
    // to get the below license kinds:
    //   SPDX-license-identifier-Apache-2.0
    default_applicable_licenses: ["system_bt_license"],
}

// Fuzzable defaults are the subset of defaults that are used in fuzzing, which
// requires no shared libraries, and no explicit sanitization.
cc_defaults {
    name: "fluoride_types_defaults_fuzzable",
    defaults: ["bluetooth_cflags"],
    cflags: [
        "-DEXPORT_SYMBOL=__attribute__((visibility(\"default\")))",
        "-DLOG_NDEBUG=1",
        "-fvisibility=hidden",
        // struct BT_HDR is defined as a variable-size header in a struct.
        "-Wno-gnu-variable-sized-type-not-at-end",
    ],
    product_variables: {
        debuggable: {
            cflags: [
                "-DBLUEDROID_DEBUG",
            ],
        },
    },
}

cc_defaults {
    name: "fluoride_defaults_fuzzable",
    target: {
        android: {
            test_config_template: ":BluetoothTestConfigTemplate",
            sanitize: {
                misc_undefined: ["bounds"],
            },
        },
        host: {
            static_libs: [
                "libcutils",
            ],
        },
    },
    defaults: ["fluoride_types_defaults_fuzzable"],
    header_libs: ["libbluetooth_headers"],
    generated_headers: [
        "cxx-bridge-header",
    ],
    include_dirs: ["packages/modules/Bluetooth/system/gd/rust/shim"],
    static_libs: [
        "libbluetooth-types",
        "libbluetooth_rust_interop",
        "libbt-platform-protos-lite",
        "libbt_shim_bridge",
        "libbt_shim_ffi",
    ],
    min_sdk_version: "current",
}

cc_defaults {
    name: "fluoride_test_defaults",
    defaults: ["fluoride_defaults"],
    host_supported: true,
    shared_libs: [
        "libcrypto",
        "liblog",
    ],
    static_libs: [
        "libbt-common",
        "libcutils",
        "libgmock",
        "libosi",
        "libosi-AlarmTestHarness",
        "libosi-AllocationTestHarness",
    ],
    sanitize: {
        address: true,
        cfi: true,
        misc_undefined: ["bounds"],
    },
}

cc_defaults {
    name: "fluoride_defaults",
    defaults: [
        "fluoride_defaults_fuzzable",
    ],
    static_libs: [
        "libstatslog_bt",
    ],
    target: {
        darwin: {
            // libstatslog_bt -> libbinder doesn't build on mac
            enabled: false,
        },
        android: {
            sanitize: {
                misc_undefined: ["bounds"],
            },
        },
    },
}