Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 1 | # |
| 2 | # Copyright (C) 2011 The Android Open Source Project |
| 3 | # |
| 4 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | # you may not use this file except in compliance with the License. |
| 6 | # You may obtain a copy of the License at |
| 7 | # |
| 8 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | # |
| 10 | # Unless required by applicable law or agreed to in writing, software |
| 11 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | # See the License for the specific language governing permissions and |
| 14 | # limitations under the License. |
| 15 | # |
| 16 | |
Igor Murashkin | 3774335 | 2014-11-13 14:38:00 -0800 | [diff] [blame] | 17 | ifndef ART_ANDROID_COMMON_BUILD_MK |
| 18 | ART_ANDROID_COMMON_BUILD_MK = true |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 19 | |
| 20 | include art/build/Android.common.mk |
Igor Murashkin | 3774335 | 2014-11-13 14:38:00 -0800 | [diff] [blame] | 21 | include art/build/Android.common_utils.mk |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 22 | |
| 23 | # These can be overridden via the environment or by editing to |
| 24 | # enable/disable certain build configuration. |
| 25 | # |
| 26 | # For example, to disable everything but the host debug build you use: |
| 27 | # |
| 28 | # (export ART_BUILD_TARGET_NDEBUG=false && export ART_BUILD_TARGET_DEBUG=false && export ART_BUILD_HOST_NDEBUG=false && ...) |
| 29 | # |
| 30 | # Beware that tests may use the non-debug build for performance, notable 055-enum-performance |
| 31 | # |
| 32 | ART_BUILD_TARGET_NDEBUG ?= true |
| 33 | ART_BUILD_TARGET_DEBUG ?= true |
| 34 | ART_BUILD_HOST_NDEBUG ?= true |
| 35 | ART_BUILD_HOST_DEBUG ?= true |
| 36 | |
| 37 | ifeq ($(ART_BUILD_TARGET_NDEBUG),false) |
| 38 | $(info Disabling ART_BUILD_TARGET_NDEBUG) |
| 39 | endif |
| 40 | ifeq ($(ART_BUILD_TARGET_DEBUG),false) |
| 41 | $(info Disabling ART_BUILD_TARGET_DEBUG) |
| 42 | endif |
| 43 | ifeq ($(ART_BUILD_HOST_NDEBUG),false) |
| 44 | $(info Disabling ART_BUILD_HOST_NDEBUG) |
| 45 | endif |
| 46 | ifeq ($(ART_BUILD_HOST_DEBUG),false) |
| 47 | $(info Disabling ART_BUILD_HOST_DEBUG) |
| 48 | endif |
| 49 | |
| 50 | # |
Mathieu Chartier | e5f13e5 | 2015-02-24 09:37:21 -0800 | [diff] [blame] | 51 | # Used to enable JIT |
| 52 | # |
| 53 | ART_JIT := false |
| 54 | ifneq ($(wildcard art/JIT_ART),) |
| 55 | $(info Enabling ART_JIT because of existence of art/JIT_ART) |
| 56 | ART_JIT := true |
| 57 | endif |
| 58 | ifeq ($(WITH_ART_JIT), true) |
| 59 | ART_JIT := true |
| 60 | endif |
| 61 | |
| 62 | # |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 63 | # Used to change the default GC. Valid values are CMS, SS, GSS. The default is CMS. |
| 64 | # |
Hiroshi Yamauchi | 3e78162 | 2015-02-25 12:52:34 -0800 | [diff] [blame] | 65 | ART_DEFAULT_GC_TYPE ?= CMS |
| 66 | art_default_gc_type_cflags := -DART_DEFAULT_GC_TYPE_IS_$(ART_DEFAULT_GC_TYPE) |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 67 | |
Andreas Gampe | ee0ebc8 | 2014-10-21 21:07:28 -0700 | [diff] [blame] | 68 | ART_HOST_CFLAGS := |
| 69 | ART_TARGET_CFLAGS := |
| 70 | |
Roland Levillain | 12bd721 | 2015-06-04 17:50:27 +0100 | [diff] [blame] | 71 | ART_HOST_ASFLAGS := |
| 72 | ART_TARGET_ASFLAGS := |
| 73 | |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 74 | # Clang build support. |
| 75 | |
| 76 | # Host. |
| 77 | ART_HOST_CLANG := false |
| 78 | ifneq ($(WITHOUT_HOST_CLANG),true) |
| 79 | # By default, host builds use clang for better warnings. |
| 80 | ART_HOST_CLANG := true |
| 81 | endif |
| 82 | |
Sebastien Hertz | ea521dc | 2014-06-25 18:50:01 +0200 | [diff] [blame] | 83 | # Clang on the target. Target builds use GCC by default. |
Bernhard Rosenkraenzer | 88c0569 | 2014-10-04 19:02:06 +0200 | [diff] [blame] | 84 | ifneq ($(USE_CLANG_PLATFORM_BUILD),) |
| 85 | ART_TARGET_CLANG := $(USE_CLANG_PLATFORM_BUILD) |
| 86 | else |
Ian Rogers | d642a91 | 2014-10-02 09:41:44 -0700 | [diff] [blame] | 87 | ART_TARGET_CLANG := false |
Bernhard Rosenkraenzer | 88c0569 | 2014-10-04 19:02:06 +0200 | [diff] [blame] | 88 | endif |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 89 | ART_TARGET_CLANG_arm := |
Sebastien Hertz | ea521dc | 2014-06-25 18:50:01 +0200 | [diff] [blame] | 90 | ART_TARGET_CLANG_arm64 := |
Duane Sand | 91ddd0d | 2015-05-01 11:34:51 -0700 | [diff] [blame] | 91 | ART_TARGET_CLANG_mips := |
| 92 | ART_TARGET_CLANG_mips64 := |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 93 | ART_TARGET_CLANG_x86 := |
| 94 | ART_TARGET_CLANG_x86_64 := |
| 95 | |
| 96 | define set-target-local-clang-vars |
| 97 | LOCAL_CLANG := $(ART_TARGET_CLANG) |
| 98 | $(foreach arch,$(ART_TARGET_SUPPORTED_ARCH), |
| 99 | ifneq ($$(ART_TARGET_CLANG_$(arch)),) |
| 100 | LOCAL_CLANG_$(arch) := $$(ART_TARGET_CLANG_$(arch)) |
| 101 | endif) |
| 102 | endef |
| 103 | |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 104 | ART_TARGET_CLANG_CFLAGS := |
| 105 | ART_TARGET_CLANG_CFLAGS_arm := |
| 106 | ART_TARGET_CLANG_CFLAGS_arm64 := |
| 107 | ART_TARGET_CLANG_CFLAGS_mips := |
Andreas Gampe | 1a5c406 | 2015-01-15 12:10:47 -0800 | [diff] [blame] | 108 | ART_TARGET_CLANG_CFLAGS_mips64 := |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 109 | ART_TARGET_CLANG_CFLAGS_x86 := |
| 110 | ART_TARGET_CLANG_CFLAGS_x86_64 := |
| 111 | |
Ian Rogers | d642a91 | 2014-10-02 09:41:44 -0700 | [diff] [blame] | 112 | # These are necessary for Clang ARM64 ART builds. TODO: remove. |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 113 | ART_TARGET_CLANG_CFLAGS_arm64 += \ |
Andreas Gampe | 685fbe4 | 2015-01-27 14:36:38 -0800 | [diff] [blame] | 114 | -DNVALGRIND |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 115 | |
Ian Rogers | 6f3dbba | 2014-10-14 17:41:57 -0700 | [diff] [blame] | 116 | # Warn about thread safety violations with clang. |
Dan Albert | 6c7cdc5 | 2014-12-02 14:58:06 -0800 | [diff] [blame] | 117 | art_clang_cflags := -Wthread-safety |
Ian Rogers | 6f3dbba | 2014-10-14 17:41:57 -0700 | [diff] [blame] | 118 | |
| 119 | # Warn if switch fallthroughs aren't annotated. |
| 120 | art_clang_cflags += -Wimplicit-fallthrough |
| 121 | |
| 122 | # Enable float equality warnings. |
| 123 | art_clang_cflags += -Wfloat-equal |
| 124 | |
Andreas Gampe | 277ccbd | 2014-11-03 21:36:10 -0800 | [diff] [blame] | 125 | # Enable warning of converting ints to void*. |
| 126 | art_clang_cflags += -Wint-to-void-pointer-cast |
| 127 | |
Andreas Gampe | ca71458 | 2015-04-03 19:41:34 -0700 | [diff] [blame] | 128 | # Enable warning of wrong unused annotations. |
| 129 | art_clang_cflags += -Wused-but-marked-unused |
| 130 | |
Andreas Gampe | 758a801 | 2015-04-03 21:28:42 -0700 | [diff] [blame] | 131 | # Enable warning for deprecated language features. |
| 132 | art_clang_cflags += -Wdeprecated |
| 133 | |
Andreas Gampe | 6622266 | 2015-04-06 19:50:46 -0700 | [diff] [blame] | 134 | # Enable warning for unreachable break & return. |
| 135 | art_clang_cflags += -Wunreachable-code-break -Wunreachable-code-return |
| 136 | |
| 137 | # Enable missing-noreturn only on non-Mac. As lots of things are not implemented for Apple, it's |
| 138 | # a pain. |
| 139 | ifneq ($(HOST_OS),darwin) |
| 140 | art_clang_cflags += -Wmissing-noreturn |
| 141 | endif |
Andreas Gampe | 65b798e | 2015-04-06 09:35:22 -0700 | [diff] [blame] | 142 | |
Andreas Gampe | ca71458 | 2015-04-03 19:41:34 -0700 | [diff] [blame] | 143 | |
Andreas Gampe | 277ccbd | 2014-11-03 21:36:10 -0800 | [diff] [blame] | 144 | # GCC-only warnings. |
| 145 | art_gcc_cflags := -Wunused-but-set-parameter |
| 146 | # Suggest const: too many false positives, but good for a trial run. |
| 147 | # -Wsuggest-attribute=const |
| 148 | # Useless casts: too many, as we need to be 32/64 agnostic, but the compiler knows. |
| 149 | # -Wuseless-cast |
| 150 | # Zero-as-null: Have to convert all NULL and "diagnostic ignore" all includes like libnativehelper |
| 151 | # that are still stuck pre-C++11. |
| 152 | # -Wzero-as-null-pointer-constant \ |
| 153 | # Suggest final: Have to move to a more recent GCC. |
| 154 | # -Wsuggest-final-types |
| 155 | |
Andreas Gampe | bced67d | 2015-01-07 14:35:44 -0800 | [diff] [blame] | 156 | ART_TARGET_CLANG_CFLAGS := $(art_clang_cflags) |
Ian Rogers | 6f3dbba | 2014-10-14 17:41:57 -0700 | [diff] [blame] | 157 | ifeq ($(ART_HOST_CLANG),true) |
Ian Rogers | 4ad5cd3 | 2014-11-11 23:08:07 -0800 | [diff] [blame] | 158 | # Bug: 15446488. We don't omit the frame pointer to work around |
| 159 | # clang/libunwind bugs that cause SEGVs in run-test-004-ThreadStress. |
| 160 | ART_HOST_CFLAGS += $(art_clang_cflags) -fno-omit-frame-pointer |
Andreas Gampe | 277ccbd | 2014-11-03 21:36:10 -0800 | [diff] [blame] | 161 | else |
| 162 | ART_HOST_CFLAGS += $(art_gcc_cflags) |
Ian Rogers | 6f3dbba | 2014-10-14 17:41:57 -0700 | [diff] [blame] | 163 | endif |
Andreas Gampe | bced67d | 2015-01-07 14:35:44 -0800 | [diff] [blame] | 164 | ifneq ($(ART_TARGET_CLANG),true) |
Andreas Gampe | 277ccbd | 2014-11-03 21:36:10 -0800 | [diff] [blame] | 165 | ART_TARGET_CFLAGS += $(art_gcc_cflags) |
Andreas Gampe | bced67d | 2015-01-07 14:35:44 -0800 | [diff] [blame] | 166 | else |
| 167 | # TODO: if we ever want to support GCC/Clang mix for multi-target products, this needs to be |
| 168 | # split up. |
| 169 | ifeq ($(ART_TARGET_CLANG_$(TARGET_ARCH)),false) |
| 170 | ART_TARGET_CFLAGS += $(art_gcc_cflags) |
| 171 | endif |
Ian Rogers | 6f3dbba | 2014-10-14 17:41:57 -0700 | [diff] [blame] | 172 | endif |
| 173 | |
Andreas Gampe | 277ccbd | 2014-11-03 21:36:10 -0800 | [diff] [blame] | 174 | # Clear local variables now their use has ended. |
Ian Rogers | 6f3dbba | 2014-10-14 17:41:57 -0700 | [diff] [blame] | 175 | art_clang_cflags := |
Andreas Gampe | 277ccbd | 2014-11-03 21:36:10 -0800 | [diff] [blame] | 176 | art_gcc_cflags := |
Ian Rogers | 6f3dbba | 2014-10-14 17:41:57 -0700 | [diff] [blame] | 177 | |
| 178 | ART_CPP_EXTENSION := .cc |
| 179 | |
| 180 | ART_C_INCLUDES := \ |
| 181 | external/gtest/include \ |
Jeff Hao | 848f70a | 2014-01-15 13:49:50 -0800 | [diff] [blame] | 182 | external/icu/icu4c/source/common \ |
Dmitriy Ivanov | 6130f73 | 2015-05-27 15:34:38 -0700 | [diff] [blame] | 183 | external/valgrind/include \ |
| 184 | external/valgrind \ |
Ian Rogers | 6f3dbba | 2014-10-14 17:41:57 -0700 | [diff] [blame] | 185 | external/vixl/src \ |
| 186 | external/zlib \ |
Ian Rogers | 6f3dbba | 2014-10-14 17:41:57 -0700 | [diff] [blame] | 187 | |
| 188 | # Base set of cflags used by all things ART. |
| 189 | art_cflags := \ |
| 190 | -fno-rtti \ |
| 191 | -std=gnu++11 \ |
| 192 | -ggdb3 \ |
| 193 | -Wall \ |
| 194 | -Werror \ |
| 195 | -Wextra \ |
Ian Rogers | 6f3dbba | 2014-10-14 17:41:57 -0700 | [diff] [blame] | 196 | -Wstrict-aliasing \ |
| 197 | -fstrict-aliasing \ |
| 198 | -Wunreachable-code \ |
Andreas Gampe | 277ccbd | 2014-11-03 21:36:10 -0800 | [diff] [blame] | 199 | -Wredundant-decls \ |
| 200 | -Wshadow \ |
Andreas Gampe | 7c3952f | 2015-02-19 18:21:24 -0800 | [diff] [blame] | 201 | -Wunused \ |
Ian Rogers | 6f3dbba | 2014-10-14 17:41:57 -0700 | [diff] [blame] | 202 | -fvisibility=protected \ |
| 203 | $(art_default_gc_type_cflags) |
| 204 | |
Roland Levillain | 12bd721 | 2015-06-04 17:50:27 +0100 | [diff] [blame] | 205 | # Base set of asflags used by all things ART. |
| 206 | art_asflags := |
| 207 | |
Andreas Gampe | 277ccbd | 2014-11-03 21:36:10 -0800 | [diff] [blame] | 208 | # Missing declarations: too many at the moment, as we use "extern" quite a bit. |
| 209 | # -Wmissing-declarations \ |
| 210 | |
| 211 | |
Mathieu Chartier | cd195fe | 2014-11-25 18:36:01 -0800 | [diff] [blame] | 212 | |
| 213 | ifdef ART_IMT_SIZE |
| 214 | art_cflags += -DIMT_SIZE=$(ART_IMT_SIZE) |
| 215 | else |
| 216 | # Default is 64 |
| 217 | art_cflags += -DIMT_SIZE=64 |
| 218 | endif |
| 219 | |
Nicolas Geoffray | 9bb492a | 2014-11-25 23:42:00 +0000 | [diff] [blame] | 220 | ifeq ($(ART_USE_OPTIMIZING_COMPILER),true) |
| 221 | art_cflags += -DART_USE_OPTIMIZING_COMPILER=1 |
| 222 | endif |
| 223 | |
Hiroshi Yamauchi | b0d22f1 | 2014-12-08 12:08:46 -0800 | [diff] [blame] | 224 | ifeq ($(ART_HEAP_POISONING),true) |
| 225 | art_cflags += -DART_HEAP_POISONING=1 |
Roland Levillain | 12bd721 | 2015-06-04 17:50:27 +0100 | [diff] [blame] | 226 | art_asflags += -DART_HEAP_POISONING=1 |
Hiroshi Yamauchi | b0d22f1 | 2014-12-08 12:08:46 -0800 | [diff] [blame] | 227 | endif |
| 228 | |
Hiroshi Yamauchi | c23f0d8 | 2015-01-23 17:23:42 -0800 | [diff] [blame] | 229 | ifeq ($(ART_USE_READ_BARRIER),true) |
| 230 | art_cflags += -DART_USE_READ_BARRIER=1 |
Roland Levillain | 12bd721 | 2015-06-04 17:50:27 +0100 | [diff] [blame] | 231 | art_asflags += -DART_USE_READ_BARRIER=1 |
Hiroshi Yamauchi | c23f0d8 | 2015-01-23 17:23:42 -0800 | [diff] [blame] | 232 | endif |
| 233 | |
Hiroshi Yamauchi | 79bd2bf | 2015-03-20 10:28:34 -0700 | [diff] [blame] | 234 | ifeq ($(ART_USE_TLAB),true) |
| 235 | art_cflags += -DART_USE_TLAB=1 |
| 236 | endif |
| 237 | |
Ian Rogers | 6f3dbba | 2014-10-14 17:41:57 -0700 | [diff] [blame] | 238 | # Cflags for non-debug ART and ART tools. |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 239 | art_non_debug_cflags := \ |
| 240 | -O3 |
| 241 | |
Ian Rogers | 6f3dbba | 2014-10-14 17:41:57 -0700 | [diff] [blame] | 242 | # Cflags for debug ART and ART tools. |
| 243 | art_debug_cflags := \ |
Nicolas Geoffray | 40e7f0e | 2015-02-03 10:13:27 +0000 | [diff] [blame] | 244 | -O2 \ |
Ian Rogers | 6f3dbba | 2014-10-14 17:41:57 -0700 | [diff] [blame] | 245 | -DDYNAMIC_ANNOTATIONS_ENABLED=1 \ |
Serban Constantinescu | 32f5b4d | 2014-11-25 20:05:46 +0000 | [diff] [blame] | 246 | -DVIXL_DEBUG \ |
Ian Rogers | 50fe6da | 2014-10-17 01:18:08 -0700 | [diff] [blame] | 247 | -UNDEBUG |
Stephen Hines | 67a4338 | 2014-07-17 01:49:18 -0700 | [diff] [blame] | 248 | |
Ian Rogers | 6f3dbba | 2014-10-14 17:41:57 -0700 | [diff] [blame] | 249 | art_host_non_debug_cflags := $(art_non_debug_cflags) |
| 250 | art_target_non_debug_cflags := $(art_non_debug_cflags) |
Stephen Hines | 67a4338 | 2014-07-17 01:49:18 -0700 | [diff] [blame] | 251 | |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 252 | ifeq ($(HOST_OS),linux) |
Stephen Hines | 67a4338 | 2014-07-17 01:49:18 -0700 | [diff] [blame] | 253 | # Larger frame-size for host clang builds today |
Dan Albert | 31fb260 | 2014-09-30 22:10:10 -0700 | [diff] [blame] | 254 | ifneq ($(ART_COVERAGE),true) |
| 255 | ifneq ($(NATIVE_COVERAGE),true) |
| 256 | ifndef SANITIZE_HOST |
| 257 | art_host_non_debug_cflags += -Wframe-larger-than=2700 |
| 258 | endif |
| 259 | art_target_non_debug_cflags += -Wframe-larger-than=1728 |
| 260 | endif |
Dan Albert | 98b8bcf | 2014-11-14 19:56:21 -0800 | [diff] [blame] | 261 | endif |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 262 | endif |
| 263 | |
Ying Wang | a28ff0f | 2014-12-08 14:29:34 -0800 | [diff] [blame] | 264 | ifndef LIBART_IMG_HOST_BASE_ADDRESS |
| 265 | $(error LIBART_IMG_HOST_BASE_ADDRESS unset) |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 266 | endif |
Ying Wang | a28ff0f | 2014-12-08 14:29:34 -0800 | [diff] [blame] | 267 | ART_HOST_CFLAGS += $(art_cflags) -DART_BASE_ADDRESS=$(LIBART_IMG_HOST_BASE_ADDRESS) |
| 268 | ART_HOST_CFLAGS += -DART_DEFAULT_INSTRUCTION_SET_FEATURES=default |
Roland Levillain | 12bd721 | 2015-06-04 17:50:27 +0100 | [diff] [blame] | 269 | ART_HOST_ASFLAGS += $(art_asflags) |
Ying Wang | a28ff0f | 2014-12-08 14:29:34 -0800 | [diff] [blame] | 270 | |
| 271 | ifndef LIBART_IMG_TARGET_BASE_ADDRESS |
| 272 | $(error LIBART_IMG_TARGET_BASE_ADDRESS unset) |
| 273 | endif |
| 274 | ART_TARGET_CFLAGS += $(art_cflags) -DART_TARGET -DART_BASE_ADDRESS=$(LIBART_IMG_TARGET_BASE_ADDRESS) |
Roland Levillain | 12bd721 | 2015-06-04 17:50:27 +0100 | [diff] [blame] | 275 | ART_TARGET_ASFLAGS += $(art_asflags) |
Alex Light | a59dd80 | 2014-07-02 16:28:08 -0700 | [diff] [blame] | 276 | |
Ian Rogers | 6f3dbba | 2014-10-14 17:41:57 -0700 | [diff] [blame] | 277 | ART_HOST_NON_DEBUG_CFLAGS := $(art_host_non_debug_cflags) |
| 278 | ART_TARGET_NON_DEBUG_CFLAGS := $(art_target_non_debug_cflags) |
| 279 | ART_HOST_DEBUG_CFLAGS := $(art_debug_cflags) |
| 280 | ART_TARGET_DEBUG_CFLAGS := $(art_debug_cflags) |
| 281 | |
Alex Light | a59dd80 | 2014-07-02 16:28:08 -0700 | [diff] [blame] | 282 | ifndef LIBART_IMG_HOST_MIN_BASE_ADDRESS_DELTA |
| 283 | LIBART_IMG_HOST_MIN_BASE_ADDRESS_DELTA=-0x1000000 |
| 284 | endif |
| 285 | ifndef LIBART_IMG_HOST_MAX_BASE_ADDRESS_DELTA |
| 286 | LIBART_IMG_HOST_MAX_BASE_ADDRESS_DELTA=0x1000000 |
| 287 | endif |
| 288 | ART_HOST_CFLAGS += -DART_BASE_ADDRESS_MIN_DELTA=$(LIBART_IMG_HOST_MIN_BASE_ADDRESS_DELTA) |
| 289 | ART_HOST_CFLAGS += -DART_BASE_ADDRESS_MAX_DELTA=$(LIBART_IMG_HOST_MAX_BASE_ADDRESS_DELTA) |
| 290 | |
| 291 | ifndef LIBART_IMG_TARGET_MIN_BASE_ADDRESS_DELTA |
| 292 | LIBART_IMG_TARGET_MIN_BASE_ADDRESS_DELTA=-0x1000000 |
| 293 | endif |
| 294 | ifndef LIBART_IMG_TARGET_MAX_BASE_ADDRESS_DELTA |
| 295 | LIBART_IMG_TARGET_MAX_BASE_ADDRESS_DELTA=0x1000000 |
| 296 | endif |
| 297 | ART_TARGET_CFLAGS += -DART_BASE_ADDRESS_MIN_DELTA=$(LIBART_IMG_TARGET_MIN_BASE_ADDRESS_DELTA) |
| 298 | ART_TARGET_CFLAGS += -DART_BASE_ADDRESS_MAX_DELTA=$(LIBART_IMG_TARGET_MAX_BASE_ADDRESS_DELTA) |
| 299 | |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 300 | # To use oprofile_android --callgraph, uncomment this and recompile with "mmm art -B -j16" |
| 301 | # ART_TARGET_CFLAGS += -fno-omit-frame-pointer -marm -mapcs |
| 302 | |
Ian Rogers | 6f3dbba | 2014-10-14 17:41:57 -0700 | [diff] [blame] | 303 | # Clear locals now they've served their purpose. |
| 304 | art_cflags := |
Roland Levillain | 12bd721 | 2015-06-04 17:50:27 +0100 | [diff] [blame] | 305 | art_asflags := |
Ian Rogers | 6f3dbba | 2014-10-14 17:41:57 -0700 | [diff] [blame] | 306 | art_debug_cflags := |
| 307 | art_non_debug_cflags := |
| 308 | art_host_non_debug_cflags := |
| 309 | art_target_non_debug_cflags := |
| 310 | art_default_gc_type := |
| 311 | art_default_gc_type_cflags := |
| 312 | |
| 313 | ART_HOST_LDLIBS := |
| 314 | ifneq ($(ART_HOST_CLANG),true) |
| 315 | # GCC lacks libc++ assumed atomic operations, grab via libatomic. |
| 316 | ART_HOST_LDLIBS += -latomic |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 317 | endif |
| 318 | |
Ian Rogers | 6f3dbba | 2014-10-14 17:41:57 -0700 | [diff] [blame] | 319 | ART_TARGET_LDFLAGS := |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 320 | |
| 321 | # $(1): ndebug_or_debug |
| 322 | define set-target-local-cflags-vars |
| 323 | LOCAL_CFLAGS += $(ART_TARGET_CFLAGS) |
| 324 | LOCAL_CFLAGS_x86 += $(ART_TARGET_CFLAGS_x86) |
Roland Levillain | 12bd721 | 2015-06-04 17:50:27 +0100 | [diff] [blame] | 325 | LOCAL_ASFLAGS += $(ART_TARGET_ASFLAGS) |
Dehao Chen | 997660d | 2014-07-08 10:00:56 -0700 | [diff] [blame] | 326 | LOCAL_LDFLAGS += $(ART_TARGET_LDFLAGS) |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 327 | art_target_cflags_ndebug_or_debug := $(1) |
| 328 | ifeq ($$(art_target_cflags_ndebug_or_debug),debug) |
| 329 | LOCAL_CFLAGS += $(ART_TARGET_DEBUG_CFLAGS) |
| 330 | else |
| 331 | LOCAL_CFLAGS += $(ART_TARGET_NON_DEBUG_CFLAGS) |
| 332 | endif |
| 333 | |
Andreas Gampe | bced67d | 2015-01-07 14:35:44 -0800 | [diff] [blame] | 334 | LOCAL_CLANG_CFLAGS := $(ART_TARGET_CLANG_CFLAGS) |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 335 | $(foreach arch,$(ART_SUPPORTED_ARCH), |
Andreas Gampe | bced67d | 2015-01-07 14:35:44 -0800 | [diff] [blame] | 336 | LOCAL_CLANG_CFLAGS_$(arch) += $$(ART_TARGET_CLANG_CFLAGS_$(arch))) |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 337 | |
| 338 | # Clear locally used variables. |
| 339 | art_target_cflags_ndebug_or_debug := |
| 340 | endef |
| 341 | |
Ian Rogers | 6f3dbba | 2014-10-14 17:41:57 -0700 | [diff] [blame] | 342 | # Support for disabling certain builds. |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 343 | ART_BUILD_TARGET := false |
| 344 | ART_BUILD_HOST := false |
| 345 | ART_BUILD_NDEBUG := false |
| 346 | ART_BUILD_DEBUG := false |
| 347 | ifeq ($(ART_BUILD_TARGET_NDEBUG),true) |
| 348 | ART_BUILD_TARGET := true |
| 349 | ART_BUILD_NDEBUG := true |
| 350 | endif |
| 351 | ifeq ($(ART_BUILD_TARGET_DEBUG),true) |
| 352 | ART_BUILD_TARGET := true |
| 353 | ART_BUILD_DEBUG := true |
| 354 | endif |
| 355 | ifeq ($(ART_BUILD_HOST_NDEBUG),true) |
| 356 | ART_BUILD_HOST := true |
| 357 | ART_BUILD_NDEBUG := true |
| 358 | endif |
| 359 | ifeq ($(ART_BUILD_HOST_DEBUG),true) |
| 360 | ART_BUILD_HOST := true |
| 361 | ART_BUILD_DEBUG := true |
| 362 | endif |
| 363 | |
Igor Murashkin | 3774335 | 2014-11-13 14:38:00 -0800 | [diff] [blame] | 364 | endif # ART_ANDROID_COMMON_BUILD_MK |