summaryrefslogtreecommitdiff
path: root/BUILDING.md
diff options
context:
space:
mode:
authorgengjiawen <technicalcute@gmail.com>2020-03-23 20:07:29 +0800
committergengjiawen <technicalcute@gmail.com>2020-04-01 02:54:30 +0000
commit9c00af07160d8e3aef84e319ca7dd01667b96cd8 (patch)
treefe597e61e08597e379942e507827e641ada9e228 /BUILDING.md
parent534c204e223d85c44cd6b1b642f29143095077f6 (diff)
downloadios-node-v8-9c00af07160d8e3aef84e319ca7dd01667b96cd8.tar.gz
ios-node-v8-9c00af07160d8e3aef84e319ca7dd01667b96cd8.tar.bz2
ios-node-v8-9c00af07160d8e3aef84e319ca7dd01667b96cd8.zip
doc: add ASAN build instructions
PR-URL: https://github.com/nodejs/node/pull/32436 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Matheus Marchini <mat@mmarchini.me>
Diffstat (limited to 'BUILDING.md')
-rw-r--r--BUILDING.md17
1 files changed, 17 insertions, 0 deletions
diff --git a/BUILDING.md b/BUILDING.md
index 6d62837e61..ac67d7464d 100644
--- a/BUILDING.md
+++ b/BUILDING.md
@@ -28,6 +28,7 @@ file a new issue.
* [Running Coverage](#running-coverage)
* [Building the documentation](#building-the-documentation)
* [Building a debug build](#building-a-debug-build)
+ * [Building an ASAN build](#building-an-asan-build)
* [Troubleshooting Unix and macOS builds](#troubleshooting-unix-and-macos-builds)
* [Windows](#windows)
* [Prerequisites](#prerequisites)
@@ -491,6 +492,22 @@ $ gdb /opt/node-debug/node core.node.8.1535359906
$ backtrace
```
+#### Building an ASAN build
+
+[ASAN](https://github.com/google/sanitizers) can help detect various memory
+related bugs. ASAN builds are currently only supported on linux.
+If you want to check it on Windows or macOS or you want a consistent toolchain
+on Linux, you can try [Docker](https://www.docker.com/products/docker-desktop)
+ (using an image like `gengjiawen/node-build:2020-02-14`).
+
+The `--debug` is not necessary and will slow down build and testing, but it can
+show clear stacktrace if ASAN hits an issue.
+
+``` console
+$ ./configure --debug --enable-asan && make -j4
+$ make test-only
+```
+
#### Troubleshooting Unix and macOS builds
Stale builds can sometimes result in `file not found` errors while building.