The fork of the crc32 library in contrib makes use of streaming SIMD
instructions where possible. This is achieved via a preprocessor directive, but
short-circuiting of the evaluation previously meant that any use of clang or
GCC opted into SSE regardless.
This commit adds additional parentheses to ensure a warning-free build of the
CRC32 library using clang on ARM64 machines.
On macOS on Apple Silicon:
```
$ uname -m
arm64
```
Before:
```
$ ninja crc32
[0/2] Re-checking globbed directories...
[3/4] Building CXX object contrib/crc32/CMakeFiles/crc32.dir/crc32c.cpp.o
'+sse4.2' is not a recognized feature for this target (ignoring feature)
'+sse4.2' is not a recognized feature for this target (ignoring feature)
[4/4] Linking CXX static library lib/libcrc32.a
```
After:
```
$ ninja -t clean
Cleaning... 5 files.
$ ninja crc32
[0/2] Re-checking globbed directories...
[4/4] Linking CXX static library lib/libcrc32.a
```
This change attempts to address the SIGSEGV happening when network routine is started
multiple times concurrently.
It changes the network mutex to be a RW mutex, to optimize the case
of calls when network is already started.
fatal error: unexpected signal during runtime execution
[signal SIGSEGV: segmentation violation code=0x1 addr=0x7f4600000011 pc=0x7f46a405678e]
runtime stack:
runtime.throw({0x1169773?, 0x7f46a479f96c?})
/usr/local/go/src/runtime/panic.go:1047 +0x5d fp=0x7f465affb790 sp=0x7f465affb760 pc=0x44e45d
runtime.sigpanic()
/usr/local/go/src/runtime/signal_unix.go:821 +0x3e9 fp=0x7f465affb7f0 sp=0x7f465affb790 pc=0x466e49
goroutine 60 [syscall]:
runtime.cgocall(0xf4f640, 0xc0001f7f80)
/usr/local/go/src/runtime/cgocall.go:157 +0x6e fp=0xc0001f7f58 sp=0xc0001f7f20 pc=0x41840e
github.com/apple/foundationdb/bindings/go/src/fdb._Cfunc_fdb_run_network()
_cgo_gotypes.go:378 +0x85 fp=0xc0001f7f80 sp=0xc0001f7f58 pc=0xd19d25
github.com/apple/foundationdb/bindings/go/src/fdb.startNetwork.func1()
/home/user/go/pkg/mod/github.com/apple/foundationdb/bindings/go@v0.0.0-20221026173525-97cc643cef69/src/fdb/fdb.go:209 +0x2a fp=0xc0001f7fe0 sp=0xc0001f7f80 pc=0xd2704a
runtime.goexit()
/usr/local/go/src/runtime/asm_amd64.s:1598 +0x1 fp=0xc0001f7fe8 sp=0xc0001f7fe0 pc=0x487741
created by github.com/apple/foundationdb/bindings/go/src/fdb.startNetwork
/home/user/go/pkg/mod/github.com/apple/foundationdb/bindings/go@v0.0.0-20221026173525-97cc643cef69/src/fdb/fdb.go:208 +0x72
goroutine 1 [running]:
goroutine running on other thread; stack unavailable