Skip to content

docs: Add note for building with MSVC - #262

Merged
danilak-G merged 1 commit into
google:mainfrom
khuiqel:msvc-arch-readme
Sep 14, 2026
Merged

danilak-G merged 1 commit into
google:mainfrom
khuiqel:msvc-arch-readme

Conversation

@khuiqel

@khuiqel khuiqel commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

Problem

Due to Snappy's non-standard microarchitecture detection, SNAPPY_HAVE_SSSE3, SNAPPY_HAVE_X86_CRC32, and SNAPPY_HAVE_BMI2 will always be true on MSVC and therefore cause illegal instructions to be produced. For example, _bzhi_u32 in snappy::ExtractLowBytes().

Solution

A full solution would be far too invasive and beyond the scope of this PR, so the temporary solution is to update the README's compilation instructions to inform users of this problem. They can solve this issue by setting SNAPPY_HAVE_SSSE3, SNAPPY_HAVE_X86_CRC32, SNAPPY_HAVE_BMI2, SNAPPY_HAVE_NEON_CRC32, and SNAPPY_HAVE_NEON in their buildsystem while a proper solution is worked on.

For instance, a CPU without BMI2 (but with SSSE3 and CRC32) will fail the BM_UFlat benchmarks and the following tests:

[  FAILED  ] 14 tests, listed below:
[  FAILED  ] CorruptedTest.VerifyCorrupted
[  FAILED  ] Snappy.SimpleTests
[  FAILED  ] Snappy.AppendSelfPatternExtensionEdgeCases
[  FAILED  ] Snappy.AppendSelfPatternExtensionEdgeCasesExhaustive
[  FAILED  ] Snappy.MaxBlowup
[  FAILED  ] Snappy.RandomData
[  FAILED  ] Snappy.CompressionContext
[  FAILED  ] Snappy.CompressionContextStaticWorkspace
[  FAILED  ] Snappy.IOVecSinkEdgeCases
[  FAILED  ] Snappy.IOVecCopyOverflow
[  FAILED  ] Snappy.ZeroOffsetCopy
[  FAILED  ] Snappy.ZeroOffsetCopyValidation
[  FAILED  ] Snappy.LiteralLengthU32Overflow
[  FAILED  ] Snappy.TestBenchmarkFiles

@danilak-G
danilak-G merged commit 40053bb into google:main Sep 14, 2026
29 checks passed
@khuiqel
khuiqel deleted the msvc-arch-readme branch September 15, 2026 03:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants