From a8b1b5914e4b7152374dda7ec5be84f03c977e4c Mon Sep 17 00:00:00 2001 From: Saint Wesonga Date: Tue, 26 Aug 2025 01:13:56 +0000 Subject: [PATCH 1/2] 8365579: ml64.exe is not the right assembler for Windows aarch64 Reviewed-by: jwaters, ihse, erikj --- make/autoconf/flags-other.m4 | 8 ++++++-- make/autoconf/flags.m4 | 4 ++++ make/autoconf/spec.gmk.template | 1 + make/autoconf/toolchain.m4 | 7 +++++-- make/common/native/CompileFile.gmk | 2 +- 5 files changed, 17 insertions(+), 5 deletions(-) diff --git a/make/autoconf/flags-other.m4 b/make/autoconf/flags-other.m4 index f0fa82489df..9d41cf04791 100644 --- a/make/autoconf/flags-other.m4 +++ b/make/autoconf/flags-other.m4 @@ -1,5 +1,5 @@ # -# Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2025, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -115,7 +115,11 @@ AC_DEFUN([FLAGS_SETUP_ASFLAGS], # Force preprocessor to run, just to make sure BASIC_ASFLAGS="-x assembler-with-cpp" elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then - BASIC_ASFLAGS="-nologo -c" + if test "x$OPENJDK_TARGET_CPU" = xaarch64; then + BASIC_ASFLAGS="-nologo" + else + BASIC_ASFLAGS="-nologo -c" + fi fi AC_SUBST(BASIC_ASFLAGS) diff --git a/make/autoconf/flags.m4 b/make/autoconf/flags.m4 index d50538108a4..c810d15ebbc 100644 --- a/make/autoconf/flags.m4 +++ b/make/autoconf/flags.m4 @@ -320,12 +320,16 @@ AC_DEFUN([FLAGS_SETUP_TOOLCHAIN_CONTROL], [ if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then CC_OUT_OPTION=-Fo + if test "x$OPENJDK_TARGET_CPU" != xaarch64; then + AS_NON_ASM_EXTENSION_OPTION=-Ta + fi else # The option used to specify the target .o,.a or .so file. # When compiling, how to specify the to be created object file. CC_OUT_OPTION='-o$(SPACE)' fi AC_SUBST(CC_OUT_OPTION) + AC_SUBST(AS_NON_ASM_EXTENSION_OPTION) # Generate make dependency files if test "x$TOOLCHAIN_TYPE" = xgcc; then diff --git a/make/autoconf/spec.gmk.template b/make/autoconf/spec.gmk.template index e720916d88a..b6cf3e1c595 100644 --- a/make/autoconf/spec.gmk.template +++ b/make/autoconf/spec.gmk.template @@ -493,6 +493,7 @@ CXX_VERSION_NUMBER := @CXX_VERSION_NUMBER@ HOTSPOT_TOOLCHAIN_TYPE := @HOTSPOT_TOOLCHAIN_TYPE@ CC_OUT_OPTION := @CC_OUT_OPTION@ +AS_NON_ASM_EXTENSION_OPTION := @AS_NON_ASM_EXTENSION_OPTION@ # Flags used for overriding the default opt setting for a C/C++ source file. C_O_FLAG_HIGHEST_JVM := @C_O_FLAG_HIGHEST_JVM@ diff --git a/make/autoconf/toolchain.m4 b/make/autoconf/toolchain.m4 index b7a01074686..f3ef44d382b 100644 --- a/make/autoconf/toolchain.m4 +++ b/make/autoconf/toolchain.m4 @@ -655,8 +655,11 @@ AC_DEFUN_ONCE([TOOLCHAIN_DETECT_TOOLCHAIN_CORE], if test "x$TOOLCHAIN_TYPE" != xmicrosoft; then AS="$CC -c" else - if test "x$OPENJDK_TARGET_CPU_BITS" = "x64"; then - # On 64 bit windows, the assembler is "ml64.exe" + 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 assembler is "ml.exe" diff --git a/make/common/native/CompileFile.gmk b/make/common/native/CompileFile.gmk index 9c3d39d6edf..a8d46949788 100644 --- a/make/common/native/CompileFile.gmk +++ b/make/common/native/CompileFile.gmk @@ -236,7 +236,7 @@ define CreateCompiledNativeFileBody # For assembler calls just create empty dependency lists $$(call ExecuteWithLog, $$@, $$(call MakeCommandRelative, \ $$($1_COMPILER) $$($1_FLAGS) \ - $(CC_OUT_OPTION)$$($1_OBJ) -Ta $$($1_SRC_FILE))) \ + $(CC_OUT_OPTION)$$($1_OBJ) $(AS_NON_ASM_EXTENSION_OPTION) $$($1_SRC_FILE))) \ | $(TR) -d '\r' | $(GREP) -v -e "Assembling:" || test "$$$$?" = "1" ; \ $(ECHO) > $$($1_DEPS_FILE) ; \ $(ECHO) > $$($1_DEPS_TARGETS_FILE) From ff4f2a70bfb3f49fe29117a3ab9dc95a0b5f5301 Mon Sep 17 00:00:00 2001 From: Anton Voznia Date: Mon, 9 Feb 2026 14:48:18 +0100 Subject: [PATCH 2/2] Update copyrights. --- make/autoconf/flags-other.m4 | 2 +- make/autoconf/flags.m4 | 2 +- make/autoconf/spec.gmk.template | 2 +- make/autoconf/toolchain.m4 | 2 +- make/common/native/CompileFile.gmk | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/make/autoconf/flags-other.m4 b/make/autoconf/flags-other.m4 index 9d41cf04791..5629a625736 100644 --- a/make/autoconf/flags-other.m4 +++ b/make/autoconf/flags-other.m4 @@ -1,5 +1,5 @@ # -# Copyright (c) 2011, 2025, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2026, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it diff --git a/make/autoconf/flags.m4 b/make/autoconf/flags.m4 index c810d15ebbc..5bb999bc05f 100644 --- a/make/autoconf/flags.m4 +++ b/make/autoconf/flags.m4 @@ -1,5 +1,5 @@ # -# Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2026, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it diff --git a/make/autoconf/spec.gmk.template b/make/autoconf/spec.gmk.template index b6cf3e1c595..2364fc81fed 100644 --- a/make/autoconf/spec.gmk.template +++ b/make/autoconf/spec.gmk.template @@ -1,5 +1,5 @@ # -# Copyright (c) 2011, 2025, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2026, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it diff --git a/make/autoconf/toolchain.m4 b/make/autoconf/toolchain.m4 index f3ef44d382b..24577876e45 100644 --- a/make/autoconf/toolchain.m4 +++ b/make/autoconf/toolchain.m4 @@ -1,5 +1,5 @@ # -# Copyright (c) 2011, 2025, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2026, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it diff --git a/make/common/native/CompileFile.gmk b/make/common/native/CompileFile.gmk index a8d46949788..cf33c64f21e 100644 --- a/make/common/native/CompileFile.gmk +++ b/make/common/native/CompileFile.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2011, 2025, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2026, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it