Drop ABSL_RANDOM_HWAES_FLAGS compiler flags

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
(https://github.com/grpc/grpc/pull/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: https://github.com/grpc/grpc/pull/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
```

Closes https://github.com/grpc/grpc/issues/27095
pull/27121/head
Stan Hu 4 years ago
parent 6a06f0cd4a
commit 3b7cc74d39
No known key found for this signature in database
GPG Key ID: 8D3931AD39CC7A20
  1. 15
      Makefile
  2. 2
      build_handwritten.yaml
  3. 13
      templates/Makefile.template

15
Makefile generated

@ -34,14 +34,6 @@ ifeq ($(SYSTEM),MINGW64)
SYSTEM = MINGW32
endif
# Basic machine detection
HOST_MACHINE = $(shell uname -m)
ifeq ($(HOST_MACHINE),x86_64)
HOST_IS_X86_64 = true
else
HOST_IS_X86_64 = false
endif
MAKEFILE_PATH := $(abspath $(lastword $(MAKEFILE_LIST)))
ifndef BUILDDIR
BUILDDIR_ABSOLUTE = $(patsubst %/,%,$(dir $(MAKEFILE_PATH)))
@ -578,11 +570,6 @@ CPPFLAGS := -Ithird_party/address_sorting/include $(CPPFLAGS)
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
else
ABSL_RANDOM_HWAES_FLAGS =
endif
# Setup re2 dependency
@ -2680,7 +2667,7 @@ LIBGRPC_ABSEIL_SRC = \
LIBGRPC_ABSEIL_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(LIBGRPC_ABSEIL_SRC))))
$(LIBGRPC_ABSEIL_OBJS): CPPFLAGS += -g $(ABSL_RANDOM_HWAES_FLAGS) -Ithird_party/abseil-cpp
$(LIBGRPC_ABSEIL_OBJS): CPPFLAGS += -Ithird_party/abseil-cpp
$(LIBDIR)/$(CONFIG)/libgrpc_abseil.a: $(LIBGRPC_ABSEIL_OBJS)
$(E) "[AR] Creating $@"

@ -165,7 +165,7 @@ configs:
UBSAN_OPTIONS: halt_on_error=1:print_stacktrace=1:suppressions=test/core/util/ubsan_suppressions.txt
defaults:
abseil:
CPPFLAGS: -g $(ABSL_RANDOM_HWAES_FLAGS) -Ithird_party/abseil-cpp
CPPFLAGS: -Ithird_party/abseil-cpp
ares:
CFLAGS: -g
CPPFLAGS: -Ithird_party/cares -Ithird_party/cares/cares -fvisibility=hidden -D_GNU_SOURCE

@ -74,14 +74,6 @@
SYSTEM = MINGW32
endif
# Basic machine detection
HOST_MACHINE = $(shell uname -m)
ifeq ($(HOST_MACHINE),x86_64)
HOST_IS_X86_64 = true
else
HOST_IS_X86_64 = false
endif
MAKEFILE_PATH := $(abspath $(lastword $(MAKEFILE_LIST)))
ifndef BUILDDIR
BUILDDIR_ABSOLUTE = $(patsubst %/,%,$(dir $(MAKEFILE_PATH)))
@ -441,11 +433,6 @@
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
else
ABSL_RANDOM_HWAES_FLAGS =
endif
# Setup re2 dependency

Loading…
Cancel
Save