Allow building .asm files for x86_64 as well
Change-Id: I4b00361fd66e67e8e59349e5705f13b7c18463ac
diff --git a/build/core/build-binary.mk b/build/core/build-binary.mk
index ceb7e67..7de5f29 100644
--- a/build/core/build-binary.mk
+++ b/build/core/build-binary.mk
@@ -347,7 +347,7 @@
# all_source_patterns contains the list of filename patterns that correspond
# to source files recognized by our build system
-ifeq ($(TARGET_ARCH_ABI),x86)
+ifneq ($(filter x86 x86_64, $(TARGET_ARCH_ABI)),)
all_source_extensions := .c .s .S .asm $(LOCAL_CPP_EXTENSION) $(LOCAL_RS_EXTENSION)
else
all_source_extensions := .c .s .S $(LOCAL_CPP_EXTENSION) $(LOCAL_RS_EXTENSION)
@@ -462,7 +462,7 @@
$(call compile-rs-source,$(src),$(call get-rs-scriptc-name,$(src)),$(call get-rs-bc-name,$(src)),$(call get-rs-so-name,$(src)),$(call get-object-name,$(src)),$(RS_COMPAT))\
)
-ifeq ($(TARGET_ARCH_ABI),x86)
+ifneq ($(filter x86 x86_64, $(TARGET_ARCH_ABI)),)
$(foreach src,$(filter %.asm,$(LOCAL_SRC_FILES)), $(call compile-asm-source,$(src),$(call get-object-name,$(src))))
endif
diff --git a/build/core/definitions.mk b/build/core/definitions.mk
index 6204742..e21100d 100644
--- a/build/core/definitions.mk
+++ b/build/core/definitions.mk
@@ -1635,7 +1635,7 @@
$$(LOCAL_ASMFLAGS) \
$$(NDK_APP_ASMFLAGS) \
$$(call host-c-includes,$$($(my)C_INCLUDES)) \
- -f elf32 -m x86
+ $$(if $$(filter x86_64, $$(TARGET_ARCH_ABI)), -f elf64, -f elf32 -m x86)
_TEXT := Assemble $$(call get-src-file-text,$1)
_CC := $$(NDK_CCACHE) $$(TARGET_ASM)