From 893c7fcf9fa31a25fcaba4ce8d68618690a3b27b Mon Sep 17 00:00:00 2001 From: Peter Mattis Date: Thu, 14 Jan 2021 09:24:21 -0500 Subject: [PATCH] build: always specify PORTABLE=1 when building RocksDB Something recently changed on the TC agents (presumably usage of a new machine type with a different CPU) so that using `-march=native` when building RocksDB causes AVX512 instructions to be used which are not present on roachprod machines. The result is that binaries built in this way will die with "illegal instruction". RocksDB has a mechanism to disable the use of `-march=native`: pass `PORTABLE=1` to the make command. We were already doing this for release builds. Now we're doing it for all builds. Fixes #58754 Release note: none --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 9f780720a22e..ce9ab66a81d8 100644 --- a/Makefile +++ b/Makefile @@ -638,7 +638,7 @@ $(ROCKSDB_DIR)/Makefile: $(C_DEPS_DIR)/rocksdb-rebuild | bin/.submodules-initial @# NOTE: If you change the CMake flags below, bump the version in @# $(C_DEPS_DIR)/rocksdb-rebuild. See above for rationale. cd $(ROCKSDB_DIR) && CFLAGS+=" $(sse)" && CXXFLAGS+=" $(sse)" && cmake $(xcmake-flags) $(ROCKSDB_SRC_DIR) \ - $(if $(findstring release,$(BUILDTYPE)),-DPORTABLE=ON) -DWITH_GFLAGS=OFF \ + -DPORTABLE=ON -DWITH_GFLAGS=OFF \ -DSNAPPY_LIBRARIES=$(LIBSNAPPY) -DSNAPPY_INCLUDE_DIR="$(SNAPPY_SRC_DIR);$(SNAPPY_DIR)" -DWITH_SNAPPY=ON \ $(if $(use-stdmalloc),,-DJEMALLOC_LIBRARIES=$(LIBJEMALLOC) -DJEMALLOC_INCLUDE_DIR=$(JEMALLOC_DIR)/include -DWITH_JEMALLOC=ON) \ -DCMAKE_BUILD_TYPE=$(if $(ENABLE_ROCKSDB_ASSERTIONS),Debug,Release) \