From cad5d3e264535c919b80e1e2a85407307961f221 Mon Sep 17 00:00:00 2001 From: mtklein Date: Mon, 13 Oct 2014 12:53:27 -0700 Subject: [PATCH] No threadsafe statics. Chrome disables these for speed and code size, so we need to disable them to make sure our code is safe when used this way. int foo() { static int32_t atomic_thing; return sk_atomic_inc(&atomic_thing); } is not safe in Chrome. Making the static global is: static int32_t atomic_thing; int foo() { return sk_atomic_inc(&atomic_thing); } BUG=skia: Review URL: https://codereview.chromium.org/654663002 --- gyp/common_conditions.gypi | 1 + 1 file changed, 1 insertion(+) diff --git a/gyp/common_conditions.gypi b/gyp/common_conditions.gypi index d9c048771e..e584cbc960 100644 --- a/gyp/common_conditions.gypi +++ b/gyp/common_conditions.gypi @@ -202,6 +202,7 @@ ], 'cflags_cc': [ '-fno-rtti', + '-fno-threadsafe-statics', # Chrome disables this, so for safety we should too. '-Wnon-virtual-dtor', '-Wno-invalid-offsetof', # GCC <4.6 is old-school strict about what is POD. ],