diff --git a/make/autoconf/flags-other.m4 b/make/autoconf/flags-other.m4 index 5c9155bf661..4391690f8cf 100644 --- a/make/autoconf/flags-other.m4 +++ b/make/autoconf/flags-other.m4 @@ -117,6 +117,12 @@ AC_DEFUN([FLAGS_SETUP_ASFLAGS], JVM_BASIC_ASFLAGS+=" $OS_CFLAGS \ -DMAC_OS_X_VERSION_MAX_ALLOWED=$MACOSX_VERSION_MAX_NODOTS" fi + elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then + if test "x$OPENJDK_TARGET_CPU" = xaarch64; then + JVM_BASIC_ASFLAGS="-nologo" + else + JVM_BASIC_ASFLAGS="-nologo -c" + fi fi ]) diff --git a/make/autoconf/toolchain.m4 b/make/autoconf/toolchain.m4 index 24151ad49e8..3efd2f39dbf 100644 --- a/make/autoconf/toolchain.m4 +++ b/make/autoconf/toolchain.m4 @@ -748,8 +748,16 @@ AC_DEFUN_ONCE([TOOLCHAIN_DETECT_TOOLCHAIN_CORE], elif test "x$TOOLCHAIN_TYPE" != xmicrosoft; then AS="$CC -c" else - # On windows, the assember is "ml.exe" - UTIL_LOOKUP_TOOLCHAIN_PROGS(AS, ml) + if test "x$OPENJDK_TARGET_CPU" = "xaarch64"; then + # On Windows aarch64, the assembler is "armasm64.exe" + UTIL_LOOKUP_TOOLCHAIN_PROGS(AS, armasm64) + elif test "x$OPENJDK_TARGET_CPU_BITS" = "x64"; then + # On Windows x64, the assembler is "ml64.exe" + UTIL_LOOKUP_TOOLCHAIN_PROGS(AS, ml64) + else + # otherwise, the assember is "ml.exe" + UTIL_LOOKUP_TOOLCHAIN_PROGS(AS, ml) + fi fi AC_SUBST(AS) diff --git a/make/common/NativeCompilation.gmk b/make/common/NativeCompilation.gmk index cdab42b9811..6a8b9372efa 100644 --- a/make/common/NativeCompilation.gmk +++ b/make/common/NativeCompilation.gmk @@ -450,15 +450,23 @@ define SetupCompileNativeFileBody # Keep as much as possible on one execution line for best performance # on Windows. No need to save exit code from compilation since # pipefail is always active on Windows. - $$(call ExecuteWithLog, $$@, $$(call MakeCommandRelative, \ - $$($1_COMPILER) -showIncludes $$($1_COMPILE_OPTIONS))) \ - | $(TR) -d '\r' | $(GREP) -v -e "^Note: including file:" \ - -e "^$$($1_FILENAME)$$$$" || test "$$$$?" = "1" ; \ - $(ECHO) $$@: \\ > $$($1_DEPS_FILE) ; \ - $(SED) $(WINDOWS_SHOWINCLUDE_SED_PATTERN) $$($1_OBJ).log \ - | $(SORT) -u >> $$($1_DEPS_FILE) ; \ - $(ECHO) >> $$($1_DEPS_FILE) ; \ - $(SED) $(DEPENDENCY_TARGET_SED_PATTERN) $$($1_DEPS_FILE) > $$($1_DEPS_TARGETS_FILE) + ifeq ($$(filter %.S, $$($1_FILENAME)), ) + $$(call ExecuteWithLog, $$@, $$(call MakeCommandRelative, \ + $$($1_COMPILER) -showIncludes $$($1_COMPILE_OPTIONS))) \ + | $(TR) -d '\r' | $(GREP) -v -e "^Note: including file:" \ + -e "^$$($1_FILENAME)$$$$" || test "$$$$?" = "1" ; \ + $(ECHO) $$@: \\ > $$($1_DEPS_FILE) ; \ + $(SED) $(WINDOWS_SHOWINCLUDE_SED_PATTERN) $$($1_OBJ).log \ + | $(SORT) -u >> $$($1_DEPS_FILE) ; \ + $(ECHO) >> $$($1_DEPS_FILE) ; \ + $(SED) $(DEPENDENCY_TARGET_SED_PATTERN) $$($1_DEPS_FILE) > $$($1_DEPS_TARGETS_FILE) + else + # For assembler calls just run the assembler; no dependency tracking needed + $$(call ExecuteWithLog, $$@, $$(call MakeCommandRelative, \ + $$($1_COMPILER) $$($1_FLAGS) \ + $(CC_OUT_OPTION)$$($1_OBJ) $$($1_SRC_FILE))) \ + | $(TR) -d '\r' | $(GREP) -v -e "Assembling:" || test "$$$$?" = "1" + endif endif endif endef