blob: 7edc1ccb375b677187a00b9ef57e584e87ceb235 [file] [log] [blame]
Ian Rogersafd9acc2014-06-17 08:21:54 -07001#
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 Murashkin37743352014-11-13 14:38:00 -080017ifndef ART_ANDROID_COMMON_BUILD_MK
18ART_ANDROID_COMMON_BUILD_MK = true
Ian Rogersafd9acc2014-06-17 08:21:54 -070019
20include art/build/Android.common.mk
Igor Murashkin37743352014-11-13 14:38:00 -080021include art/build/Android.common_utils.mk
Ian Rogersafd9acc2014-06-17 08:21:54 -070022
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#
32ART_BUILD_TARGET_NDEBUG ?= true
33ART_BUILD_TARGET_DEBUG ?= true
34ART_BUILD_HOST_NDEBUG ?= true
35ART_BUILD_HOST_DEBUG ?= true
Calin Juravle676ff8e2015-07-24 16:45:26 +010036
Roland Levillainb5390f72016-07-04 16:59:53 +010037# Set this to change what opt level ART is built at.
Alex Light8069d9f2015-10-14 16:21:17 -070038ART_DEBUG_OPT_FLAG ?= -O2
39ART_NDEBUG_OPT_FLAG ?= -O3
40
Calin Juravle676ff8e2015-07-24 16:45:26 +010041# Enable the static builds only for checkbuilds.
42ifneq (,$(filter checkbuild,$(MAKECMDGOALS)))
43 ART_BUILD_HOST_STATIC ?= true
44else
45 ART_BUILD_HOST_STATIC ?= false
46endif
Ian Rogersafd9acc2014-06-17 08:21:54 -070047
Calin Juravle4895ea42015-07-02 18:21:14 +010048# Asan does not support static linkage
49ifdef SANITIZE_HOST
50 ART_BUILD_HOST_STATIC := false
51endif
52
Calin Juravle0e26f462015-07-09 15:48:03 +010053ifneq ($(HOST_OS),linux)
Calin Juravle4895ea42015-07-02 18:21:14 +010054 ART_BUILD_HOST_STATIC := false
55endif
56
Ian Rogersafd9acc2014-06-17 08:21:54 -070057ifeq ($(ART_BUILD_TARGET_NDEBUG),false)
58$(info Disabling ART_BUILD_TARGET_NDEBUG)
59endif
60ifeq ($(ART_BUILD_TARGET_DEBUG),false)
61$(info Disabling ART_BUILD_TARGET_DEBUG)
62endif
63ifeq ($(ART_BUILD_HOST_NDEBUG),false)
64$(info Disabling ART_BUILD_HOST_NDEBUG)
65endif
66ifeq ($(ART_BUILD_HOST_DEBUG),false)
67$(info Disabling ART_BUILD_HOST_DEBUG)
68endif
Calin Juravle65e069d2015-06-08 10:35:24 +010069ifeq ($(ART_BUILD_HOST_STATIC),true)
70$(info Enabling ART_BUILD_HOST_STATIC)
71endif
Ian Rogersafd9acc2014-06-17 08:21:54 -070072
Hiroshi Yamauchi093f1b42015-07-14 12:20:30 -070073ifeq ($(ART_TEST_DEBUG_GC),true)
74 ART_DEFAULT_GC_TYPE := SS
75 ART_USE_TLAB := true
76endif
77
Ian Rogersafd9acc2014-06-17 08:21:54 -070078#
Ian Rogersafd9acc2014-06-17 08:21:54 -070079# Used to change the default GC. Valid values are CMS, SS, GSS. The default is CMS.
80#
Hiroshi Yamauchi3e781622015-02-25 12:52:34 -080081ART_DEFAULT_GC_TYPE ?= CMS
82art_default_gc_type_cflags := -DART_DEFAULT_GC_TYPE_IS_$(ART_DEFAULT_GC_TYPE)
Ian Rogersafd9acc2014-06-17 08:21:54 -070083
Colin Crossecf75a62016-07-28 16:01:42 -070084ART_HOST_CLANG := true
85ART_TARGET_CLANG := true
Ian Rogers6f3dbba2014-10-14 17:41:57 -070086
87ART_CPP_EXTENSION := .cc
88
89ART_C_INCLUDES := \
Jeff Hao848f70a2014-01-15 13:49:50 -080090 external/icu/icu4c/source/common \
Mathieu Chartierceb07b32015-12-10 09:33:21 -080091 external/lz4/lib \
Dmitriy Ivanov6130f732015-05-27 15:34:38 -070092 external/valgrind/include \
93 external/valgrind \
Ian Rogers6f3dbba2014-10-14 17:41:57 -070094 external/vixl/src \
95 external/zlib \
Ian Rogers6f3dbba2014-10-14 17:41:57 -070096
Andreas Gampe4382f1e2015-08-05 01:08:53 +000097# We optimize Thread::Current() with a direct TLS access. This requires access to a private
98# Bionic header.
99# Note: technically we only need this on device, but this avoids the duplication of the includes.
100ART_C_INCLUDES += bionic/libc/private
101
Colin Crossecf75a62016-07-28 16:01:42 -0700102art_cflags :=
103
104# Warn about thread safety violations with clang.
105art_cflags += -Wthread-safety -Wthread-safety-negative
106
107# Warn if switch fallthroughs aren't annotated.
108art_cflags += -Wimplicit-fallthrough
109
110# Enable float equality warnings.
111art_cflags += -Wfloat-equal
112
113# Enable warning of converting ints to void*.
114art_cflags += -Wint-to-void-pointer-cast
115
116# Enable warning of wrong unused annotations.
117art_cflags += -Wused-but-marked-unused
118
119# Enable warning for deprecated language features.
120art_cflags += -Wdeprecated
121
122# Enable warning for unreachable break & return.
123art_cflags += -Wunreachable-code-break -Wunreachable-code-return
124
125# Bug: http://b/29823425 Disable -Wconstant-conversion and
126# -Wundefined-var-template for Clang update to r271374
127art_cflags += -Wno-constant-conversion -Wno-undefined-var-template
128
129# Enable missing-noreturn only on non-Mac. As lots of things are not implemented for Apple, it's
130# a pain.
131ifneq ($(HOST_OS),darwin)
132 art_cflags += -Wmissing-noreturn
133endif
134
Ian Rogers6f3dbba2014-10-14 17:41:57 -0700135# Base set of cflags used by all things ART.
Colin Crossecf75a62016-07-28 16:01:42 -0700136art_cflags += \
Ian Rogers6f3dbba2014-10-14 17:41:57 -0700137 -fno-rtti \
Ian Rogers6f3dbba2014-10-14 17:41:57 -0700138 -ggdb3 \
139 -Wall \
140 -Werror \
141 -Wextra \
Ian Rogers6f3dbba2014-10-14 17:41:57 -0700142 -Wstrict-aliasing \
143 -fstrict-aliasing \
144 -Wunreachable-code \
Andreas Gampe277ccbd2014-11-03 21:36:10 -0800145 -Wredundant-decls \
146 -Wshadow \
Andreas Gampe7c3952f2015-02-19 18:21:24 -0800147 -Wunused \
Ian Rogers6f3dbba2014-10-14 17:41:57 -0700148 -fvisibility=protected \
149 $(art_default_gc_type_cflags)
150
Alex Light50fa9932015-08-10 15:30:07 -0700151# The architectures the compiled tools are able to run on. Setting this to 'all' will cause all
152# architectures to be included.
Colin Crossff46c7d2016-08-18 13:49:53 -0700153ART_TARGET_CODEGEN_ARCHS ?= svelte
Alex Light50fa9932015-08-10 15:30:07 -0700154ART_HOST_CODEGEN_ARCHS ?= all
155
156ifeq ($(ART_TARGET_CODEGEN_ARCHS),all)
157 ART_TARGET_CODEGEN_ARCHS := $(sort $(ART_TARGET_SUPPORTED_ARCH) $(ART_HOST_SUPPORTED_ARCH))
Alex Light50fa9932015-08-10 15:30:07 -0700158else
Alex Light50fa9932015-08-10 15:30:07 -0700159 ifeq ($(ART_TARGET_CODEGEN_ARCHS),svelte)
160 ART_TARGET_CODEGEN_ARCHS := $(sort $(ART_TARGET_ARCH_64) $(ART_TARGET_ARCH_32))
161 endif
162endif
163ifeq ($(ART_HOST_CODEGEN_ARCHS),all)
164 ART_HOST_CODEGEN_ARCHS := $(sort $(ART_TARGET_SUPPORTED_ARCH) $(ART_HOST_SUPPORTED_ARCH))
Alex Light50fa9932015-08-10 15:30:07 -0700165else
Alex Light50fa9932015-08-10 15:30:07 -0700166 ifeq ($(ART_HOST_CODEGEN_ARCHS),svelte)
167 ART_HOST_CODEGEN_ARCHS := $(sort $(ART_TARGET_CODEGEN_ARCHS) $(ART_HOST_ARCH_64) $(ART_HOST_ARCH_32))
168 endif
169endif
170
171ifneq (,$(filter arm64,$(ART_TARGET_CODEGEN_ARCHS)))
172 ART_TARGET_CODEGEN_ARCHS += arm
173endif
174ifneq (,$(filter mips64,$(ART_TARGET_CODEGEN_ARCHS)))
175 ART_TARGET_CODEGEN_ARCHS += mips
176endif
177ifneq (,$(filter x86_64,$(ART_TARGET_CODEGEN_ARCHS)))
178 ART_TARGET_CODEGEN_ARCHS += x86
179endif
180ART_TARGET_CODEGEN_ARCHS := $(sort $(ART_TARGET_CODEGEN_ARCHS))
181ifneq (,$(filter arm64,$(ART_HOST_CODEGEN_ARCHS)))
182 ART_HOST_CODEGEN_ARCHS += arm
183endif
184ifneq (,$(filter mips64,$(ART_HOST_CODEGEN_ARCHS)))
185 ART_HOST_CODEGEN_ARCHS += mips
186endif
187ifneq (,$(filter x86_64,$(ART_HOST_CODEGEN_ARCHS)))
188 ART_HOST_CODEGEN_ARCHS += x86
189endif
190ART_HOST_CODEGEN_ARCHS := $(sort $(ART_HOST_CODEGEN_ARCHS))
191
192# Base set of cflags used by target build only
193art_target_cflags := \
194 $(foreach target_arch,$(strip $(ART_TARGET_CODEGEN_ARCHS)), -DART_ENABLE_CODEGEN_$(target_arch))
195# Base set of cflags used by host build only
196art_host_cflags := \
197 $(foreach host_arch,$(strip $(ART_HOST_CODEGEN_ARCHS)), -DART_ENABLE_CODEGEN_$(host_arch))
198
Roland Levillain12bd7212015-06-04 17:50:27 +0100199# Base set of asflags used by all things ART.
200art_asflags :=
201
Andreas Gampe277ccbd2014-11-03 21:36:10 -0800202# Missing declarations: too many at the moment, as we use "extern" quite a bit.
203# -Wmissing-declarations \
204
205
Mathieu Chartiercd195fe2014-11-25 18:36:01 -0800206
207ifdef ART_IMT_SIZE
208 art_cflags += -DIMT_SIZE=$(ART_IMT_SIZE)
209else
Matthew Gharrity013e3f32016-06-16 11:49:23 -0700210 # Default is 43
211 art_cflags += -DIMT_SIZE=43
Mathieu Chartiercd195fe2014-11-25 18:36:01 -0800212endif
213
Hiroshi Yamauchib0d22f12014-12-08 12:08:46 -0800214ifeq ($(ART_HEAP_POISONING),true)
215 art_cflags += -DART_HEAP_POISONING=1
Roland Levillain12bd7212015-06-04 17:50:27 +0100216 art_asflags += -DART_HEAP_POISONING=1
Hiroshi Yamauchib0d22f12014-12-08 12:08:46 -0800217endif
218
Hiroshi Yamauchi2e287752015-10-02 13:41:34 -0700219#
220# Used to change the read barrier type. Valid values are BAKER, BROOKS, TABLELOOKUP.
221# The default is BAKER.
222#
223ART_READ_BARRIER_TYPE ?= BAKER
224
Hiroshi Yamauchic23f0d82015-01-23 17:23:42 -0800225ifeq ($(ART_USE_READ_BARRIER),true)
226 art_cflags += -DART_USE_READ_BARRIER=1
Hiroshi Yamauchi2e287752015-10-02 13:41:34 -0700227 art_cflags += -DART_READ_BARRIER_TYPE_IS_$(ART_READ_BARRIER_TYPE)=1
Roland Levillain12bd7212015-06-04 17:50:27 +0100228 art_asflags += -DART_USE_READ_BARRIER=1
Hiroshi Yamauchi2e287752015-10-02 13:41:34 -0700229 art_asflags += -DART_READ_BARRIER_TYPE_IS_$(ART_READ_BARRIER_TYPE)=1
Hiroshi Yamauchi37ba27a2016-01-26 14:06:14 -0800230
231 # Temporarily override -fstack-protector-strong with -fstack-protector to avoid a major
232 # slowdown with the read barrier config. b/26744236.
233 art_cflags += -fstack-protector
Hiroshi Yamauchic23f0d82015-01-23 17:23:42 -0800234endif
235
Hiroshi Yamauchi79bd2bf2015-03-20 10:28:34 -0700236ifeq ($(ART_USE_TLAB),true)
237 art_cflags += -DART_USE_TLAB=1
238endif
239
Roland Levillain04147ef2016-09-06 11:09:41 +0100240# Are additional statically-linked ART host binaries (dex2oats,
241# oatdumps, etc.) getting built?
242ifeq ($(ART_BUILD_HOST_STATIC),true)
243 art_cflags += -DART_BUILD_HOST_STATIC=1
244endif
245
David Brazdil7b49e6c2016-09-01 11:06:18 +0100246# Temporary flag allowing to disable recent changes in oat file management.
247ifneq ($(ART_ENABLE_VDEX),false)
248 art_cflags += -DART_ENABLE_VDEX
249endif
250
Ian Rogers6f3dbba2014-10-14 17:41:57 -0700251# Cflags for non-debug ART and ART tools.
Ian Rogersafd9acc2014-06-17 08:21:54 -0700252art_non_debug_cflags := \
Alex Light8069d9f2015-10-14 16:21:17 -0700253 $(ART_NDEBUG_OPT_FLAG)
Ian Rogersafd9acc2014-06-17 08:21:54 -0700254
Ian Rogers6f3dbba2014-10-14 17:41:57 -0700255# Cflags for debug ART and ART tools.
256art_debug_cflags := \
Alex Light8069d9f2015-10-14 16:21:17 -0700257 $(ART_DEBUG_OPT_FLAG) \
Ian Rogers6f3dbba2014-10-14 17:41:57 -0700258 -DDYNAMIC_ANNOTATIONS_ENABLED=1 \
Alexandre Rames2ea91532016-08-11 17:04:14 +0100259 -DVIXL_DEBUG \
Ian Rogers50fe6da2014-10-17 01:18:08 -0700260 -UNDEBUG
Stephen Hines67a43382014-07-17 01:49:18 -0700261
Roland Levillainb5390f72016-07-04 16:59:53 +0100262# Assembler flags for non-debug ART and ART tools.
263art_non_debug_asflags :=
264
265# Assembler flags for debug ART and ART tools.
266art_debug_asflags := -UNDEBUG
267
Ian Rogers6f3dbba2014-10-14 17:41:57 -0700268art_host_non_debug_cflags := $(art_non_debug_cflags)
269art_target_non_debug_cflags := $(art_non_debug_cflags)
Stephen Hines67a43382014-07-17 01:49:18 -0700270
Andreas Gamped1262282016-08-11 18:35:58 -0700271###
272# Frame size
273###
274
275# Size of the stack-overflow gap.
276ART_STACK_OVERFLOW_GAP_arm := 8192
277ART_STACK_OVERFLOW_GAP_arm64 := 8192
278ART_STACK_OVERFLOW_GAP_mips := 16384
279ART_STACK_OVERFLOW_GAP_mips64 := 16384
280ART_STACK_OVERFLOW_GAP_x86 := 8192
281ART_STACK_OVERFLOW_GAP_x86_64 := 8192
282ART_COMMON_STACK_OVERFLOW_DEFINES := \
283 -DART_STACK_OVERFLOW_GAP_arm=$(ART_STACK_OVERFLOW_GAP_arm) \
284 -DART_STACK_OVERFLOW_GAP_arm64=$(ART_STACK_OVERFLOW_GAP_arm64) \
285 -DART_STACK_OVERFLOW_GAP_mips=$(ART_STACK_OVERFLOW_GAP_mips) \
286 -DART_STACK_OVERFLOW_GAP_mips64=$(ART_STACK_OVERFLOW_GAP_mips64) \
287 -DART_STACK_OVERFLOW_GAP_x86=$(ART_STACK_OVERFLOW_GAP_x86) \
288 -DART_STACK_OVERFLOW_GAP_x86_64=$(ART_STACK_OVERFLOW_GAP_x86_64) \
289
Andreas Gampeb41928d2016-08-11 21:11:59 -0700290# Keep these as small as possible. We have separate values as we have some host vs target
291# specific code (and previously GCC vs Clang).
292ART_HOST_FRAME_SIZE_LIMIT := 1736
Andreas Gamped1262282016-08-11 18:35:58 -0700293ART_TARGET_FRAME_SIZE_LIMIT := 1736
294
295# Frame size adaptations for instrumented builds.
296ifdef SANITIZE_TARGET
297 ART_TARGET_FRAME_SIZE_LIMIT := 6400
298endif
299
300# Add frame-size checks for non-debug builds.
Ian Rogersafd9acc2014-06-17 08:21:54 -0700301ifeq ($(HOST_OS),linux)
Dan Albert31fb2602014-09-30 22:10:10 -0700302 ifneq ($(ART_COVERAGE),true)
303 ifneq ($(NATIVE_COVERAGE),true)
Andreas Gamped1262282016-08-11 18:35:58 -0700304 art_host_non_debug_cflags += -Wframe-larger-than=$(ART_HOST_FRAME_SIZE_LIMIT)
305 art_target_non_debug_cflags += -Wframe-larger-than=$(ART_TARGET_FRAME_SIZE_LIMIT)
Dan Albert31fb2602014-09-30 22:10:10 -0700306 endif
Dan Albert98b8bcf2014-11-14 19:56:21 -0800307 endif
Ian Rogersafd9acc2014-06-17 08:21:54 -0700308endif
309
Andreas Gamped1262282016-08-11 18:35:58 -0700310
Colin Crossecf75a62016-07-28 16:01:42 -0700311ART_HOST_CFLAGS := $(art_cflags)
312ART_TARGET_CFLAGS := $(art_cflags)
313
314ART_HOST_ASFLAGS := $(art_asflags)
315ART_TARGET_ASFLAGS := $(art_asflags)
316
317# Bug: 15446488. We don't omit the frame pointer to work around
318# clang/libunwind bugs that cause SEGVs in run-test-004-ThreadStress.
319ART_HOST_CFLAGS += -fno-omit-frame-pointer
320
Ying Wanga28ff0f2014-12-08 14:29:34 -0800321ifndef LIBART_IMG_HOST_BASE_ADDRESS
322 $(error LIBART_IMG_HOST_BASE_ADDRESS unset)
Ian Rogersafd9acc2014-06-17 08:21:54 -0700323endif
Colin Crossecf75a62016-07-28 16:01:42 -0700324ART_HOST_CFLAGS += -DART_BASE_ADDRESS=$(LIBART_IMG_HOST_BASE_ADDRESS)
Colin Cross802d5982016-08-17 16:52:08 -0700325ART_HOST_CFLAGS += $(art_host_cflags)
Ying Wanga28ff0f2014-12-08 14:29:34 -0800326
Andreas Gamped1262282016-08-11 18:35:58 -0700327ART_HOST_CFLAGS += -DART_FRAME_SIZE_LIMIT=$(ART_HOST_FRAME_SIZE_LIMIT) \
328 $(ART_COMMON_STACK_OVERFLOW_DEFINES)
329
330
Ying Wanga28ff0f2014-12-08 14:29:34 -0800331ifndef LIBART_IMG_TARGET_BASE_ADDRESS
332 $(error LIBART_IMG_TARGET_BASE_ADDRESS unset)
333endif
Bilyan Borisov3071f802016-03-31 17:15:53 +0100334
Colin Crossecf75a62016-07-28 16:01:42 -0700335ART_TARGET_CFLAGS += -DART_TARGET \
Bilyan Borisov3071f802016-03-31 17:15:53 +0100336 -DART_BASE_ADDRESS=$(LIBART_IMG_TARGET_BASE_ADDRESS) \
337
Andreas Gamped1262282016-08-11 18:35:58 -0700338ART_TARGET_CFLAGS += -DART_FRAME_SIZE_LIMIT=$(ART_TARGET_FRAME_SIZE_LIMIT) \
339 $(ART_COMMON_STACK_OVERFLOW_DEFINES)
340
Bilyan Borisov3071f802016-03-31 17:15:53 +0100341ifeq ($(ART_TARGET_LINUX),true)
342# Setting ART_TARGET_LINUX to true compiles art/ assuming that the target device
343# will be running linux rather than android.
344ART_TARGET_CFLAGS += -DART_TARGET_LINUX
345else
Bilyan Borisovbb661c02016-04-04 16:27:32 +0100346# The ART_TARGET_ANDROID macro is passed to target builds, which check
347# against it instead of against __ANDROID__ (which is provided by target
348# toolchains).
Bilyan Borisov3071f802016-03-31 17:15:53 +0100349ART_TARGET_CFLAGS += -DART_TARGET_ANDROID
350endif
Bilyan Borisovbb661c02016-04-04 16:27:32 +0100351
Alex Light50fa9932015-08-10 15:30:07 -0700352ART_TARGET_CFLAGS += $(art_target_cflags)
Alex Lighta59dd802014-07-02 16:28:08 -0700353
Ian Rogers6f3dbba2014-10-14 17:41:57 -0700354ART_HOST_NON_DEBUG_CFLAGS := $(art_host_non_debug_cflags)
355ART_TARGET_NON_DEBUG_CFLAGS := $(art_target_non_debug_cflags)
356ART_HOST_DEBUG_CFLAGS := $(art_debug_cflags)
357ART_TARGET_DEBUG_CFLAGS := $(art_debug_cflags)
358
Roland Levillainb5390f72016-07-04 16:59:53 +0100359ART_HOST_NON_DEBUG_ASFLAGS := $(art_non_debug_asflags)
360ART_TARGET_NON_DEBUG_ASFLAGS := $(art_non_debug_asflags)
361ART_HOST_DEBUG_ASFLAGS := $(art_debug_asflags)
362ART_TARGET_DEBUG_ASFLAGS := $(art_debug_asflags)
363
Alex Lighta59dd802014-07-02 16:28:08 -0700364ifndef LIBART_IMG_HOST_MIN_BASE_ADDRESS_DELTA
365 LIBART_IMG_HOST_MIN_BASE_ADDRESS_DELTA=-0x1000000
366endif
367ifndef LIBART_IMG_HOST_MAX_BASE_ADDRESS_DELTA
368 LIBART_IMG_HOST_MAX_BASE_ADDRESS_DELTA=0x1000000
369endif
370ART_HOST_CFLAGS += -DART_BASE_ADDRESS_MIN_DELTA=$(LIBART_IMG_HOST_MIN_BASE_ADDRESS_DELTA)
371ART_HOST_CFLAGS += -DART_BASE_ADDRESS_MAX_DELTA=$(LIBART_IMG_HOST_MAX_BASE_ADDRESS_DELTA)
372
373ifndef LIBART_IMG_TARGET_MIN_BASE_ADDRESS_DELTA
374 LIBART_IMG_TARGET_MIN_BASE_ADDRESS_DELTA=-0x1000000
375endif
376ifndef LIBART_IMG_TARGET_MAX_BASE_ADDRESS_DELTA
377 LIBART_IMG_TARGET_MAX_BASE_ADDRESS_DELTA=0x1000000
378endif
379ART_TARGET_CFLAGS += -DART_BASE_ADDRESS_MIN_DELTA=$(LIBART_IMG_TARGET_MIN_BASE_ADDRESS_DELTA)
380ART_TARGET_CFLAGS += -DART_BASE_ADDRESS_MAX_DELTA=$(LIBART_IMG_TARGET_MAX_BASE_ADDRESS_DELTA)
381
Ian Rogersafd9acc2014-06-17 08:21:54 -0700382# To use oprofile_android --callgraph, uncomment this and recompile with "mmm art -B -j16"
383# ART_TARGET_CFLAGS += -fno-omit-frame-pointer -marm -mapcs
384
Ian Rogers6f3dbba2014-10-14 17:41:57 -0700385# Clear locals now they've served their purpose.
386art_cflags :=
Roland Levillain12bd7212015-06-04 17:50:27 +0100387art_asflags :=
Alex Light50fa9932015-08-10 15:30:07 -0700388art_host_cflags :=
389art_target_cflags :=
Ian Rogers6f3dbba2014-10-14 17:41:57 -0700390art_debug_cflags :=
391art_non_debug_cflags :=
Roland Levillainb5390f72016-07-04 16:59:53 +0100392art_debug_asflags :=
393art_non_debug_asflags :=
Ian Rogers6f3dbba2014-10-14 17:41:57 -0700394art_host_non_debug_cflags :=
395art_target_non_debug_cflags :=
Ian Rogers6f3dbba2014-10-14 17:41:57 -0700396art_default_gc_type_cflags :=
397
Ian Rogers6f3dbba2014-10-14 17:41:57 -0700398ART_TARGET_LDFLAGS :=
Ian Rogersafd9acc2014-06-17 08:21:54 -0700399
400# $(1): ndebug_or_debug
401define set-target-local-cflags-vars
402 LOCAL_CFLAGS += $(ART_TARGET_CFLAGS)
Roland Levillain12bd7212015-06-04 17:50:27 +0100403 LOCAL_ASFLAGS += $(ART_TARGET_ASFLAGS)
Dehao Chen997660d2014-07-08 10:00:56 -0700404 LOCAL_LDFLAGS += $(ART_TARGET_LDFLAGS)
Ian Rogersafd9acc2014-06-17 08:21:54 -0700405 art_target_cflags_ndebug_or_debug := $(1)
406 ifeq ($$(art_target_cflags_ndebug_or_debug),debug)
407 LOCAL_CFLAGS += $(ART_TARGET_DEBUG_CFLAGS)
Roland Levillainb5390f72016-07-04 16:59:53 +0100408 LOCAL_ASFLAGS += $(ART_TARGET_DEBUG_ASFLAGS)
Ian Rogersafd9acc2014-06-17 08:21:54 -0700409 else
410 LOCAL_CFLAGS += $(ART_TARGET_NON_DEBUG_CFLAGS)
Roland Levillainb5390f72016-07-04 16:59:53 +0100411 LOCAL_ASFLAGS += $(ART_TARGET_NON_DEBUG_ASFLAGS)
Ian Rogersafd9acc2014-06-17 08:21:54 -0700412 endif
413
Ian Rogersafd9acc2014-06-17 08:21:54 -0700414 # Clear locally used variables.
415 art_target_cflags_ndebug_or_debug :=
416endef
417
Ian Rogers6f3dbba2014-10-14 17:41:57 -0700418# Support for disabling certain builds.
Ian Rogersafd9acc2014-06-17 08:21:54 -0700419ART_BUILD_TARGET := false
420ART_BUILD_HOST := false
421ART_BUILD_NDEBUG := false
422ART_BUILD_DEBUG := false
423ifeq ($(ART_BUILD_TARGET_NDEBUG),true)
424 ART_BUILD_TARGET := true
425 ART_BUILD_NDEBUG := true
426endif
427ifeq ($(ART_BUILD_TARGET_DEBUG),true)
428 ART_BUILD_TARGET := true
429 ART_BUILD_DEBUG := true
430endif
431ifeq ($(ART_BUILD_HOST_NDEBUG),true)
432 ART_BUILD_HOST := true
433 ART_BUILD_NDEBUG := true
434endif
435ifeq ($(ART_BUILD_HOST_DEBUG),true)
436 ART_BUILD_HOST := true
437 ART_BUILD_DEBUG := true
438endif
439
Igor Murashkin37743352014-11-13 14:38:00 -0800440endif # ART_ANDROID_COMMON_BUILD_MK