Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.devel > #104156

Re: Wine MinGW system libraries

From Zebediah Figura <zfigura@codeweavers.com>
Newsgroups linux.debian.devel
Subject Re: Wine MinGW system libraries
Date 2022-04-17 02:30 +0200
Message-ID <Ed0XD-9ep6-1@gated-at.bofh.it> (permalink)
References <CTPiy-2xn-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Hello all,

Since this conversation several months ago I've been working with the 
Wine maintainer on implementing a solution upstream that is compatible 
with our requirements and the pretty much universal desire by packagers 
to avoid system library imports. I believe I've found a solution that 
will work for now for everyone, although it has raised some questions 
about standardization of MinGW packages—see the "Open Questions" section 
of this mail for more details.

== Summary of upstream progress ==

Currently Wine bundles the source of several libraries. At the same 
time, as was discussed we've implemented a system upstream by which 
external shared libraries can be linked to and loaded (while keeping 
them in a separate "namespace" so that they don't conflict with 
identically named application DLLs.) There are still some concerns on 
the Wine side that this will break applications in subtle ways, but 
unfortunately there has been almost no testing of this feature yet.

The libraries which we import are as follows:

* libFAudio
* libgsm
* libjpeg
* jxrlib
* liblcms2
* libmpg123
* libpng
* libtiff
* libvkd3d
* libxml2
* libxslt
* zlib

This list is probably going to remain stable. Despite what was discussed 
earlier I do *not* forsee us importing libOSMesa (it turns out that it 
actually makes more sense on the Win32 "kernel" side). An import of 
libfreetype or libgnutls is also unlikely at this point (we've found it 
more worthwhile to write thunks for both).

We currently do *not* support external static linking. The basic reason 
for this is that Wine builds against its own CRT rather than MinGW's, 
and we cannot safely statically link to a module built with a different CRT.

== Technical details ==

In order to use system shared libraries, Wine needs to know where to 
find them at runtime. This is done with a configure argument:

     configure --with-system-dllpath=/first/directory/:/second/directory/

Note that this may need to include the location of libgcc_s and other 
dependencies, which is in a different location on Debian.

Separately, for each argument, we need to know the compiler and linker 
flags used to find the library. This also can be done with configure 
arguments, much like for native libraries:

     configure GSM_PE_CFLAGS="-Iwhatever" GSM_PE_LIBS="-Lwhatever -lgsm"

If MinGW pkg-config is present, and --with-system-dllpath is specified, 
Wine will automatically use it to detect the compiler and linker flags 
for all of the above packages supporting pkg-config, which in particular 
excludes libgsm and jxrlib. Thus in practice it should not be necessary 
to hand-code most CFLAGS and LIBS variables.

== Open Question(s) ==

Currently it's necessary to use a configure argument to specify where to 
find the runtime path. This is fine for distributions, which is where 
most people are going to be getting Wine anyway. It's a bit unfortunate 
for anyone self-compiling Wine, though, and it'd be nice if there was 
some way to avoid it. Unfortunately, there are two things standing in 
our way.

The first problem is that the location of runtime DLLs varies wildly 
between distributions, and there's no common independent way to detect 
it. We could potentially hardcode a few "guesses" at the runtime path 
into Wine's configure script, but that brings us to the second problem: 
there's no way to verify the presence of runtime DLLs. We *are* the 
loader and lower-level APIs and would have to bootstrap ourselves first, 
and this is pretty much infeasible. Verifying by name doesn't really 
work either, since the name isn't really predictable.

Hence "standardize the location of runtime DLLs across distributions" 
isn't really a feasible solution either (or at least not a complete 
one), as nice as it would be—we have no way to know whether a 
distribution is post-standardization or not.

Rather, I think the best solution is to have some tool which, if present 
or successful, lists one or more directories where libraries can be 
found. I'm not sure what the most sensible thing here is:

* pkg-config would be an obvious tool to extend, but would presumably 
require modifying .pc files for all relevant packages upstream. The 
location also seems to be consistent across all packages within each 
distribution I was able to test, so there probably isn't much point in 
making it package-specific. [For the packages we care about, cmake and 
libtool both put things in /bin by default, and zlib apparently has no 
built-in cross-compilation support.]

* Introducing an analogue of ld.so.conf seems like a good idea. It would 
allow for per-package extra directories, and is relatively easy to 
parse, although ideally it would be even easier than that (i.e. if 
someone else could deal with the "include" part, that would be great).

ἔρρωσθε,
Zeb Figura

Back to linux.debian.devel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Wine MinGW system libraries Zebediah Figura <zfigura@codeweavers.com> - 2021-09-05 03:40 +0200
  Re: Wine MinGW system libraries Bastien ROUCARIES <roucaries.bastien@gmail.com> - 2021-09-05 09:20 +0200
    Re: Wine MinGW system libraries Stephen Kitt <skitt@debian.org> - 2021-09-05 18:30 +0200
    Re: Wine MinGW system libraries Adrian Bunk <bunk@debian.org> - 2021-09-12 10:00 +0200
      Re: Wine MinGW system libraries Bastien ROUCARIES <roucaries.bastien@gmail.com> - 2021-09-12 15:40 +0200
        Re: Wine MinGW system libraries Adrian Bunk <bunk@debian.org> - 2021-09-12 16:10 +0200
          Re: Wine MinGW system libraries Bastien ROUCARIES <roucaries.bastien@gmail.com> - 2021-09-12 16:20 +0200
            Re: Wine MinGW system libraries Adrian Bunk <bunk@debian.org> - 2021-09-12 16:40 +0200
              Re: Wine MinGW system libraries Bastien ROUCARIES <roucaries.bastien@gmail.com> - 2021-09-12 17:20 +0200
                Re: Wine MinGW system libraries Adrian Bunk <bunk@debian.org> - 2021-09-12 17:30 +0200
            Re: Wine MinGW system libraries Helmut Grohne <helmut@subdivi.de> - 2021-09-13 17:50 +0200
              Re: Wine MinGW system libraries Stephen Kitt <skitt@debian.org> - 2021-09-13 20:20 +0200
                Re: Wine MinGW system libraries Helmut Grohne <helmut@subdivi.de> - 2021-09-13 22:10 +0200
                Re: Wine MinGW system libraries Adrian Bunk <bunk@debian.org> - 2021-09-13 22:30 +0200
                Re: Wine MinGW system libraries Bastien ROUCARIES <roucaries.bastien@gmail.com> - 2021-09-13 23:00 +0200
                Re: Wine MinGW system libraries Adrian Bunk <bunk@debian.org> - 2021-09-13 23:40 +0200
      Re: Wine MinGW system libraries Stephen Kitt <skitt@debian.org> - 2021-09-12 17:40 +0200
        Re: Wine MinGW system libraries Adrian Bunk <bunk@debian.org> - 2021-09-12 18:40 +0200
          Re: Wine MinGW system libraries Stephen Kitt <skitt@debian.org> - 2021-09-12 19:10 +0200
            Re: Wine MinGW system libraries Adrian Bunk <bunk@debian.org> - 2021-09-12 20:20 +0200
              Re: Wine MinGW system libraries Stephen Kitt <skitt@debian.org> - 2021-09-13 20:30 +0200
  Re: Wine MinGW system libraries Stephen Kitt <skitt@debian.org> - 2021-09-05 18:20 +0200
    Re: Wine MinGW system libraries Zebediah Figura <zfigura@codeweavers.com> - 2021-09-05 19:20 +0200
      Re: Wine MinGW system libraries Stephen Kitt <skitt@debian.org> - 2021-09-06 09:10 +0200
        Re: Wine MinGW system libraries Bastien ROUCARIES <roucaries.bastien@gmail.com> - 2021-09-06 10:20 +0200
        Re: Wine MinGW system libraries Zebediah Figura <zfigura@codeweavers.com> - 2021-09-06 18:40 +0200
          Re: Wine MinGW system libraries Bastien ROUCARIES <roucaries.bastien@gmail.com> - 2021-09-06 21:00 +0200
            Re: Wine MinGW system libraries Zebediah Figura <zfigura@codeweavers.com> - 2021-09-07 00:00 +0200
              Re: Wine MinGW system libraries Paul Wise <pabs@debian.org> - 2021-09-07 02:50 +0200
                Re: Wine MinGW system libraries "Bastien Roucariès" <roucaries.bastien@gmail.com> - 2021-09-07 12:40 +0200
                Re: Wine MinGW system libraries Zebediah Figura <zfigura@codeweavers.com> - 2021-09-07 17:50 +0200
                Re: Wine MinGW system libraries Bastien ROUCARIES <roucaries.bastien@gmail.com> - 2021-09-07 19:30 +0200
                Re: Wine MinGW system libraries Bastien ROUCARIES <roucaries.bastien@gmail.com> - 2021-09-07 20:20 +0200
                Re: Wine MinGW system libraries Zebediah Figura <zfigura@codeweavers.com> - 2021-09-07 23:20 +0200
                Re: Wine MinGW system libraries Bastien ROUCARIES <roucaries.bastien@gmail.com> - 2021-09-08 01:50 +0200
                Re: Wine MinGW system libraries Bastien ROUCARIES <roucaries.bastien@gmail.com> - 2021-09-08 09:50 +0200
                Re: Wine MinGW system libraries Simon McVittie <smcv@debian.org> - 2021-09-08 10:20 +0200
                Re: Wine MinGW system libraries Zebediah Figura <zfigura@codeweavers.com> - 2021-09-08 17:50 +0200
                Re: Wine MinGW system libraries Paul Wise <pabs@debian.org> - 2021-09-09 03:20 +0200
                Re: Wine MinGW system libraries Zebediah Figura <zfigura@codeweavers.com> - 2021-09-09 06:50 +0200
                Re: Wine MinGW system libraries Paul Wise <pabs@debian.org> - 2021-09-09 07:20 +0200
                Re: Wine MinGW system libraries Zebediah Figura <zfigura@codeweavers.com> - 2021-09-09 07:40 +0200
                Re: Wine MinGW system libraries Paul Wise <pabs@debian.org> - 2021-09-09 07:50 +0200
                Re: Wine MinGW system libraries Zebediah Figura <zfigura@codeweavers.com> - 2021-09-09 08:10 +0200
                Re: Wine MinGW system libraries Paul Wise <pabs@debian.org> - 2021-09-09 09:40 +0200
                Re: Wine MinGW system libraries Bastien ROUCARIES <roucaries.bastien@gmail.com> - 2021-09-10 11:50 +0200
                Re: Wine MinGW system libraries Paul Wise <pabs@debian.org> - 2021-09-11 08:10 +0200
                Re: Wine MinGW system libraries Bastien ROUCARIES <roucaries.bastien@gmail.com> - 2021-09-12 17:20 +0200
                Re: Wine MinGW system libraries Paul Wise <pabs@debian.org> - 2021-09-08 01:10 +0200
                Re: Wine MinGW system libraries Bastien ROUCARIES <roucaries.bastien@gmail.com> - 2021-09-08 01:30 +0200
  Re: Wine MinGW system libraries Adrian Bunk <bunk@debian.org> - 2021-09-11 17:40 +0200
    Re: Wine MinGW system libraries Bastien ROUCARIES <roucaries.bastien@gmail.com> - 2021-09-11 20:10 +0200
  Re: Wine MinGW system libraries Zebediah Figura <zfigura@codeweavers.com> - 2022-04-17 02:30 +0200

csiph-web