Some baseline thoughts

Stephan Bergmann sbergman at redhat.com
Thu Jun 1 07:49:31 UTC 2017


On 05/31/2017 10:06 PM, Miklos Vajna wrote:
> As far as I can see it's the "because those setting up Android support
> didn't bother" case. The attached patch does not break opening Writer
> documents for me, so I guess it's safe to turn that "always false" to
> "always true", as it happens on macOS.

I don't think your experiment is telling much.  There are three cases to 
consider:

1  A toolchain that doesn't support thread-safe statics.

2  A toolchain that correctly supports thread-safe statics.

3  A (dated GCC) toolchain that supports thread-safe statics, but in a 
broken way (using a single lock for all static variables) that can lead 
to deadlock.

To guard against kind 3, solenv/gbuild/platform/com_GCC_defs.mk adds 
-fno-threadsafe-statics (to effectively turn the toolchain into kind 1) 
when HAVE_THREADSAFE_STATICS is not true.

So your experiment (which would try to detect whether Android toolchains 
are of kind 3) would probably also need to remove 
-fno-threadsafe-statics from com_GCC_defs.mk (unless com_GCC_defs.mk 
somehow isn't relevant for building on Android, anyway).

However, your experiment doesn't try to detect whether Android 
toolchains are of kind 1.  (But it's probably safe to assume that they 
are not if they use a GCC that supports -fthreadsafe-statics.)


More information about the LibreOffice mailing list