[PATCH 0/6] Allow using external static libraries for PE dependencies

Zebediah Figura zfigura at codeweavers.com
Tue Oct 19 01:08:06 CDT 2021


It's not actually clear if the ZLIB_PE_CFLAGS and ZLIB_PE_LIBS introduced in
2929aa3c74 were meant for this purpose, given the number of ways in which
they're broken. Nevertheless, it would be really quite nice to have, so this
series aims to provide that. After these patches I'm able to compile wine using
distribution static libraries, with the following configure flags:

    configure ZLIB_PE_CFLAGS="$(x86_64-w64-mingw32-pkg-config --cflags zlib)" ZLIB_PE_LIBS="-Wl,-Bstatic $(x86_64-w64-mingw32-pkg-config --static --libs zlib) -Wl,-Bdynamic" PNG_PE_CFLAGS="$(x86_64-w64-mingw32-pkg-config --cflags libpng16)" PNG_PE_LIBS="-Wl,-Bstatic $(x86_64-w64-mingw32-pkg-config --static --libs libpng16) -lmingwex -lmingw32 -Wl,-Bdynamic"

Patches 5-6 are necessary to allow static linking of libpng16. Patch 4 is
probably desirable on its own anyway.

This is also a first step to actually acquiescing to what distributions have
asked for. After this I intend to submit patches to:

  * allow automatic detection of distribution packages via MinGW pkg-config,
    which is pretty well standardized;

  * allow the use of dynamic libraries using the approach demonstrated in [1].

[1] https://www.winehq.org/pipermail/wine-devel/2021-September/195543.html

Zebediah Figura (6):
  makefiles: Allow using external system headers in PE libraries.
  winegcc: Allow explicit static and dynamic linking.
  makefiles: Allow using *_PE_LIBS to specify linker flags to external
    static libraries.
  include: Add DECLSPEC_RETURNS_TWICE.
  ucrtbase: Export _setjmp() from the import library.
  ucrtbase: Export atexit() from the import library.

 aclocal.m4                     |  5 ++++-
 configure.ac                   |  2 +-
 dlls/cabinet/Makefile.in       |  3 ++-
 dlls/dbghelp/Makefile.in       |  3 ++-
 dlls/opcservices/Makefile.in   |  3 ++-
 dlls/ucrtbase/Makefile.in      |  2 ++
 dlls/ucrtbase/atexit.c         | 31 +++++++++++++++++++++++++++++++
 dlls/ucrtbase/setjmp.c         | 32 ++++++++++++++++++++++++++++++++
 dlls/user32/Makefile.in        |  3 ++-
 dlls/windowscodecs/Makefile.in |  3 ++-
 dlls/wininet/Makefile.in       |  3 ++-
 include/msvcrt/corecrt.h       | 18 ++++++++++++++++++
 include/msvcrt/setjmp.h        |  8 ++------
 include/wine/exception.h       |  4 ++--
 include/wine/unixlib.h         |  4 ++--
 include/winnt.h                |  8 ++++++++
 tools/makedep.c                | 14 ++------------
 tools/winegcc/winegcc.c        | 16 ++++++++++++----
 18 files changed, 128 insertions(+), 34 deletions(-)
 create mode 100644 dlls/ucrtbase/atexit.c
 create mode 100644 dlls/ucrtbase/setjmp.c

-- 
2.33.0




More information about the wine-devel mailing list