Skip to content

[Build] Use -msse2 option only for 32-bit Intel#38024

Closed
veblush wants to merge 4 commits intogrpc:masterfrom
veblush:sse2
Closed

[Build] Use -msse2 option only for 32-bit Intel#38024
veblush wants to merge 4 commits intogrpc:masterfrom
veblush:sse2

Conversation

@veblush
Copy link
Copy Markdown
Contributor

@veblush veblush commented Oct 29, 2024

This might not be needed? (From #37976)


Answer to the quesiton above is yes; The -msse2 option remains necessary for gRPC on i686 due to BoringSSL's requirements. However, the existing CMake condition for this option was too broad, potentially including ARM architectures where SSE2 isn't supported, leading to compilation errors. I've refined the condition to specifically target 32-bit x86 architectures.

Furthermore, to ensure accurate architecture detection within our dockerized tests, I've configured x86 tests to utilize the linux32 command. This ensures that uname -a correctly reports i686, allowing gRPC's CMake to identify the architecture and apply the -msse2 option as needed.

It's important to note that RBE overrides the default entrypoint, so RBE-based tests must explicitly invoke linux32 even if the Docker image already has it set.

Fixes #37976

@veblush
Copy link
Copy Markdown
Contributor Author

veblush commented Oct 30, 2024

tools/bazelify_tests/test/runtests_c_linux_dbg_x86_build_only failed complaining

/b/f/w/bazel-out/k8-fastbuild/bin/tools/bazelify_tests/test/runtests_c_linux_dbg_x86_build_only.runfiles/com_github_grpc_grpc/grpc/third_party/boringssl-with-bazel/src/crypto/asn1/../internal.h:261:2: error: #error "x86 assembly requires SSE2. Build with -msse2 (recommended), or disable assembly optimizations with -DOPENSSL_NO_ASM."
  261 | #error \
      |  ^~~~~
make[3]: *** [third_party/boringssl-with-bazel/CMakeFiles/crypto.dir/build.make:717: third_party/boringssl-with-bazel/CMakeFiles/crypto.dir/src/crypto/asn1/a_bitstr.c.o] Error 1

@veblush veblush changed the title [Build] Tried to remove -msse2 option in cmake [Build] Use -msse2 option only for 32-bit Intel Oct 30, 2024
@veblush
Copy link
Copy Markdown
Contributor Author

veblush commented Oct 30, 2024

Solution is to narrow the CMake's condition checking if it's 32-bit x86.

@copybara-service copybara-service bot closed this in 574b19e Nov 4, 2024
@veblush
Copy link
Copy Markdown
Contributor Author

veblush commented Nov 6, 2024

veblush added a commit to veblush/grpc that referenced this pull request Nov 6, 2024
copybara-service bot pushed a commit that referenced this pull request Nov 6, 2024
…)" (#38074)

This reverts commit 574b19e.

<!--

If you know who should review your pull request, please assign it to that
person, otherwise the pull request would get assigned randomly.

If your pull request is for a specific language, please add the appropriate
lang label.

-->

Closes #38074

PiperOrigin-RevId: 693803071
eugeneo pushed a commit to eugeneo/grpc that referenced this pull request Nov 6, 2024
This might not be needed? (From grpc#37976)

- Boringssl commit requiring -msse2: google/boringssl@56d3ad9#diff-f628d148f94bbab9e22a1ad426ccd94311f1fb87bbe5cc533cb85aee18b07a20R248
- gRPC change to add -msse2 grpc#36089

---

Answer to the quesiton above is yes; The -msse2 option remains necessary for gRPC on i686 due to BoringSSL's requirements. However, the existing CMake condition for this option was too broad, potentially including ARM architectures where SSE2 isn't supported, leading to compilation errors. I've refined the condition to specifically target 32-bit x86 architectures.

Furthermore, to ensure accurate architecture detection within our dockerized tests, I've configured x86 tests to utilize the linux32 command. This ensures that uname -a correctly reports i686, allowing gRPC's CMake to identify the architecture and apply the -msse2 option as needed.

It's important to note that RBE overrides the default entrypoint, so RBE-based tests must explicitly invoke linux32 even if the Docker image already has it set.

Fixes grpc#37976

Closes grpc#38024

PiperOrigin-RevId: 693026079
paulosjca pushed a commit to paulosjca/grpc that referenced this pull request Nov 25, 2024
This might not be needed? (From grpc#37976)

- Boringssl commit requiring -msse2: google/boringssl@56d3ad9#diff-f628d148f94bbab9e22a1ad426ccd94311f1fb87bbe5cc533cb85aee18b07a20R248
- gRPC change to add -msse2 grpc#36089

---

Answer to the quesiton above is yes; The -msse2 option remains necessary for gRPC on i686 due to BoringSSL's requirements. However, the existing CMake condition for this option was too broad, potentially including ARM architectures where SSE2 isn't supported, leading to compilation errors. I've refined the condition to specifically target 32-bit x86 architectures.

Furthermore, to ensure accurate architecture detection within our dockerized tests, I've configured x86 tests to utilize the linux32 command. This ensures that uname -a correctly reports i686, allowing gRPC's CMake to identify the architecture and apply the -msse2 option as needed.

It's important to note that RBE overrides the default entrypoint, so RBE-based tests must explicitly invoke linux32 even if the Docker image already has it set.

Fixes grpc#37976

Closes grpc#38024

PiperOrigin-RevId: 693026079
paulosjca pushed a commit to paulosjca/grpc that referenced this pull request Nov 25, 2024
…#38024)" (grpc#38074)

This reverts commit 574b19e.

<!--

If you know who should review your pull request, please assign it to that
person, otherwise the pull request would get assigned randomly.

If your pull request is for a specific language, please add the appropriate
lang label.

-->

Closes grpc#38074

PiperOrigin-RevId: 693803071
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unable to build on 32-bit without SSE2

2 participants