Skip to content

Conversation

@swesonga
Copy link
Contributor

@swesonga swesonga commented Aug 14, 2025

ml64 is set as the assembler for the Windows platform but is specific to the x64 platform. The armasm64 assembler should be used for Windows AArch64.

The -c and -Ta options are only valid for ml64 and -Ta can be removed from CompileFile.gmk (assembling for x64 works without it).


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

  • JDK-8365579: ml64.exe is not the right assembler for Windows aarch64 (Bug - P4)

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/26791/head:pull/26791
$ git checkout pull/26791

Update a local copy of the PR:
$ git checkout pull/26791
$ git pull https://git.openjdk.org/jdk.git pull/26791/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 26791

View PR using the GUI difftool:
$ git pr show -t 26791

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/26791.diff

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Aug 15, 2025

👋 Welcome back swesonga! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link

openjdk bot commented Aug 15, 2025

@swesonga This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

8365579: ml64.exe is not the right assembler for Windows aarch64

Reviewed-by: jwaters, ihse, erikj

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 126 new commits pushed to the master branch:

As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@TheShermanTanker, @erikj79, @magicus) but any other Committer may sponsor as well.

➡️ To flag this PR as ready for integration with the above commit message, type /integrate in a new comment. (Afterwards, your sponsor types /sponsor in a new comment to perform the integration).

@openjdk
Copy link

openjdk bot commented Aug 15, 2025

@swesonga The following label will be automatically applied to this pull request:

  • build

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added build build-dev@openjdk.org rfr Pull request is ready for review labels Aug 15, 2025
@mlbridge
Copy link

mlbridge bot commented Aug 15, 2025

Webrevs

Copy link
Contributor

@TheShermanTanker TheShermanTanker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer if -Ta could be kept somehow but there doesn't seem to be a clean way to do that, so this gets a +1 from me anyway

$$(call ExecuteWithLog, $$@, $$(call MakeCommandRelative, \
$$($1_COMPILER) $$($1_FLAGS) \
$(CC_OUT_OPTION)$$($1_OBJ) -Ta $$($1_SRC_FILE))) \
$(CC_OUT_OPTION)$$($1_OBJ) $$($1_SRC_FILE))) \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you verified that removing -Ta works for the x86 assembler?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you verified that removing -Ta works for the x86 assembler?

Yes, both of these command lines work:

; "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.44.35207\bin\Hostx64\x86\ml.exe" -nologo -c -Fo test_x86_assembler.obj -Ta test_x86_assembler.S
; "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.44.35207\bin\Hostx64\x86\ml.exe" -nologo -c -Fo test_x86_assembler.obj test_x86_assembler.S

TEST_SEG   SEGMENT

   mov eax, ecx

TEST_SEG   ENDS

END

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder why we still have the assembler for 32 bit, as the JDK no longer supports 32 bit Windows ever since Magnus nuked it from the codebase

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder why we still have the assembler for 32 bit, as the JDK no longer supports 32 bit Windows ever since Magnus nuked it from the codebase

I have filed https://bugs.openjdk.org/browse/JDK-8365707 to address that issue

Copy link
Member

@magicus magicus Aug 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this really so? The documentation states:

/Ta filename 	Assembles source file whose name doesn't end with the .asm extension.

We want the compiler to actually do what we tell it to do, even if the files are named .S.

Maybe this behavior has been changed in later versions, but I am a bit wary about removing it unless we have some official confirmation that /Ta is a no-op, and/or information on which version this started to happen.

Comment on lines 661 to 668
else
# otherwise, the assembler is "ml.exe"
UTIL_LOOKUP_TOOLCHAIN_PROGS(AS, ml)
if 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"
UTIL_LOOKUP_TOOLCHAIN_PROGS(AS, ml)
fi
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this would be more readable as an elif with all the cases on the same level rather than nesting the second if/else inside the else block.

Copy link
Contributor

@TheShermanTanker TheShermanTanker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is still ok with me

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Aug 15, 2025
@swesonga
Copy link
Contributor Author

/integrate

@openjdk openjdk bot added the sponsor Pull request is ready to be sponsored label Aug 15, 2025
@openjdk
Copy link

openjdk bot commented Aug 15, 2025

@swesonga
Your change (at version 2ae8f30) is now ready to be sponsored by a Committer.

# 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"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we need to update the copyright year from 2024 to 2025

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, please that would be good.

@openjdk openjdk bot removed sponsor Pull request is ready to be sponsored ready Pull request is ready to be integrated labels Aug 18, 2025
@magicus
Copy link
Member

magicus commented Aug 23, 2025

I'd like to see some more investigation into the removal of -Ta before integration, since it is documented as required.

An alternative to investigation is to keep it for ml64, by creating a new variable exposed to spec.gmk, similar to how cl.exe needs a -out: (or whatever it was called) for where to .obj files.

Copy link
Member

@magicus magicus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd envisioned setting it in configure like other flags, but I guess this works. (I've always been a bit skeptical towards setting compiler "infrastructure" flags from configure, so in the long term I'd like to migrate such flags to make.)

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Aug 25, 2025
@swesonga
Copy link
Contributor Author

/integrate

@openjdk openjdk bot added the sponsor Pull request is ready to be sponsored label Aug 25, 2025
@openjdk
Copy link

openjdk bot commented Aug 25, 2025

@swesonga
Your change (at version 4279637) is now ready to be sponsored by a Committer.

@sendaoYan
Copy link
Member

/sponsor

@openjdk
Copy link

openjdk bot commented Aug 26, 2025

Going to push as commit a629424.
Since your change was applied there have been 126 commits pushed to the master branch:

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Aug 26, 2025
@openjdk openjdk bot closed this Aug 26, 2025
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review sponsor Pull request is ready to be sponsored labels Aug 26, 2025
@openjdk
Copy link

openjdk bot commented Aug 26, 2025

@sendaoYan @swesonga Pushed as commit a629424.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

@TheShermanTanker
Copy link
Contributor

I actually missed this earlier, but I don't believe the quotes around -Ta are needed. It doesn't seem to do any harm though, so I'm not sure if anyone else would want to remove them

@magicus
Copy link
Member

magicus commented Aug 26, 2025

@TheShermanTanker Good point. You are correct; they should not have been there (to follow our style), but they should be harmless (I assume @swesonga tested that it still works with x64).

@swesonga
Copy link
Contributor Author

I actually missed this earlier, but I don't believe the quotes around -Ta are needed. It doesn't seem to do any harm though, so I'm not sure if anyone else would want to remove them

Thanks for catching this. I've filed https://bugs.openjdk.org/browse/JDK-8366195 to clean it up

@swesonga
Copy link
Contributor Author

@TheShermanTanker Good point. You are correct; they should not have been there (to follow our style), but they should be harmless (I assume @swesonga tested that it still works with x64).

Yes, it still works with x64. I'll clean up the quotes in https://bugs.openjdk.org/browse/JDK-8366195 though

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build build-dev@openjdk.org integrated Pull request has been integrated

Development

Successfully merging this pull request may close these issues.

5 participants