blob: 2a5598fb7a33ef6512115faf666f84fb540925a6 [file] [log] [blame]
bootstrap_go_package {
name: "soong-art",
pkgPath: "android/soong/art",
deps: [
srcs: [
pluginFor: ["soong_build"],
art_global_defaults {
// Additional flags are computed by art.go
name: "art_defaults",
cflags: [
// Base set of cflags used by all things ART.
// Warn about thread safety violations with clang.
// Warn if switch fallthroughs aren't annotated.
// Enable float equality warnings.
// Enable warning of converting ints to void*.
// Enable warning of wrong unused annotations.
// Enable warning for deprecated language features.
// Enable warning for unreachable break & return.
// Enable thread annotations for std::mutex, etc.
target: {
android: {
cflags: [
// To use oprofile_android --callgraph, uncomment this and recompile with
// mmma -j art
// "-fno-omit-frame-pointer",
// "-marm",
// "-mapcs",
include_dirs: [
// We optimize Thread::Current() with a direct TLS access. This requires access to a
// private Bionic header.
linux: {
cflags: [
// Enable missing-noreturn only on non-Mac. As lots of things are not implemented for
// Apple, it's a pain.
host: {
cflags: [
// Bug: 15446488. We don't omit the frame pointer to work around
// clang/libunwind bugs that cause SEGVs in run-test-004-ThreadStress.
// The build assumes that all our x86/x86_64 hosts (such as buildbots and developer
// desktops) support at least sse4.2/popcount. This firstly implies that the ART
// runtime binary itself may exploit these features. Secondly, this implies that
// the ART runtime passes these feature flags to dex2oat and JIT by calling the
// method InstructionSetFeatures::FromCppDefines(). Since invoking dex2oat directly
// does not pick up these flags, cross-compiling from a x86/x86_64 host to a
// x86/x86_64 target should not be affected.
codegen: {
arm: {
cflags: ["-DART_ENABLE_CODEGEN_arm"],
arm64: {
cflags: ["-DART_ENABLE_CODEGEN_arm64"],
mips: {
cflags: ["-DART_ENABLE_CODEGEN_mips"],
mips64: {
cflags: ["-DART_ENABLE_CODEGEN_mips64"],
x86: {
cflags: ["-DART_ENABLE_CODEGEN_x86"],
x86_64: {
cflags: ["-DART_ENABLE_CODEGEN_x86_64"],
include_dirs: [
tidy_checks: [
// We have local stores that are only used for debug checks.
// We are OK with some static globals and that they can, in theory, throw.
// We have lots of C-style variadic functions, and are OK with them. JNI ensures
// that working around this warning would be extra-painful.
// No exceptions.
tidy_flags: [
// The static analyzer treats DCHECK as always enabled; we sometimes get
// false positives when we use DCHECKs with code that relies on NDEBUG.
// clang-tidy complains about functions like:
// void foo() { CHECK(kIsFooEnabled); /* do foo... */ }
// not being marked noreturn if kIsFooEnabled is false.
art_debug_defaults {
name: "art_debug_defaults",
cflags: [
asflags: [
target: {
// This has to be duplicated for android and host to make sure it
// comes after the -Wframe-larger-than warnings inserted by art.go
// target-specific properties
android: {
cflags: ["-Wno-frame-larger-than="],
host: {
cflags: ["-Wno-frame-larger-than="],