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
diff --git a/gyp/common_conditions.gypi b/gyp/common_conditions.gypi
index d9c0487..e584cbc 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.
],