Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
c-deps: localize RocksDB's SSE4.2 usage to CRC32C
Previously, RocksDB was compiled with `-msse4.2` across the board. The compiler, unsurprisingly took the liberty of actually emitting SSE4.2 instructions, which could cause `SIGILL` crashes on pre-SSE4.2 CPUs (i.e, CPUs released before ca. November 2008). The only part of RocksDB that really benefits from SSE4.2 instructions, however, is the CRC32C checksum code, which can use the hardware CRC32C instructions provided by SSE4.2. This commit simply removes `-msse4.2` from the RocksDB compile flags, and renables it for the FastCRC32 function only via a GCC attribute. Since FastCRC32 is already properly guarded by a CPUID check, which falls back to a slower implementation at runtime if the CPU does not support SSE4.2, this should get us nearly all of the performance benefits of compiling with `-msse4.2` while still supporting pre-SSE4.2 CPUs. Fixes cockroachdb#15589.
- Loading branch information