Skip to content

Commit a629424

Browse files
swesongaSendaoYan
authored andcommitted
8365579: ml64.exe is not the right assembler for Windows aarch64
Reviewed-by: jwaters, ihse, erikj
1 parent 1a7ac16 commit a629424

File tree

3 files changed

+18
-5
lines changed

3 files changed

+18
-5
lines changed

make/autoconf/flags-other.m4

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2011, 2025, Oracle and/or its affiliates. All rights reserved.
33
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
#
55
# This code is free software; you can redistribute it and/or modify it
@@ -115,7 +115,11 @@ AC_DEFUN([FLAGS_SETUP_ASFLAGS],
115115
# Force preprocessor to run, just to make sure
116116
BASIC_ASFLAGS="-x assembler-with-cpp"
117117
elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
118-
BASIC_ASFLAGS="-nologo -c"
118+
if test "x$OPENJDK_TARGET_CPU" = xaarch64; then
119+
BASIC_ASFLAGS="-nologo"
120+
else
121+
BASIC_ASFLAGS="-nologo -c"
122+
fi
119123
fi
120124
AC_SUBST(BASIC_ASFLAGS)
121125

make/autoconf/toolchain.m4

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -655,8 +655,11 @@ AC_DEFUN_ONCE([TOOLCHAIN_DETECT_TOOLCHAIN_CORE],
655655
if test "x$TOOLCHAIN_TYPE" != xmicrosoft; then
656656
AS="$CC -c"
657657
else
658-
if test "x$OPENJDK_TARGET_CPU_BITS" = "x64"; then
659-
# On 64 bit windows, the assembler is "ml64.exe"
658+
if test "x$OPENJDK_TARGET_CPU" = "xaarch64"; then
659+
# On Windows aarch64, the assembler is "armasm64.exe"
660+
UTIL_LOOKUP_TOOLCHAIN_PROGS(AS, armasm64)
661+
elif test "x$OPENJDK_TARGET_CPU_BITS" = "x64"; then
662+
# On Windows x64, the assembler is "ml64.exe"
660663
UTIL_LOOKUP_TOOLCHAIN_PROGS(AS, ml64)
661664
else
662665
# otherwise, the assembler is "ml.exe"

make/common/native/CompileFile.gmk

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,12 @@ define CreateCompiledNativeFileBody
155155
endif
156156
$1_FLAGS := $$($1_FLAGS) -DASSEMBLY_SRC_FILE='"$$($1_REL_ASM_SRC)"' \
157157
-include $(TOPDIR)/make/data/autoheaders/assemblyprefix.h
158+
else ifeq ($(TOOLCHAIN_TYPE), microsoft)
159+
ifeq ($(OPENJDK_TARGET_CPU), aarch64)
160+
$1_NON_ASM_EXTENSION_FLAG :=
161+
else
162+
$1_NON_ASM_EXTENSION_FLAG := "-Ta"
163+
endif
158164
endif
159165
else ifneq ($$(filter %.cpp %.cc %.mm, $$($1_FILENAME)), )
160166
# Compile as a C++ or Objective-C++ file
@@ -236,7 +242,7 @@ define CreateCompiledNativeFileBody
236242
# For assembler calls just create empty dependency lists
237243
$$(call ExecuteWithLog, $$@, $$(call MakeCommandRelative, \
238244
$$($1_COMPILER) $$($1_FLAGS) \
239-
$(CC_OUT_OPTION)$$($1_OBJ) -Ta $$($1_SRC_FILE))) \
245+
$(CC_OUT_OPTION)$$($1_OBJ) $$($1_NON_ASM_EXTENSION_FLAG) $$($1_SRC_FILE))) \
240246
| $(TR) -d '\r' | $(GREP) -v -e "Assembling:" || test "$$$$?" = "1" ; \
241247
$(ECHO) > $$($1_DEPS_FILE) ; \
242248
$(ECHO) > $$($1_DEPS_TARGETS_FILE)

0 commit comments

Comments
 (0)