-#if defined (HAVE_PTHREAD) && !defined (SYSTEM_MALLOC) && !defined (DOUG_LEA_MALLOC)
- if (! noninteractive)
- {
- extern void malloc_enable_thread (void);
-
- malloc_enable_thread ();
- }
+#if defined HAVE_PTHREAD && !defined SYSTEM_MALLOC && !defined DOUG_LEA_MALLOC
+# ifndef CANNOT_DUMP
+ /* Do not make gmalloc thread-safe when creating bootstrap-emacs, as
+ that causes an infinite recursive loop with FreeBSD. But do make
+ it thread-safe when creating emacs, otherwise bootstrap-emacs
+ fails on Cygwin. See Bug#14569. */
+ if (!noninteractive || initialized)
+# endif
+ malloc_enable_thread ();