Skip to content

Commit

Permalink
build: add asan config runnable on MacOS (#1108)
Browse files Browse the repository at this point in the history
Description: Bazel config `clang-asan` currently is unable to be run on MacOS due to a macro redefinition and missing dependencies. This alternative config works around these issues.
Risk Level: Low
Testing: Local

Signed-off-by: Mike Schore <[email protected]>
Signed-off-by: JP Simard <[email protected]>
  • Loading branch information
goaway authored and jpsim committed Nov 28, 2022
1 parent 8daa4e5 commit 16e15ee
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions mobile/.bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,19 @@ build:ios --define=manual_stamp=manual_stamp
# Default flags for builds targeting Android
build:android --define=logger=android

# Locally-runnable ASAN config for MacOS & Linux with standard dev environment
# See also:
# https://github.com/bazelbuild/bazel/issues/6932
build:asan-dev --strip=never
build:asan-dev --copt -Wno-macro-redefined # ASAN sets _FORTIFY_SOURCE=0
build:asan-dev --copt -DADDRESS_SANITIZER
build:asan-dev --copt -D_LIBCPP_HAS_NO_ASAN
build:asan-dev --copt -g
build:asan-dev --copt -fno-omit-frame-pointer
build:asan-dev --copt -fno-optimize-sibling-calls
build:asan-dev --copt -fsanitize=address
build:asan-dev --linkopt -fsanitize=address

# Exclude debug info from the release binary since it makes it too large to fit
# into a zip file. This shouldn't affect crash reports.
build:release-common --define=no_debug_info=1
Expand Down

0 comments on commit 16e15ee

Please sign in to comment.