@probonopd
Copy link

为了运行32位Windows应用程序,必须使用32位Windows,这又需要32位ld-linux.so.2glibc。但是现在大多数64位系统都没有安装32位兼容性库。

对于其他程序,通常可以手动加载32位ELF文件,并使用一个私有的“ld-linux.so.2”捆绑版本,如下所示:

wget -c http://security.ubuntu.com/ubuntu/pool/main/g/glibc/libc6-i386_2.24-9ubuntu2.2_amd64.deb
dpkg -x ./libc6*.deb .

HERE="$(dirname "$(readlink -f "${0}")")"

WINEPREFIX="$HERE/wineprefix/" \
  "$HERE/lib32/ld-linux.so.2"  \
  --library-path "$HERE/lib32" \
  "$HERE/wine-stable/bin/wine" \
  "$WINEPREFIX/drive_c/Program Files/App/App.exe"  "$@"

但是,对于WINE,这是行不通的。我的猜测是,WINE通过后台的其他机制启动其他的WINE实例,而后者不会使用指定的 "$HERE/lib32/ld-linux.so.2"--library-path "$HERE/lib32"

葡萄酒开发商亚历山大Julliard [葡萄酒开发回答](https://www.winehq.org/pipermail/wine-devel/2017-November/119944.html):

It's not possible in standard Wine, but you could probably hack
wine_exec_wine_binary() in libs/wine/config.c to add your special magic.

:建设:这需要完成。我们将非常欢迎捐款。

与此同时,我们可以通过在/ tmp这个固定位置放置一个符号链接到我们自定义的ld-linux.so.2来避开这个限制,但这是一个很丑恶的事情。


In order to run 32-bit Windows applications, 32-bit Windows must be used, which in turn requires 32-bit ld-linux.so.2 and glibc. But most 64-bit systems these days don't have the 32-bit compatibility libraries installed anymore.

With other programs it is usually possible to manually load the 32-bit ELF file with a private, bundled version of ld-linux.so.2 like so:

wget -c http://security.ubuntu.com/ubuntu/pool/main/g/glibc/libc6-i386_2.24-9ubuntu2.2_amd64.deb
dpkg -x ./libc6*.deb .

HERE="$(dirname "$(readlink -f "${0}")")"

WINEPREFIX="$HERE/wineprefix/" \
  "$HERE/lib32/ld-linux.so.2"  \
  --library-path "$HERE/lib32" \
  "$HERE/wine-stable/bin/wine" \
  "$WINEPREFIX/drive_c/Program Files/App/App.exe"  "$@"

However, with WINE, this does not work. My guess is that WINE launches other WINE instances through other mechanisms in the background, which in turn don't get loaded using the specified
"$HERE/lib32/ld-linux.so.2" and --library-path "$HERE/lib32".

WINE developer Alexandre Julliard answered on wine-devel:

It's not possible in standard Wine, but you could probably hack
wine_exec_wine_binary() in libs/wine/config.c to add your special magic.

🚧 This needs to be done. We would highly welcome contributions.

In the meantime, we may get around this limitation by placing a symlink to our custom ld-linux.so.2 at a fixed location such as /tmp, but it is an ugly hack.