From 67e7b6cf0cc2285eb58766674ade2fdb182765b2 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 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 --- 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"', {