Patch for compiling art to run on linux target
This patch extends the build system to compile art for an aarch64
linux target.
Change-Id: If7fa10fcbb2a6e02a969f244be6e8354e36b6873
diff --git a/build/Android.common_build.mk b/build/Android.common_build.mk
index dde3cdb..0235a30 100644
--- a/build/Android.common_build.mk
+++ b/build/Android.common_build.mk
@@ -363,11 +363,20 @@
ifndef LIBART_IMG_TARGET_BASE_ADDRESS
$(error LIBART_IMG_TARGET_BASE_ADDRESS unset)
endif
+
+ART_TARGET_CFLAGS += $(art_cflags) -DART_TARGET \
+ -DART_BASE_ADDRESS=$(LIBART_IMG_TARGET_BASE_ADDRESS) \
+
+ifeq ($(ART_TARGET_LINUX),true)
+# Setting ART_TARGET_LINUX to true compiles art/ assuming that the target device
+# will be running linux rather than android.
+ART_TARGET_CFLAGS += -DART_TARGET_LINUX
+else
# The ART_TARGET_ANDROID macro is passed to target builds, which check
# against it instead of against __ANDROID__ (which is provided by target
# toolchains).
-ART_TARGET_CFLAGS += $(art_cflags) -DART_TARGET -DART_TARGET_ANDROID \
- -DART_BASE_ADDRESS=$(LIBART_IMG_TARGET_BASE_ADDRESS) \
+ART_TARGET_CFLAGS += -DART_TARGET_ANDROID
+endif
ART_TARGET_CFLAGS += $(art_target_cflags)
ART_TARGET_ASFLAGS += $(art_asflags)