OSDN Git Service

Fixed and refactored 64b host build
authorAndreas Gampe <agampe@google.com>
Wed, 12 Mar 2014 17:59:26 +0000 (10:59 -0700)
committerAndreas Gampe <agampe@google.com>
Wed, 12 Mar 2014 17:59:26 +0000 (10:59 -0700)
Add a global variable ART_HOST_ARCH in build/Android.common.mk that
will be set to x86 or x86_64 depending on BUILD_HOST_64bit. This is
then used as the instruction set for dex2oat.

Change-Id: Icec8ef9139f780314a3ff325a729750e65d6d8da

build/Android.common.mk
build/Android.oat.mk
test/Android.mk

index f22eb37..30f730c 100644 (file)
@@ -37,6 +37,12 @@ ART_BUILD_TARGET_DEBUG ?= true
 ART_BUILD_HOST_NDEBUG ?= $(WITH_HOST_DALVIK)
 ART_BUILD_HOST_DEBUG ?= $(WITH_HOST_DALVIK)
 
+ifeq ($(BUILD_HOST_64bit),)
+ART_HOST_ARCH := x86
+else
+ART_HOST_ARCH := x86_64
+endif
+
 ifeq ($(ART_BUILD_TARGET_NDEBUG),false)
 $(info Disabling ART_BUILD_TARGET_NDEBUG)
 endif
index 6012421..def585b 100644 (file)
@@ -40,19 +40,13 @@ TARGET_CORE_IMG_OUT := $(ART_TEST_OUT)/core.art
 
 TARGET_INSTRUCTION_SET_FEATURES := $(DEX2OAT_TARGET_INSTRUCTION_SET_FEATURES)
 
-ifeq ($(BUILD_HOST_64bit),)
-host_arch := x86
-else
-host_arch := x86_64
-endif
-
 $(HOST_CORE_IMG_OUT): $(HOST_CORE_DEX_FILES) $(DEX2OAT_DEPENDENCY)
        @echo "host dex2oat: $@ ($?)"
        @mkdir -p $(dir $@)
        $(hide) $(DEX2OAT) --runtime-arg -Xms16m --runtime-arg -Xmx16m --image-classes=$(PRELOADED_CLASSES) $(addprefix \
                --dex-file=,$(HOST_CORE_DEX_FILES)) $(addprefix --dex-location=,$(HOST_CORE_DEX_LOCATIONS)) --oat-file=$(HOST_CORE_OAT_OUT) \
                --oat-location=$(HOST_CORE_OAT) --image=$(HOST_CORE_IMG_OUT) --base=$(LIBART_IMG_HOST_BASE_ADDRESS) \
-               --instruction-set=$(host_arch) --host --android-root=$(HOST_OUT)
+               --instruction-set=$(ART_HOST_ARCH) --host --android-root=$(HOST_OUT)
 
 $(TARGET_CORE_IMG_OUT): $(TARGET_CORE_DEX_FILES) $(DEX2OAT_DEPENDENCY)
        @echo "target dex2oat: $@ ($?)"
index f4a0426..bae4680 100644 (file)
@@ -115,7 +115,7 @@ test-art-target-oat-$(1): $(ART_TEST_OUT)/oat-test-dex-$(1).jar test-art-target-
        $(hide) rm /tmp/test-art-target-oat-$(1)
 
 $(HOST_OUT_JAVA_LIBRARIES)/oat-test-dex-$(1).odex: $(HOST_OUT_JAVA_LIBRARIES)/oat-test-dex-$(1).jar $(HOST_CORE_IMG_OUT) | $(DEX2OAT)
-       $(DEX2OAT) --runtime-arg -Xms16m --runtime-arg -Xmx16m --boot-image=$(HOST_CORE_IMG_OUT) --dex-file=$(PWD)/$$< --oat-file=$(PWD)/$$@ --instruction-set=$(HOST_ARCH) --host --android-root=$(HOST_OUT)
+       $(DEX2OAT) --runtime-arg -Xms16m --runtime-arg -Xmx16m --boot-image=$(HOST_CORE_IMG_OUT) --dex-file=$(PWD)/$$< --oat-file=$(PWD)/$$@ --instruction-set=$(ART_HOST_ARCH) --host --android-root=$(HOST_OUT)
 
 .PHONY: test-art-host-oat-default-$(1)
 test-art-host-oat-default-$(1): $(HOST_OUT_JAVA_LIBRARIES)/oat-test-dex-$(1).odex test-art-host-dependencies