[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: gettext-tools: disabling thread safety on Windows?
From: |
Michele Locati |
Subject: |
Re: gettext-tools: disabling thread safety on Windows? |
Date: |
Thu, 3 Oct 2024 14:36:58 +0200 |
Thank you Bruno for your lightning fast reply!
> > When building gettext for Windows in "shared" mode, I noticed that
> > xgettext depends on libstdc++-6.dll because it uses its two functions
> > __cxa_guard_acquire and __cxa_guard_release.
> >
> > So, since libstdc++-6.dll requires libgcc_s_seh-1.dll and
> > libwinpthread-1.dll, I have to distribute these 3 libraries because of
> > those 2 functions.
>
> Oh. Indeed, libwinpthread should be avoided, because it is of lower quality
> than the rest of mingw.
I have to include libwinpthread-1.dll just because it's required by
libstdc++-6.dll: it doesn't seem that any of the gettext stuff uses it
(I'm using --enable-threads=windows)
> The only program in GNU gettext that uses multithreading is msgmerge.
> And indeed, without multithreading, msgmerge is much slower. So,
> I wouldn't recommend --disable-threads for the entire package.
>
> But for the other programs, including xgettext, there is no issue.
> So, you can add fno-threadsafe-statics to xgettext_CXXFLAGS without
> problem.
Do you think that msgmerge could have problems if I use
--enable-threads=windows together with -fno-threadsafe-statics?
Since msgmerge doesn't use __cxa_guard_acquire/__cxa_guard_release I
don't think so, but I'm not sure that -fno-threadsafe-statics only
affects the usage of those two calls.
The alternative would be to build everything with
-fno-threadsafe-statics and --disable-threads, then rebuild just
msgmerge without them (but it'd avoid that unless necessary: it'd be
rather time consuming and the whole build process would be more
complex).
PS: tests are passing [1], but I'm not sure that's something covered by tests...
--
Michele
[1]
https://github.com/mlocati/gettext-iconv-windows/actions/runs/11161531570/job/31024277179?pr=23