From 1ba6d16786fc23004a947e00ede93e98a48dcee3 Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Fri, 13 May 2016 16:32:51 +0200 Subject: [PATCH] build: turn on -fno-delete-null-pointer-checks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Work around spec violations in V8 where it checks that `this == NULL`. GCC 6 started exploiting this particular kind of UB, resulting in runtime crashes. Fixes: https://github.com/nodejs/node/issues/6724 PR-URL: https://github.com/nodejs/node/pull/6737 Reviewed-By: Anna Henningsen Reviewed-By: James M Snell Reviewed-By: Michaƫl Zasso --- common.gypi | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/common.gypi b/common.gypi index 83e1ee4405f6a5..1984fa8f7a03f5 100644 --- a/common.gypi +++ b/common.gypi @@ -181,7 +181,11 @@ }], [ 'OS in "linux freebsd openbsd solaris android"', { 'cflags': [ '-Wall', '-Wextra', '-Wno-unused-parameter', ], - 'cflags_cc': [ '-fno-rtti', '-fno-exceptions' ], + 'cflags_cc': [ + '-fno-delete-null-pointer-checks', + '-fno-exceptions', + '-fno-rtti', + ], 'ldflags': [ '-rdynamic' ], 'target_conditions': [ ['_type=="static_library"', {