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         "blueprint-proptools",
      8         "soong",
      9         "soong-android",
     10         "soong-cc",
     11     ],
     12     srcs: [
     13         "art.go",
     14         "codegen.go",
     15         "makevars.go",
     16     ],
     17     pluginFor: ["soong_build"],
     18 }
     19 
     20 art_global_defaults {
     21     // Additional flags are computed by art.go
     22 
     23     name: "art_defaults",
     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                 // To use oprofile_android --callgraph, uncomment this and recompile with
     72                 //    mmma -j art
     73                 // "-fno-omit-frame-pointer",
     74                 // "-marm",
     75                 // "-mapcs",
     76             ],
     77             include_dirs: [
     78                 // We optimize Thread::Current() with a direct TLS access. This requires access to a
     79                 //  private Bionic header.
     80                 "bionic/libc/private",
     81             ],
     82         },
     83         linux: {
     84             cflags: [
     85                 // Enable missing-noreturn only on non-Mac. As lots of things are not implemented for
     86                 // Apple, it's a pain.
     87                 "-Wmissing-noreturn",
     88             ],
     89         },
     90         host: {
     91             cflags: [
     92                 // Bug: 15446488. We don't omit the frame pointer to work around
     93                 // clang/libunwind bugs that cause SEGVs in run-test-004-ThreadStress.
     94                 "-fno-omit-frame-pointer",
     95                 // The build assumes that all our x86/x86_64 hosts (such as buildbots and developer
     96                 // desktops) support at least sse4.2/popcount. This firstly implies that the ART
     97                 // runtime binary itself may exploit these features. Secondly, this implies that
     98                 // the ART runtime passes these feature flags to dex2oat and JIT by calling the
     99                 // method InstructionSetFeatures::FromCppDefines(). Since invoking dex2oat directly
    100                 // does not pick up these flags, cross-compiling from a x86/x86_64 host to a
    101                 // x86/x86_64 target should not be affected.
    102                 "-msse4.2",
    103                 "-mpopcnt",
    104             ],
    105         },
    106     },
    107 
    108     codegen: {
    109         arm: {
    110             cflags: ["-DART_ENABLE_CODEGEN_arm"],
    111         },
    112         arm64: {
    113             cflags: ["-DART_ENABLE_CODEGEN_arm64"],
    114         },
    115         mips: {
    116             cflags: ["-DART_ENABLE_CODEGEN_mips"],
    117         },
    118         mips64: {
    119             cflags: ["-DART_ENABLE_CODEGEN_mips64"],
    120         },
    121         x86: {
    122             cflags: ["-DART_ENABLE_CODEGEN_x86"],
    123         },
    124         x86_64: {
    125             cflags: ["-DART_ENABLE_CODEGEN_x86_64"],
    126         },
    127     },
    128 
    129     include_dirs: [
    130         "external/valgrind/include",
    131         "external/valgrind",
    132         "external/vixl/src",
    133     ],
    134 
    135     tidy_checks: [
    136         "-google-default-arguments",
    137         // We have local stores that are only used for debug checks.
    138         "-clang-analyzer-deadcode.DeadStores",
    139         // We are OK with some static globals and that they can, in theory, throw.
    140         "-cert-err58-cpp",
    141         // We have lots of C-style variadic functions, and are OK with them. JNI ensures
    142         // that working around this warning would be extra-painful.
    143         "-cert-dcl50-cpp",
    144         // No exceptions.
    145         "-misc-noexcept-move-constructor",
    146     ],
    147 
    148     tidy_flags: [
    149         // The static analyzer treats DCHECK as always enabled; we sometimes get
    150         // false positives when we use DCHECKs with code that relies on NDEBUG.
    151         "-extra-arg=-UNDEBUG",
    152         // clang-tidy complains about functions like:
    153         // void foo() { CHECK(kIsFooEnabled); /* do foo... */ }
    154         // not being marked noreturn if kIsFooEnabled is false.
    155         "-extra-arg=-Wno-missing-noreturn",
    156     ],
    157 }
    158 
    159 art_debug_defaults {
    160     name: "art_debug_defaults",
    161     cflags: [
    162         "-DDYNAMIC_ANNOTATIONS_ENABLED=1",
    163         "-DVIXL_DEBUG",
    164         "-UNDEBUG",
    165     ],
    166     asflags: [
    167         "-UNDEBUG",
    168     ],
    169     target: {
    170         // This has to be duplicated for android and host to make sure it
    171         // comes after the -Wframe-larger-than warnings inserted by art.go
    172         // target-specific properties
    173         android: {
    174             cflags: ["-Wno-frame-larger-than="],
    175         },
    176         host: {
    177             cflags: ["-Wno-frame-larger-than="],
    178         },
    179     },
    180 }
    181