From f2b219c0776c81b080585ece6d3fde9b8a78ede9 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 887df4b2285e2e..705245e69369df 100644 --- a/common.gypi +++ b/common.gypi @@ -179,7 +179,11 @@ }], [ 'OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris"', { 'cflags': [ '-Wall', '-Wextra', '-Wno-unused-parameter', '-pthread', ], - 'cflags_cc': [ '-fno-rtti', '-fno-exceptions' ], + 'cflags_cc': [ + '-fno-delete-null-pointer-checks', + '-fno-exceptions', + '-fno-rtti', + ], 'ldflags': [ '-pthread', '-rdynamic' ], 'target_conditions': [ ['_type=="static_library"', {