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

Provide llvm-symbolizer target #149

Merged
merged 1 commit into from
Aug 3, 2022

Conversation

jfirebaugh
Copy link
Contributor

@jfirebaugh jfirebaugh commented Aug 3, 2022

AddressSanitizer uses llvm-symbolizer binary to symbolize the stack traces, and the llvm-symbolizer version must match the version of ASan runtime library. https://clang.llvm.org/docs/AddressSanitizer.html#symbolizing-the-reports

By exposing this target, users can configure the appropriate ASAN_SYMBOLIZER_PATH environment variable:

cc_test(
  ...
  data = [
    ...,
    "@llvm_toolchain_llvm//:symbolizer",
  ],
  env = {
    "ASAN_SYMBOLIZER_PATH": "$(location @llvm_toolchain_llvm//:symbolizer)",
  },
)

(Ideally the toolchain would set this up automatically, but I don't know if there's a way for a toolchain to specify environment variables for cc_test that use that toolchain. I asked on Bazel slack.)

AddressSanitizer uses llvm-symbolizer binary to symbolize the stack traces, and the llvm-symbolizer version must match the version of ASan runtime library.

By exposing this target, users can configure the appropriate ASAN_SYMBOLIZER_PATH environment variable:

```
cc_test(
  ...
  data = [
    ...,
    "@llvm_toolchain_llvm//:symbolizer",
  ],
  env = {
    "ASAN_SYMBOLIZER_PATH": "$(location @llvm_toolchain_llvm//:symbolizer)",
  },
)
```
@siddharthab siddharthab merged commit 2ef4bbf into bazel-contrib:master Aug 3, 2022
@jfirebaugh jfirebaugh deleted the jfirebaugh/symbolizer branch August 3, 2022 17:33
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