iXit / wine-nine-standalone

Build Gallium Nine support on top of an existing WINE installation
GNU Lesser General Public License v2.1
272 stars 23 forks source link

Build fails on Gentoo (wine-vanilla-5.22, mesa-20.3.1) #92

Closed B4ckslash closed 3 years ago

B4ckslash commented 3 years ago

Emerging app-emulation/gallium-nine-standalone fails on my system with the following messages:

 * Package:    app-emulation/gallium-nine-standalone-0.7
 * Repository: gentoo
 * Maintainer: chewi@gentoo.org wine@gentoo.org
 * USE:        abi_x86_32 abi_x86_64 amd64 elibc_glibc kernel_linux userland_GNU
 * FEATURES:   network-sandbox preserve-libs sandbox userpriv usersandbox
 * FEATURES='assume-digests binpkg-docompress binpkg-dostrip binpkg-logs cgroup config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch parallel-install pid-sandbox preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr'
 * CFLAGS='-march=native -O3 -fgraphite-identity -floop-nest-optimize -fdevirtualize-at-ltrans -fipa-pta -fno-semantic-interposition -flto=24 -fuse-linker-plugin -pipe -Wl,-O1 -Wl,--as-needed'
 * CXXFLAGS='-march=native -O3 -fgraphite-identity -floop-nest-optimize -fdevirtualize-at-ltrans -fipa-pta -fno-semantic-interposition -flto=24 -fuse-linker-plugin -pipe -Wl,-O1 -Wl,--as-needed'
 * FFLAGS='-march=native -O3 -fgraphite-identity -floop-nest-optimize -fdevirtualize-at-ltrans -fipa-pta -fno-semantic-interposition -flto=24 -fuse-linker-plugin -pipe -Wl,-O1 -Wl,--as-needed'
 * FCFLAGS='-march=native -O3 -fgraphite-identity -floop-nest-optimize -fdevirtualize-at-ltrans -fipa-pta -fno-semantic-interposition -flto=24 -fuse-linker-plugin -pipe -Wl,-O1 -Wl,--as-needed'
 * F77FLAGS='-march=native -O3 -fgraphite-identity -floop-nest-optimize -fdevirtualize-at-ltrans -fipa-pta -fno-semantic-interposition -flto=24 -fuse-linker-plugin -pipe -Wl,-O1 -Wl,--as-needed'
 * LDFLAGS='-Wl,-O1 -Wl,--as-needed -march=native -O3 -fgraphite-identity -floop-nest-optimize -fdevirtualize-at-ltrans -fipa-pta -fno-semantic-interposition -flto=24 -fuse-linker-plugin -pipe'
 * MAKEOPTS='-j24 -l24'
 * gcc (Gentoo 10.2.0-r3 p4) 10.2.0
 * g++ (Gentoo 10.2.0-r3 p4) 10.2.0
 * GNU gold (Gentoo 2.35.1 p2 2.35.1) 1.16
 * Linux rust 5.10.0 #5 SMP Tue Dec 15 22:01:32 CET 2020 x86_64 AMD Ryzen 9 3900X 12-Core Processor AuthenticAMD GNU/Linux
>>> Unpacking source...
>>> Unpacking gallium-nine-standalone-0.7.tar.gz to /var/tmp/portage/app-emulation/gallium-nine-standalone-0.7/work
>>> Source unpacked in /var/tmp/portage/app-emulation/gallium-nine-standalone-0.7/work
>>> Preparing source in /var/tmp/portage/app-emulation/gallium-nine-standalone-0.7/work/wine-nine-standalone-0.7 ...
 * Applying 0.7-cross-files.patch ...
 [ ok ]
 * Applying 0.3-nine-dll-path.patch ...
patching file ninewinecfg/main.c
Hunk #1 succeeded at 28 with fuzz 2 (offset -4 lines).
 [ ok ]
 * abi_x86_32.x86: running bootstrap_nine
 * abi_x86_64.amd64: running bootstrap_nine
>>> Source prepared.
>>> Configuring source in /var/tmp/portage/app-emulation/gallium-nine-standalone-0.7/work/wine-nine-standalone-0.7 ...
 * abi_x86_32.x86: running multilib-minimal_abi_src_configure
meson setup --buildtype plain --libdir lib --localstatedir /var/lib --prefix /usr --sysconfdir /etc --wrap-mode nodownload --build.pkg-config-path /usr/share/pkgconfig:/usr/share/pkgconfig --pkg-config-path /usr/share/pkgconfig:/usr/share/pkgconfig --native-file /var/tmp/portage/app-emulation/gallium-nine-standalone-0.7/temp/meson.i686-pc-linux-gnu.x86.ini --cross-file /var/tmp/portage/app-emulation/gallium-nine-standalone-0.7/work/wine-nine-standalone-0.7/tools/cross-wine32 --bindir lib -Ddistro-independent=false -Ddri2=false /var/tmp/portage/app-emulation/gallium-nine-standalone-0.7/work/wine-nine-standalone-0.7 /var/tmp/portage/app-emulation/gallium-nine-standalone-0.7/work/wine-nine-standalone-0.7-abi_x86_32.x86
The Meson build system
Version: 0.55.3
Source dir: /var/tmp/portage/app-emulation/gallium-nine-standalone-0.7/work/wine-nine-standalone-0.7
Build dir: /var/tmp/portage/app-emulation/gallium-nine-standalone-0.7/work/wine-nine-standalone-0.7-abi_x86_32.x86
Build type: cross build
Program tools/get_version.sh found: YES
Project name: Gallium Nine Standalone
Project version: 0.7.0.0-release
C compiler for the build machine: x86_64-pc-linux-gnu-gcc -m32 (gcc 10.2.0 "x86_64-pc-linux-gnu-gcc (Gentoo 10.2.0-r3 p4) 10.2.0")
C linker for the build machine: x86_64-pc-linux-gnu-gcc -m32 ld.gold 2.35.1
C compiler for the host machine: winegcc (gcc 10.2.0 "x86_64-pc-linux-gnu-gcc (Gentoo 10.2.0-r3 p4) 10.2.0")
C linker for the host machine: winegcc ld.gold 2.35.1
Build machine cpu family: x86
Build machine cpu: i686
Host machine cpu family: x86
Host machine cpu: i686
Target machine cpu family: x86
Target machine cpu: i686
Program winegcc found: YES
Checking if "winelib check" compiles: YES 

../wine-nine-standalone-0.7/meson.build:42:0: ERROR: C shared or static library 'wine' not found`

This is similar to #5, but I can't manually install the 32-bit versions of the libraries. However, both wine and mesa were build with 32-bit support:

$ emerge -pv1 mesa wine-vanilla

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild   R    ] media-libs/mesa-20.3.1::gentoo  USE="X classic d3d9 dri3 egl gallium gbm gles2 llvm vaapi vulkan vulkan-overlay wayland zstd -debug -gles1 -lm-sensors -opencl -osmesa (-selinux) -test -unwind -valgrind -vdpau -xa -xvmc -zink" 
ABI_X86="32 (64) (-x32)" 
VIDEO_CARDS="radeonsi (-freedreno) -i915 -i965 -intel -iris (-lima) -nouveau (-panfrost) -r100 -r200 -r300 -r600 -radeon (-v3d) (-vc4) -virgl (-vivante) -vmware" 0 KiB
[ebuild   R    ] app-emulation/wine-vanilla-5.22-r2:5.22::gentoo  USE="X alsa faudio fontconfig gecko jpeg lcms mono nls opengl perl png pulseaudio realtime run-exes ssl threads truetype udev udisks unwind vulkan xcomposite xml -capi -cups -custom-cflags -dos -gphoto2 -gsm -gssapi -gstreamer -kerberos -ldap -mingw -mp3 -netapi -odbc -openal -opencl -osmesa -oss -pcap -prelink -samba -scanner -sdl (-selinux) -test -v4l -vkd3d -xinerama (-ncurses%*)" 
ABI_X86="32 64 (-x32)" 23,706 KiB

Total: 2 packages (2 reinstalls), Size of downloads: 23,706 KiB

This looks like meson simply can't find the library, despite the fact that it is installed:

$ ls /usr/lib/wine-vanilla-5.22
bin  libwine.so  libwine.so.1  libwine.so.1.0  wine
$ ls /usr/lib64/wine-vanilla-5.22
bin  libwine.so  libwine.so.1  libwine.so.1.0  wine

On the other hand, ldconfig has no idea that libwine exists, as ldconfig -p | grep wine returns nothing. But even if I manually add the directories to ldconfig, the build fails with the same problem.

What can I do about this?

B4ckslash commented 3 years ago

Quick update: running emerge like this:

# LIBRARY_PATH="/usr/lib/wine-vanilla-5.22/:$LIBRARY_PATH" emerge -av gallium-nine-standalone

makes meson find the wine libs, but fail at finding libdl:

* Package:    app-emulation/gallium-nine-standalone-0.7
 * Repository: gentoo
 * Maintainer: chewi@gentoo.org wine@gentoo.org
 * USE:        abi_x86_32 abi_x86_64 amd64 elibc_glibc kernel_linux userland_GNU
 * FEATURES:   network-sandbox preserve-libs sandbox userpriv usersandbox
 * FEATURES='assume-digests binpkg-docompress binpkg-dostrip binpkg-logs cgroup config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch parallel-install pid-sandbox preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr'
 * CFLAGS='-march=native -O3 -fgraphite-identity -floop-nest-optimize -fdevirtualize-at-ltrans -fipa-pta -fno-semantic-interposition -flto=24 -fuse-linker-plugin -pipe -Wl,-O1 -Wl,--as-needed'
 * CXXFLAGS='-march=native -O3 -fgraphite-identity -floop-nest-optimize -fdevirtualize-at-ltrans -fipa-pta -fno-semantic-interposition -flto=24 -fuse-linker-plugin -pipe -Wl,-O1 -Wl,--as-needed'
 * FFLAGS='-march=native -O3 -fgraphite-identity -floop-nest-optimize -fdevirtualize-at-ltrans -fipa-pta -fno-semantic-interposition -flto=24 -fuse-linker-plugin -pipe -Wl,-O1 -Wl,--as-needed'
 * FCFLAGS='-march=native -O3 -fgraphite-identity -floop-nest-optimize -fdevirtualize-at-ltrans -fipa-pta -fno-semantic-interposition -flto=24 -fuse-linker-plugin -pipe -Wl,-O1 -Wl,--as-needed'
 * F77FLAGS='-march=native -O3 -fgraphite-identity -floop-nest-optimize -fdevirtualize-at-ltrans -fipa-pta -fno-semantic-interposition -flto=24 -fuse-linker-plugin -pipe -Wl,-O1 -Wl,--as-needed'
 * LDFLAGS='-Wl,-O1 -Wl,--as-needed -march=native -O3 -fgraphite-identity -floop-nest-optimize -fdevirtualize-at-ltrans -fipa-pta -fno-semantic-interposition -flto=24 -fuse-linker-plugin -pipe'
 * MAKEOPTS='-j24 -l24'
 * gcc (Gentoo 10.2.0-r3 p4) 10.2.0
 * g++ (Gentoo 10.2.0-r3 p4) 10.2.0
 * GNU gold (Gentoo 2.35.1 p2 2.35.1) 1.16
 * Linux rust 5.10.0 #5 SMP Tue Dec 15 22:01:32 CET 2020 x86_64 AMD Ryzen 9 3900X 12-Core Processor AuthenticAMD GNU/Linux
>>> Unpacking source...
>>> Unpacking gallium-nine-standalone-0.7.tar.gz to /var/tmp/portage/app-emulation/gallium-nine-standalone-0.7/work
>>> Source unpacked in /var/tmp/portage/app-emulation/gallium-nine-standalone-0.7/work
>>> Preparing source in /var/tmp/portage/app-emulation/gallium-nine-standalone-0.7/work/wine-nine-standalone-0.7 ...
 * Applying 0.7-cross-files.patch ...
 [ ok ]
 * Applying 0.3-nine-dll-path.patch ...
patching file ninewinecfg/main.c
Hunk #1 succeeded at 28 with fuzz 2 (offset -4 lines).
 [ ok ]
 * abi_x86_32.x86: running bootstrap_nine
 * abi_x86_64.amd64: running bootstrap_nine
>>> Source prepared.
>>> Configuring source in /var/tmp/portage/app-emulation/gallium-nine-standalone-0.7/work/wine-nine-standalone-0.7 ...
 * abi_x86_32.x86: running multilib-minimal_abi_src_configure
meson setup --buildtype plain --libdir lib --localstatedir /var/lib --prefix /usr --sysconfdir /etc --wrap-mode nodownload --build.pkg-config-path /usr/share/pkgconfig:/usr/share/pkgconfig --pkg-config-path /usr/share/pkgconfig:/usr/share/pkgconfig --native-file /var/tmp/portage/app-emulation/gallium-nine-standalone-0.7/temp/meson.i686-pc-linux-gnu.x86.ini --cross-file /var/tmp/portage/app-emulation/gallium-nine-standalone-0.7/work/wine-nine-standalone-0.7/tools/cross-wine32 --bindir lib -Ddistro-independent=false -Ddri2=false /var/tmp/portage/app-emulation/gallium-nine-standalone-0.7/work/wine-nine-standalone-0.7 /var/tmp/portage/app-emulation/gallium-nine-standalone-0.7/work/wine-nine-standalone-0.7-abi_x86_32.x86
The Meson build system
Version: 0.55.3
Source dir: /var/tmp/portage/app-emulation/gallium-nine-standalone-0.7/work/wine-nine-standalone-0.7
Build dir: /var/tmp/portage/app-emulation/gallium-nine-standalone-0.7/work/wine-nine-standalone-0.7-abi_x86_32.x86
Build type: cross build
Program tools/get_version.sh found: YES
Project name: Gallium Nine Standalone
Project version: 0.7.0.0-release
C compiler for the build machine: x86_64-pc-linux-gnu-gcc -m32 (gcc 10.2.0 "x86_64-pc-linux-gnu-gcc (Gentoo 10.2.0-r3 p4) 10.2.0")
C linker for the build machine: x86_64-pc-linux-gnu-gcc -m32 ld.gold 2.35.1
C compiler for the host machine: winegcc (gcc 10.2.0 "x86_64-pc-linux-gnu-gcc (Gentoo 10.2.0-r3 p4) 10.2.0")
C linker for the host machine: winegcc ld.gold 2.35.1
Build machine cpu family: x86
Build machine cpu: i686
Host machine cpu family: x86
Host machine cpu: i686
Target machine cpu family: x86
Target machine cpu: i686
Program winegcc found: YES
Checking if "winelib check" compiles: YES 
Library wine found: YES
Header <windows.h> has symbol "wine_get_unix_file_name" : YES 
Program wrc found: YES
Checking for function "dlopen" : NO 

../wine-nine-standalone-0.7/meson.build:64:2: ERROR: C shared or static library 'dl' not found
dhewg commented 3 years ago

It dosn't need libwine, that was basically a sanity check. But that's already gone, see bddb53abdd1a77b1c019457f7eea4a6404a5e492

I'm not sure why it fails to find libdl though. That sounds more like a gentoo specific issue. Ping @chewi

dhewg commented 3 years ago

May be related to https://bugs.gentoo.org/730542 https://gitweb.gentoo.org/repo/gentoo.git/commit/app-emulation/gallium-nine-standalone?id=d16897964aed980a2bf5b0a173a459a0db295922

@chewi if *-pc-linux-gnu-pkg-config isn't correct anymore, it's better to fix that in boottrap.sh, but I can't tell as I'm not a gentoo user

chewi commented 3 years ago

Thanks for the heads up. I've now applied that fix to 0.7.

I wasn't able to reproduce the libdl issue, even when setting LIBRARY_PATH. @B4ckslash, please try again with the updated ebuild.

B4ckslash commented 3 years ago

Hi,

it unfortunately does not fix the issue with libdl, but I no longer need to add the LIBRARY_PATH to find libwine.

Meanwhile, out of curiosity, I cloned the repo and just manually built it with ./release.sh, and everything ran without an issue. It still complained about being unable to find dlopen, but it found libdl just fine and managed to build it all:

additional meson args: 
found gentoo compatible distro
DEPRECATION: c_args in the [properties] section of the machine file is deprecated, use the [built-in options] section.
DEPRECATION: c_link_args in the [properties] section of the machine file is deprecated, use the [built-in options] section.
The Meson build system
Version: 0.56.2
Source dir: /home/marcus/git/wine-nine-standalone
Build dir: /tmp/tmp.4VDrxX99yz/build64
Build type: cross build
Program tools/get_version.sh found: YES (/home/marcus/git/wine-nine-standalone/tools/get_version.sh)
Project name: Gallium Nine Standalone
Project version: 0.8.0.372-devel
C compiler for the host machine: winegcc (gcc 10.2.0 "x86_64-pc-linux-gnu-gcc (Gentoo 10.2.0-r5 p6) 10.2.0")
C linker for the host machine: winegcc ld.gold 2.35.2
C compiler for the build machine: ccache cc (gcc 10.2.0 "cc (Gentoo 10.2.0-r5 p6) 10.2.0")
C linker for the build machine: cc ld.gold 2.35.2
Build machine cpu family: x86_64
Build machine cpu: x86_64
Host machine cpu family: x86_64
Host machine cpu: x86_64
Target machine cpu family: x86_64
Target machine cpu: x86_64
Program winegcc found: YES (/usr/bin/winegcc)
Checking if "winegcc check" compiles: YES 
Header <windows.h> has symbol "wine_get_unix_file_name" : YES 
Program wrc found: YES (/usr/bin/wrc)
Checking for function "dlopen" : NO 
Library dl found: YES
Checking for function "dlopen" with dependency -ldl: YES 
Checking for function "dlclose" with dependency -ldl: YES 
Checking for function "dlsym" with dependency -ldl: YES 
Checking for function "dladdr" with dependency -ldl: YES 
Found pkg-config: /usr/bin/x86_64-pc-linux-gnu-pkg-config (1.7.3)
Run-time dependency d3d found: YES 1.0.0
Run-time dependency x11 found: YES 1.7.0
Run-time dependency x11-xcb found: YES 1.7.0
Run-time dependency xcb found: YES 1.14
Run-time dependency xcb-dri3 found: YES 1.14
Run-time dependency xcb-present found: YES 1.14
Run-time dependency xcb-xfixes found: YES 1.14
Run-time dependency gl found: YES 1.2
Run-time dependency egl found: YES 1.5
Run-time dependency xcb-dri2 found: YES 1.14
Message: DRI2 support is enabled
Library dxguid found: YES
Library uuid found: YES
Library advapi32 found: YES
Library gdi32 found: YES
Library user32 found: YES
Library shell32 found: YES
Library comctl32 found: YES
Library ole32 found: YES
Message: d3dadapter9.so.1 default module path: /usr/lib64/d3d
d3d9-nine/meson.build:53: WARNING: extract_all_objects called without setting recursive keyword argument. Meson currently defaults to non-recursive to maintain backward compatibility but the default will be changed in the future.
Build targets in project: 7

Option buildtype is: release [default: debugoptimized]
Found ninja-1.10.2 at /usr/bin/ninja
ninja: Entering directory `/tmp/tmp.4VDrxX99yz/build64'
[21/22] Installing files.
Installing d3d9-nine/d3d9-nine.dll.so to /tmp/tmp.4VDrxX99yz/gallium-nine-standalone/lib64
Installing d3d9-nine/d3d9-nine.dll.fake to /tmp/tmp.4VDrxX99yz/gallium-nine-standalone/lib64
Installing ninewinecfg/ninewinecfg.exe.so to /tmp/tmp.4VDrxX99yz/gallium-nine-standalone/bin64
Installing ninewinecfg/ninewinecfg.exe.fake to /tmp/tmp.4VDrxX99yz/gallium-nine-standalone/bin64

So this seems promising. Thanks in advance!

(Edit: seems that I am still using yesterdays' ebuild, since Gentoo always grabs the mirror archives from the previous day or older when syncing. I'll report back tomorrow when I can use the new one)

chewi commented 3 years ago
Checking for function "dlopen" : NO 
Library dl found: YES
Checking for function "dlopen" with dependency -ldl: YES 

I get this too but this is normal. I think it is trying dlopen without looking at libdl first in case it is built into libc.

B4ckslash commented 3 years ago

Still not working with normal emerge. I have no idea why emerge refuses to find libdl when it is clearly present for all users and both arches that I need. I also manually built with the portage user just for testing, and it worked a charm as well. It's just emerge that pretends libdl does not exist.

Any other ideas?

V10lator commented 3 years ago

@B4ckslash Remove LTO from your FLAGS and it will work. Generally whenever you face such a bug the first thing to try is to rebuild with [save FLAGS](https://wiki.gentoo.org/wiki/Safe_CFLAGS) (i.e. -march=native -O2 -pipe).

chewi commented 3 years ago

I can confirm that having -flto in my flags reproduces it. I don't know much about LTO but perhaps you haven't built glibc with it. In any case, I don't think this is a problem with this project or the ebuild.

B4ckslash commented 3 years ago

@V10lator yeah makes sense. That would've been my first idea too if the build failed during compile or linking. I've never had the LTO flags messing up library discovery.

@chewi my whole system is build w/ LTO, so glibc is as well. But this looks like a bug to raise with the people over in the GentooLTO repo.

Thanks all the same!