Home | History | Annotate | Download | only in build
      1 bootstrap_go_package {
      2     name: "soong-art",
      3     pkgPath: "android/soong/art",
      4     deps: [
      5         "blueprint",
      6         "blueprint-pathtools",
      7         "soong",
      8         "soong-android",
      9         "soong-cc",
     10     ],
     11     srcs: [
     12         "art.go",
     13         "codegen.go",
     14         "makevars.go",
     15     ],
     16     pluginFor: ["soong_build"],
     17 }
     18 
     19 art_global_defaults {
     20     // Additional flags are computed by art.go
     21 
     22     name: "art_defaults",
     23     clang: true,
     24     cflags: [
     25         // Base set of cflags used by all things ART.
     26         "-fno-rtti",
     27         "-ggdb3",
     28         "-Wall",
     29         "-Werror",
     30         "-Wextra",
     31         "-Wstrict-aliasing",
     32         "-fstrict-aliasing",
     33         "-Wunreachable-code",
     34         "-Wredundant-decls",
     35         "-Wshadow",
     36         "-Wunused",
     37         "-fvisibility=protected",
     38 
     39         // Warn about thread safety violations with clang.
     40         "-Wthread-safety",
     41         "-Wthread-safety-negative",
     42 
     43         // Warn if switch fallthroughs aren't annotated.
     44         "-Wimplicit-fallthrough",
     45 
     46         // Enable float equality warnings.
     47         "-Wfloat-equal",
     48 
     49         // Enable warning of converting ints to void*.
     50         "-Wint-to-void-pointer-cast",
     51 
     52         // Enable warning of wrong unused annotations.
     53         "-Wused-but-marked-unused",
     54 
     55         // Enable warning for deprecated language features.
     56         "-Wdeprecated",
     57 
     58         // Enable warning for unreachable break & return.
     59         "-Wunreachable-code-break",
     60         "-Wunreachable-code-return",
     61 
     62         // Enable thread annotations for std::mutex, etc.
     63         "-D_LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS",
     64     ],
     65 
     66     target: {
     67         android: {
     68             cflags: [
     69                 "-DART_TARGET",
     70 
     71                 // Enable missing-noreturn only on non-Mac. As lots of things are not implemented
     72                 // for Apple, it's a pain.
     73                 "-Wmissing-noreturn",
     74 
     75                 // To use oprofile_android --callgraph, uncomment this and recompile with
     76                 //    mmma -j art
     77                 // "-fno-omit-frame-pointer",
     78                 // "-marm",
     79                 // "-mapcs",
     80             ],
     81             include_dirs: [
     82                 // We optimize Thread::Current() with a direct TLS access. This requires access to a
     83                 //  private Bionic header.
     84                 "bionic/libc/private",
     85             ],
     86         },
     87         linux: {
     88             cflags: [
     89                 // Enable missing-noreturn only on non-Mac. As lots of things are not implemented for
     90                 // Apple, it's a pain.
     91                 "-Wmissing-noreturn",
     92             ],
     93             host_ldlibs: [
     94                 "-lrt",
     95             ],
     96         },
     97         host: {
     98             cflags: [
     99                 // Bug: 15446488. We don't omit the frame pointer to work around
    100                 // clang/libunwind bugs that cause SEGVs in run-test-004-ThreadStress.
    101                 "-fno-omit-frame-pointer",
    102             ],
    103             host_ldlibs: [
    104                 "-ldl",
    105                 "-lpthread",
    106             ],
    107         },
    108     },
    109 
    110     codegen: {
    111         arm: {
    112             cflags: ["-DART_ENABLE_CODEGEN_arm"],
    113         },
    114         arm64: {
    115             cflags: ["-DART_ENABLE_CODEGEN_arm64"],
    116         },
    117         mips: {
    118             cflags: ["-DART_ENABLE_CODEGEN_mips"],
    119         },
    120         mips64: {
    121             cflags: ["-DART_ENABLE_CODEGEN_mips64"],
    122         },
    123         x86: {
    124             cflags: ["-DART_ENABLE_CODEGEN_x86"],
    125         },
    126         x86_64: {
    127             cflags: ["-DART_ENABLE_CODEGEN_x86_64"],
    128         },
    129     },
    130 
    131     include_dirs: [
    132         "external/icu/icu4c/source/common",
    133         "external/lz4/lib",
    134         "external/valgrind/include",
    135         "external/valgrind",
    136         "external/vixl/src",
    137         "external/zlib",
    138         "libnativehelper/platform_include"
    139     ],
    140 
    141     tidy_checks: [
    142         "-google-default-arguments",
    143         // We have local stores that are only used for debug checks.
    144         "-clang-analyzer-deadcode.DeadStores",
    145         // We are OK with some static globals and that they can, in theory, throw.
    146         "-cert-err58-cpp",
    147         // We have lots of C-style variadic functions, and are OK with them. JNI ensures
    148         // that working around this warning would be extra-painful.
    149         "-cert-dcl50-cpp",
    150         // No exceptions.
    151         "-misc-noexcept-move-constructor",
    152     ],
    153 
    154     tidy_flags: [
    155         // The static analyzer treats DCHECK as always enabled; we sometimes get
    156         // false positives when we use DCHECKs with code that relies on NDEBUG.
    157         "-extra-arg=-UNDEBUG",
    158         // clang-tidy complains about functions like:
    159         // void foo() { CHECK(kIsFooEnabled); /* do foo... */ }
    160         // not being marked noreturn if kIsFooEnabled is false.
    161         "-extra-arg=-Wno-missing-noreturn",
    162     ],
    163 }
    164 
    165 art_debug_defaults {
    166     name: "art_debug_defaults",
    167     cflags: [
    168         "-DDYNAMIC_ANNOTATIONS_ENABLED=1",
    169         "-DVIXL_DEBUG",
    170         "-UNDEBUG",
    171     ],
    172     asflags: [
    173         "-UNDEBUG",
    174     ],
    175     target: {
    176         // This has to be duplicated for android and host to make sure it
    177         // comes after the -Wframe-larger-than warnings inserted by art.go
    178         // target-specific properties
    179         android: {
    180             cflags: ["-Wno-frame-larger-than="],
    181         },
    182         host: {
    183             cflags: ["-Wno-frame-larger-than="],
    184         },
    185     },
    186 }
    187