[tlbuild] Static linking of C++ runtime library causing problems on x86_64-cygwin

Peter Breitenlohner peb at mppmu.mpg.de
Wed Feb 19 08:41:00 CET 2014


On Tue, 18 Feb 2014, Ken Brown wrote:

> Several years ago you came up with a way of statically linking the C++
> runtime library on Cygwin, which you incorporated into kpse-cxx-hack.m4.
>  It turns out that this is causing problems for the build of TeX Live
> on x86_64-cygwin.  [The same problem should actually occur on
> x86-cygwin, but it currently doesn't because of a minor packaging
> difference between the x86 and x86_64 distributions.  This will change
> in the future.]
>
> Specifically, the link command line for xetex looks like this:
>
>   g++...-o xetex.exe...-lfontconfig -lexpat -lfreetype...-static...
>
> and the -static flag causes the linker to try to statically link
> fontconfig, expat, and freetype.  This fails because Cygwin doesn't have
> static libraries for fontconfig and freetype.  (It does have one for
> expat, but this may change in the future.)
>
> A fix would be to change the library flags to
>
>   -Wl,-Bdynamic -lfontconfig -lexpat -lfreetype -Wl,-Bstatic
>
> Is this easy to accomplish?  If not, maybe we should just give up
> statically linking the C++ library on Cygwin, unless you think that's
> important.

Hi Ken,

the macro in kpse-cxx-hack.m4 jusst reformulates what was done in earlier
versions.  For some (obscure?) reasons cygwin is treated differently from
all other systems using gcc (including MinGW).  Perhaps this distinction
should be removed.  In order to test this please try to change line 17862
   *cygwin*)  flags_try0='-static -static-libgcc';
of texk/web2c/configure into
   NEVER)  flags_try0='-static -static-libgcc';
and see if that helps (for cygwin32 and cygwin64).  If that succeeds we can
simplify the definition of _KPSE_CXX_HACK in m4/kpse-cxx-hack.m4.

Regards
Peter



More information about the tlbuild mailing list