From fd84361f0e77eced3524db24c90b596f1f3dad40 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Wed, 9 Jul 2025 08:02:21 +0200 Subject: [PATCH] build: On mingw, avoid link dependency from xgettext.exe to libstdc++. Reported by Michele Locati in . * gettext-tools/src/Makefile.am (xgettext_CXXFLAGS): New variable. --- gettext-tools/src/Makefile.am | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/gettext-tools/src/Makefile.am b/gettext-tools/src/Makefile.am index 4ce51af0a..1b7faf125 100644 --- a/gettext-tools/src/Makefile.am +++ b/gettext-tools/src/Makefile.am @@ -480,6 +480,16 @@ endif # Compile-time flags for particular source files. msgmerge_CFLAGS = $(AM_CFLAGS) $(OPENMP_CFLAGS) msgmerge_CXXFLAGS = $(AM_CXXFLAGS) $(OPENMP_CFLAGS) +# On mingw, the compiler option '-fno-threadsafe-statics' avoids requiring +# the symbols __cxa_guard_acquire and __cxa_guard_release, which in turn +# avoids a dependency towards libstdc++. +if WOE32DLL +if WINDOWS_NATIVE +if !WINDOWS_MSVC +xgettext_CXXFLAGS = $(AM_CXXFLAGS) -fno-threadsafe-statics +endif +endif +endif # Link dependencies. # INTL_MACOSX_LIBS is needed because the programs depend on libintl.la -- 2.47.3