Subject: bug#19813: 24.4; emacs crashes on exit

From: Eli Zaretskii <[email-masked]>
Date: Mon, 09 Feb 2015 19:31:27 +0200

> Date: Mon, 9 Feb 2015 11:29:04 -0500
> From: Test User <[email-masked]>
> Cc: [email-masked]
> 
>     In general, no MinGW DLLs distributed as binaries should depend on
>     libgcc_s_dw2-1.dll, for several reasons:
>     
> 
> <good reasons snipped>
> 
> Does this simply mean that I should always build my libraries and programs
> with -static-libgcc?

Yes, sort of.  Not every library needs that, so what I do is build it
"as usual" first, then, if I discover it depends on
libgcc_s_dw2-1.dll, I reconfigure and rebuild so that the link command
includes -static-libgcc.

> Would that be in conflict with the issues discussed in 
> https://gcc.gnu.org/onlinedocs/gcc-4.9.2/gcc/Link-Options.html#Link-Options?
> (See -shared-libgcc).

This is only an issue with C++ programs that throw and catch
exceptions across shared libraries.  If you only use these libraries
with C programs, you will never have any problems.  And even with C++
programs, since these libraries never throw any exceptions, I think
you are safe.

>     http://sourceforge.net/projects/ezwinports/files/?source=navbar
>     
>     That collection includes librsvg, zlib, and all the other libraries
>     required by Emacs. (Btw, the librsvg build there is much smaller than
>     the one you use, because it excludes every feature not useful on
>     Windows, like Fontconfig, Freetype, and Harfbuzz.)
> 
> It is impossible for me to know when a feature is "useful on Windows"
> or not

Of course, it's possible: the information about that is normally
available in some README or INSTALL file in the package, and in the
description of the 'configure' script options.  How do you think I
knew which features to configure and which not?  The first thing I do
when building a package is run "./configure --help" and read carefully
the description of each option that turns some feature on or off.  In
some cases, that description is not detailed enough, so I need to look
in the package documentation and/or sources to understand what it
does, and in rare cases ask the maintainers.

It's an effort, but it's an effort well spent.  Without it, you won't
even know whether some optional feature is supported on Windows or
not, and might waste a lot of time trying to have it compile and link.

> Now that I know, in this case maybe I can --disable-harfbuzz ,etc., or
> build Harfbuzz with -static-libgcc.

The main bloat comes from cairo.  My notes indicate that I configured
cairo like this:

  ./configure --prefix=... --disable-pthread --disable-fc --disable-ft

and pixman like this:

  ./configure --prefix=... --disable-ssse3

and gdk-pixbuf like this:

  ./configure --prefix=... --without-libjpeg --without-libtiff --with-included-loaders=yes