Some baseline thoughts

Miklos Vajna vmiklos at collabora.co.uk
Thu Jun 1 10:51:07 UTC 2017


Hi Stephan,

On Thu, Jun 01, 2017 at 09:49:31AM +0200, Stephan Bergmann <sbergman at redhat.com> wrote:
> 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.)

I repeated the experiment with
<https://gerrit.libreoffice.org/#/c/38296/> applied (so
HAVE_THREADSAFE_STATICS is TRUE in config_host.mk, also verified that
the generated commandline when compiling a C++ file contains no
-fno-threadsafe-statics), and also did a clean build, so all code is
built with the new compiler flags. I still see no deadlock up to the
point where a Writer document is rendered.

In addition, we build for Android using (currently) gcc-4.9, so 3) seems
to be out of question.

Does that help?

Regards,

Miklos
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <https://lists.freedesktop.org/archives/libreoffice/attachments/20170601/5a17d45c/attachment.sig>


More information about the LibreOffice mailing list