Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: update sanitizers guide with symbolizer and build type #202

Merged
merged 1 commit into from
Nov 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions docs/src/guides/01-sanitizers.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ This guide assumes the build with `AddressSanitizer` enabled.

### Build LLVM with sanitizer enabled

When building LLVM, please, use `--sanitizer <sanitizer>` option:
When building LLVM, use `--sanitizer <sanitizer>` option and set build type to `RelWithDebInfo`:

```shell
zksync-llvm build --sanitizer=Address
zksync-llvm build --sanitizer=Address --build-type=RelWithDebInfo
```

<div class="warning">
Expand Down Expand Up @@ -75,9 +75,13 @@ Please, check the table below to find the correct target for your platform.
| macOS x86 | `x86_64-apple-darwin` |


Additionally, for proper reports symbolization it is recommended to set the `ASAN_SYMBOLIZER_PATH` environment variable.
For more info, see [symbolizing reports](https://clang.llvm.org/docs/AddressSanitizer.html#id4) section of LLVM documentation.

For example, to build the ZKsync compiler for macOS arm64 with `AddressSanitizer` enabled, run the following command:
```shell
export RUSTC_BOOTSTRAP=1
export ASAN_SYMBOLIZER_PATH=$(which llvm-symbolizer) # check the path to llvm-symbolizer
TARGET=aarch64-apple-darwin # Change to your target
RUSTFLAGS="-Z sanitizer=address" cargo test --target=${TARGET}
```
Expand Down