Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 64e852b7 authored by Jack He's avatar Jack He
Browse files

RootCanal: Enable ASan and UBSan and clang-tidy on root-canal

* Enable AddressSanitizer
* Enable Undefined Behavior Sanitizer
* Enable clang-tidy:
  * cppcoreguidelines-pro-type-member-init
  * clang-analyzer-core.CallAndMessage
  * clang-analyzer-optin.cplusplus.UninitializedObject
* Disable clang-tidy:
  * google*
  * performance*

Bug: 153198865
Test: gd/cert/run --host
Change-Id: I12ab71cd912c119c6f808ec4a7b50aaa332590b7
parent 68048748
Loading
Loading
Loading
Loading
+29 −0
Original line number Diff line number Diff line
@@ -71,6 +71,35 @@ cc_defaults {
    },
}

cc_defaults {
    name: "gd_clang_tidy",
    tidy: true,
    tidy_checks: [
        "cppcoreguidelines-pro-type-member-init",
        "clang-analyzer-core.CallAndMessage",
        "clang-analyzer-optin.cplusplus.UninitializedObject",
        "-google*",
        "-performance*",
        "-bugprone*",
    ],
    tidy_checks_as_errors: [
        "cppcoreguidelines-pro-type-member-init",
        "clang-analyzer-core.CallAndMessage",
        "clang-analyzer-optin.cplusplus.UninitializedObject",
    ],
    tidy_flags: [
        "--header-filter=^.*packages/modules/Bluetooth/system/.*.h$",
        "--extra-arg-before=-Xclang",
        "--extra-arg-before=-analyzer-config",
        "--extra-arg-before=-Xclang",
        "--extra-arg-before=optin.cplusplus.UninitializedObject:Pedantic=true",
        "--extra-arg-before=-Xclang",
        "--extra-arg-before=-analyzer-config",
        "--extra-arg-before=-Xclang",
        "--extra-arg-before=optin.cplusplus.UninitializedObject:CheckPointeeInitialization=true",
    ],
}

cc_library {
    name: "libbluetooth_gd",
    defaults: [
+9 −1
Original line number Diff line number Diff line
@@ -2,7 +2,10 @@
// ========================================================
cc_library_static {
    name: "libbt-rootcanal",
    defaults: ["libchrome_support_defaults"],
    defaults: [
        "libchrome_support_defaults",
        "gd_clang_tidy",
    ],
    host_supported: true,
    proprietary: true,
    srcs: [
@@ -108,6 +111,7 @@ cc_binary_host {
    name: "root-canal",
    defaults: [
        "libchrome_support_defaults",
        "gd_clang_tidy",
    ],
    srcs: [
        "desktop/root_canal_main.cc",
@@ -134,6 +138,10 @@ cc_binary_host {
        "libbt-rootcanal-types",
        "libbt-rootcanal",
    ],
    sanitize: {
        address: true,
        all_undefined: true,
    },
}

genrule {