Skip to content

Commit

Permalink
Drop -msse4 compiler flag
Browse files Browse the repository at this point in the history
Older CPUs that do not have SSE4.1 would crash with the Ruby native gem
due to an illegal instruction exception.

The Abseil random library isn't being used at the moment
(grpc#26476), and there's no reason gRPC
needs to force SSE4.1 instructions on all platforms at the moment. There
are other hardware-specific issues that need to be ironed out for this
to work: grpc#26479

When the `-msse4` compiler flag was enabled, the Abseil code started
using the `pinsrb` instruction:

```
$ elfx86exts abseil-cpp/absl/time/internal/cctz/src/time_zone_libc.o
MODE64 (ret)
CMOV (cmovne)
SSE2 (movdqa)
SSE41 (pinsrb)
SSE1 (movaps)
CPU Generation: Penryn
```

This was previously needed because gcc 4.8 wouldn't compile without the
`-msse4` and `-maes` flags.

However, per
gcc-mirror/gcc@97db2bf
gcc 5.0+ automatically detects whether these options are enabled.

clang still needs `-maes` since including `wmmintrin.h` expects the AES
option to be enabled.

Closes grpc#27095
  • Loading branch information
stanhu committed Sep 10, 2021
1 parent 8b73897 commit b138803
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Makefile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion templates/Makefile.template
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@
GRPC_ABSEIL_DEP = $(LIBDIR)/$(CONFIG)/libgrpc_abseil.a
GRPC_ABSEIL_MERGE_LIBS = $(LIBDIR)/$(CONFIG)/libgrpc_abseil.a
ifeq ($(HOST_IS_X86_64),true)
ABSL_RANDOM_HWAES_FLAGS = -maes -msse4
ABSL_RANDOM_HWAES_FLAGS = -maes
else
ABSL_RANDOM_HWAES_FLAGS =
endif
Expand Down

0 comments on commit b138803

Please sign in to comment.