00cpxxx/wine-xinput

Build Failing on Wine Staging 2.0

Closed this issue · 16 comments

I'm currently getting...

xinput1_3_main.o: In function `dinput_acquire':
xinput1_3_main.c:(.text+0x42): undefined reference to `c_dfDIJoystick2'
xinput1_3_main.o: In function `dinput_start':
xinput1_3_main.c:(.text+0x80f): undefined reference to `IID_IDirectInput8A'
/usr/bin/ld: xinput1_3_main.o: relocation R_X86_64_PC32 against undefined hidden symbol `IID_IDirectInput8A' can not be used when making a shared object
/usr/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status
winegcc: gcc failed
make[1]: *** [Makefile:222: xinput9_1_0.dll.so] Error 2
make[1]: Leaving directory '/mnt/store/Build/pkg-autobuild/wine-staging-git/src/wine-staging-git-64-build/dlls/xinput9_1_0'
make: *** [Makefile:19723: dlls/xinput9_1_0] Error 2
make: *** Waiting for unfinished jobs....

... when trying to build the quigon patch against Wine Staging 2.0. Do you know if it should currently be compatible or not?

(just to clarify, the build works fine without your patch)

Hi, the patch works fine in Wine 2.0. The log suggests that Makefile.in changes were to applied to Makefile so the libraries required (dinput, dinput8, ole32...) are not linking.

Please re-run "./configure && make" to ensure the Makefiles are updated.

I actually deleted the entire build folder and started from scratch, no change in behaviour. I'll retry again from scratch just in case.

It should be something else then. Are you trying to compile Wine --enable-win64?

Yup, here's the build part of the script.

    ## Build Wine 64bit (64 must be built before 32)
    msg2 "Building Wine-64..."
    mkdir -p "${srcdir}/${pkgname}-64-build"
    cd  "${srcdir}/${pkgname}-64-build"
    ../wine-git/configure --prefix=/usr --libdir=/usr/lib --with-x --enable-win64
    make

    export PKG_CONFIG_PATH="/usr/lib32/pkgconfig"

    ## Build Wine 32bit
    msg2 "Building Wine-32..."
    mkdir -p "${srcdir}/${pkgname}-32-build"
    cd "${srcdir}/${pkgname}-32-build"
    ../wine-git/configure --prefix=/usr --libdir=/usr/lib32 --with-x --enable-win16 --with-wine64="${srcdir}/${pkgname}-64-build"
    make

Can you please paste the dlls/xinput1_3/Makefile somewhere (eg pastebin) and reference here?

Not much to it (src/wine-git/dlls/xinput1_3/Makefile.in). There's only a ".in" file, no "Makefile" on its own.

MODULE    = xinput1_3.dll
IMPORTLIB = xinput
IMPORTS   = uuid dxguid dinput dinput8 ole32

C_SRCS = \
        xinput1_3_main.c

RC_SRCS = version.rc

Sorry, I was not clear. You have to get the Makefile from inside the folder where wine is building. Makefile.in is a recipe that is converted into a real Makefile. For example in my build:

/programs/wine/dlls/xinput1_3/Makefile.in << source
/programs/wine32/dlls/xinput1_3/Makefile << build

Thanks, it is mostly identical to mine, only library path differences. For now I have no clues about what that could be. I just did a 64bit wine build and it works fine too.

Can you try in plain Wine instead of Wine Staging?

I'm just waiting for Staging 2.1 to be released so I can test too, since I'm always on wine-git the staging patches don't apply.

I'll build Wine with it now (without staging) and let you know.

I figured out which staging patchset causes the build to fail - it's xinput9_1_0-Parentsrc ("Build independent xinput9_1_0.dll instead of using forwards."). I tested compilation with all staging patches but this one applied, it compiles fine. Here's the patch contents for convenience:

--- a/dlls/xinput9_1_0/Makefile.in
+++ b/dlls/xinput9_1_0/Makefile.in
@@ -1,3 +1,7 @@
 MODULE    = xinput9_1_0.dll
+PARENTSRC = ../xinput1_3
+
+C_SRCS = \
+       xinput1_3_main.c

--- a/dlls/xinput9_1_0/xinput9_1_0.spec
+++ b/dlls/xinput9_1_0/xinput9_1_0.spec
@@ -1,4 +1,4 @@
-@ stdcall XInputGetCapabilities(long long ptr) xinput1_3.XInputGetCapabilities
-@ stdcall XInputGetDSoundAudioDeviceGuids(long ptr ptr) xinput1_3.XInputGetDSoundAudioDeviceGuids
-@ stdcall XInputSetState(long ptr) xinput1_3.XInputSetState
-@ stdcall XInputGetState(long ptr) xinput1_3.XInputGetState
+@ stdcall XInputGetCapabilities(long long ptr)
+@ stdcall XInputGetDSoundAudioDeviceGuids(long ptr ptr)
+@ stdcall XInputSetState(long ptr)
+@ stdcall XInputGetState(long ptr)

Sorry for not getting back, ran into some kernel issues. Wesmania seems to have nailed it though.

Thanks for the hints in this issue. I'm currently stuck in real life so it will take a few more days to write a patch that is compatible with Staging.

Sorry for the lack of changes, please use https://github.com/Tetralet/wine-xinput instead.
I'm now working on merging Xinput to Wine, so maybe in a few more months patching won't be required anymore.

There only appears to have ever been a single patch on the Tetralet branch and there's no issue tracker available there either from what I can tell. Is that branch supposed to be abandoned?

Regarding proper Wine support, is there anywhere tracking the state of XInput support? (excluding watching the incoming patchlist / Wine GIT repo directly). I guess closest thing to see raw progress would be - https://source.winehq.org/git/wine.git/?a=search&h=HEAD&st=commit&s=%28dinput%7Cxinput%29&sr=1