Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add two new build targets to enable the possibility of using clang-cl as an assembler for Windows on Arm #19523

Closed
wants to merge 1 commit into from

Conversation

everton1984
Copy link
Contributor

Currently it is not possible to use the assembler files for Windows on Arm as there is no NASM for aarch64. This patch makes the appropriate changes to use clang-cl as an assembler along with the possibility of also using it as a compiler. Forcibly adding __ASSEMBLER__ was required as cl does not add it by itself.

@openssl-machine openssl-machine added the hold: cla required The contributor needs to submit a license agreement label Oct 27, 2022
Copy link
Member

@levitte levitte left a comment

Choose a reason for hiding this comment

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

Overall a good effort, thank you. I do have a few smaller nits, though

Configurations/50-win-onecore.conf Outdated Show resolved Hide resolved
Configurations/50-win-onecore.conf Outdated Show resolved Hide resolved
Configurations/windows-makefile.tmpl Outdated Show resolved Hide resolved
Configurations/windows-makefile.tmpl Outdated Show resolved Hide resolved
@@ -82,7 +82,35 @@ my %targets = (
ex_libs => "onecore.lib",
multilib => "-arm64",
},

"VC-WIN64-CLANGASM-ARM" => {
Copy link
Member

Choose a reason for hiding this comment

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

I would rather have your definitions in a separate file, say Configurations/50-win-clang-cl.conf

Copy link
Member

@levitte levitte left a comment

Choose a reason for hiding this comment

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

Another way to look at the whole __ASSEMBLER__ thing

return <<"EOF";
if(($config{CC} !~ /clang-cl/) and ($config{AS} =~ /clang-cl/))
{
return <<"EOF";
Copy link
Member

Choose a reason for hiding this comment

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

This is unnecessary, as the added /D__ASSEMBLER__ can be used with cl.exe too, without harm.

Comment on lines 785 to 793
} else {
return <<"EOF";
$target: "$gen0" $deps
cmd /C "set "ASM=\$(AS)" & $generator \$@.S"
\$(CPP) $incs $cppflags $defs \$@.S > \$@.i
move /Y \$@.i \$@
del /Q \$@.S
EOF
}
Copy link
Member

Choose a reason for hiding this comment

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

This can also be dropped

$target: "$gen0" $deps
cmd /C "set "ASM=\$(AS)" & $generator \$@.S"
\$(CPP) $incs $cppflags $defs \$@.S > \$@.i
\$(CPP) /D__ASSEMBLER__ /E $incs $cppflags $defs \$@.S > \$@.i
Copy link
Member

Choose a reason for hiding this comment

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

Drop /E, as it's already present (well, /EP is...). Also, don't convert the initial TAB to spaces.

@everton1984 everton1984 force-pushed the clclang_cl branch 3 times, most recently from 6ef59ec to 3c8d25d Compare October 31, 2022 20:11
@everton1984
Copy link
Contributor Author

@levitte Hi! Think I covered all the changes you mentioned, hopefully. Thanks a lot for the review. If you could be so kind to take a look and see what you think while I figure out how to sort the CLA issue.

@t8m t8m added branch: master Merge to master branch triaged: feature The issue/pr requests/adds a feature branch: 3.1 Merge to openssl-3.1 labels Nov 1, 2022
@everton1984
Copy link
Contributor Author

@levitte Do you have further comments for this PR please? Thanks a lot for all the comments.

@paulidale paulidale added approval: review pending This pull request needs review by a committer tests: exempted The PR is exempt from requirements for testing labels Nov 22, 2022
@t8m
Copy link
Member

t8m commented Nov 22, 2022

This needs to be rebased on top of fresh master branch.

an assembler for Windows on Arm builds and also clang-cl as the compiler
as well. Make appropriate changes to armcap source and peralsm scripts.
@openssl-machine openssl-machine removed the hold: cla required The contributor needs to submit a license agreement label Nov 22, 2022
@everton1984
Copy link
Contributor Author

@t8m Just rebased and retested. Thanks.

@t8m t8m requested a review from levitte November 22, 2022 15:57
@t8m
Copy link
Member

t8m commented Nov 22, 2022

@paulidale still OK?

@paulidale paulidale added approval: done This pull request has the required number of approvals and removed approval: review pending This pull request needs review by a committer labels Nov 23, 2022
@openssl-machine openssl-machine added approval: ready to merge The 24 hour grace period has passed, ready to merge and removed approval: done This pull request has the required number of approvals labels Nov 24, 2022
@openssl-machine
Copy link
Collaborator

This pull request is ready to merge

@hlandau
Copy link
Member

hlandau commented Nov 24, 2022

Merged to master and 3.1. Thank you.

@hlandau hlandau closed this Nov 24, 2022
openssl-machine pushed a commit that referenced this pull request Nov 24, 2022
an assembler for Windows on Arm builds and also clang-cl as the compiler
as well. Make appropriate changes to armcap source and peralsm scripts.

Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Hugo Landau <hlandau@openssl.org>
(Merged from #19523)
openssl-machine pushed a commit that referenced this pull request Nov 24, 2022
an assembler for Windows on Arm builds and also clang-cl as the compiler
as well. Make appropriate changes to armcap source and peralsm scripts.

Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Hugo Landau <hlandau@openssl.org>
(Merged from #19523)

(cherry picked from commit b863e1e)
beldmit pushed a commit to beldmit/openssl that referenced this pull request Dec 26, 2022
an assembler for Windows on Arm builds and also clang-cl as the compiler
as well. Make appropriate changes to armcap source and peralsm scripts.

Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Hugo Landau <hlandau@openssl.org>
(Merged from openssl#19523)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approval: ready to merge The 24 hour grace period has passed, ready to merge branch: master Merge to master branch branch: 3.1 Merge to openssl-3.1 tests: exempted The PR is exempt from requirements for testing triaged: feature The issue/pr requests/adds a feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants