[boringssl] Simplify BoringSSL assembly build#33700
Merged
jtattermusch merged 2 commits intogrpc:masterfrom Aug 2, 2023
Merged
[boringssl] Simplify BoringSSL assembly build#33700jtattermusch merged 2 commits intogrpc:masterfrom
jtattermusch merged 2 commits intogrpc:masterfrom
Conversation
BoringSSL's gas-compatible assembly files, like its C files, are now wrapped with preprocessor ifdefs to capture which platforms each file should be enabled on. This means that, provided the platform can process .S files it all (i.e. not Windows), we no longer need to detect the exact CPU architecture in the build. Switch gRPC's build to take advantage of this. I've retained BUILD_OVERRIDE_BORING_SSL_ASM_PLATFORM, on the off chance anyone is using it to cross-compile between Windows and non-Windows, though I doubt that works particularly well. As part of this, restore assembly optimizations in a few places where they were seemingly disabled for issues relating to this: - grpc#31747 had to disable the assembly, because at the time assembly required the library be built differently for each architecture and then stitched back together. This should now work. - tools/run_tests/run_tests.py disabled x86 assembly due to some issues with CMAKE_SYSTEM_PROCESSOR in a Docker image. This too should now be moot.
davidben
commented
Jul 15, 2023
Contributor
Author
|
Okay, ready for another attempt through CI. |
Contributor
Author
|
Looks like CI is clear now! |
Member
gnossen
approved these changes
Aug 1, 2023
Contributor
gnossen
left a comment
There was a problem hiding this comment.
Really happy Apple silicon users will be able to take advantage of assembly optimizations now. Thanks!
jtattermusch
approved these changes
Aug 2, 2023
Contributor
jtattermusch
left a comment
There was a problem hiding this comment.
LGTM, thanks for the improvement!
davidben
added a commit
to google/boringssl
that referenced
this pull request
Aug 8, 2023
The android-cmake one should no longer be needed as of aosp/2673299, and the JSON one as of grpc/grpc#33700 Bug: 542 Change-Id: I3c7b752806d82a5a01b5ad9180771e88d2810b70 Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/62185 Reviewed-by: Adam Langley <agl@google.com> Commit-Queue: Adam Langley <agl@google.com> Auto-Submit: David Benjamin <davidben@google.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
NB: I haven't tested this at all and am hoping the CI will tell me where I've (undoubtedly) messed something up.Edit: looks like CI is now clear!BoringSSL's gas-compatible assembly files, like its C files, are now wrapped with preprocessor ifdefs to capture which platforms each file should be enabled on. This means that, provided the platform can process .S files it all (i.e. not Windows), we no longer need to detect the exact CPU architecture in the build.
Switch gRPC's build to take advantage of this. I've retained BUILD_OVERRIDE_BORING_SSL_ASM_PLATFORM, on the off chance anyone is using it to cross-compile between Windows and non-Windows, though I doubt that works particularly well.
As part of this, restore assembly optimizations in a few places where they were seemingly disabled for issues relating to this:
Build native MacOS arm64 artifacts (universal2) #31747 had to disable the assembly, because at the time assembly required the library be built differently for each architecture and then stitched back together. This should now work.
tools/run_tests/run_tests.py disabled x86 assembly due to some issues with CMAKE_SYSTEM_PROCESSOR in a Docker image. This too should now be moot.