Skip to content

Commit ff7c68c

Browse files
committed
build: add asan option to multi-arch/mode build
Make it possible to build node against Address Sanitizer. Enable with: $ make -f Makefile.build asan=clang++ CC=clang CC_host=clang PR-URL: node-forward/node#24 Reviewed-By: Fedor Indutny <fedor@indutny.com>
1 parent edaf7af commit ff7c68c

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

common.gypi

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
'variables': {
3+
'asan%': 0,
34
'werror': '', # Turn off -Werror in V8 build.
45
'visibility%': 'hidden', # V8's visibility setting
56
'target_arch%': 'ia32', # set v8's target architecture
@@ -159,6 +160,16 @@
159160
},
160161
'msvs_disabled_warnings': [4351, 4355, 4800],
161162
'conditions': [
163+
['asan != 0', {
164+
'cflags+': [
165+
'-fno-omit-frame-pointer',
166+
'-fsanitize=address',
167+
'-w', # http://crbug.com/162783
168+
],
169+
'cflags_cc+': [ '-gline-tables-only' ],
170+
'cflags!': [ '-fomit-frame-pointer' ],
171+
'ldflags': [ '-fsanitize=address' ],
172+
}],
162173
['OS == "win"', {
163174
'msvs_cygwin_shell': 0, # prevent actions from trying to use cygwin
164175
'defines': [

0 commit comments

Comments
 (0)