Skip to content

Commit

Permalink
Document hardware extension requirements, add TODO for streamlining them
Browse files Browse the repository at this point in the history
Also fixes a potential build failure for arm64 – the zlib_arm_crc32 target did
not have the required crc32 extension enabled. This did not surface on Apple
Silicon builds as the extension is supported by all Apple Silicon CPUs and
enabled unconditionally.
  • Loading branch information
fhanau committed Aug 29, 2024
1 parent 14888cd commit 1902a59
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ Prebuilt binaries are distributed via `npm`. Run `npx workerd ...` to use these.
* On macOS:
* macOS 11.5 or higher
* The Xcode command line tools, which can be installed with `xcode-select --install`
* x86_64 CPU with at least SSE4.2 and CLMUL ISA extensions, or arm64 CPU with CRC extension (enabled by default under armv8.1-a). These extensions are supported by all recent x86 and arm64 CPUs.

### Local Worker development with `wrangler`

Expand Down
7 changes: 7 additions & 0 deletions build/BUILD.zlib
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,13 @@ cc_library(
"crc32_simd.c",
"crc32_simd.h",
],
# TODO(soon): The canonical GN build adds "-march=armv8-a+aes+crc" here. We could do the same,
# but this may reduce the target CPU level if the compiler defaults to e.g. armv8.5-a. We really
# should compile all of workerd with the same compile options. For now, just specify -mcrc which
# adds CRC instructions to whatever is already defined. The source file still compiles without
# explicitly enabling AES/PMULL extensions as these are used in inline assembly and only enabled
# if support for them is detected at runtime.
copts = ["-mcrc"],
local_defines = [
"CRC32_ARMV8_CRC32",
"ZLIB_IMPLEMENTATION",
Expand Down

0 comments on commit 1902a59

Please sign in to comment.