M-Reimer / wine-lol

PKGBUILDs to package GloriousEggroll's LoL-patched wine version
163 stars 20 forks source link

[wine-lol] build error `conflicting types for ldap_connect` #94

Closed ezracelli closed 2 years ago

ezracelli commented 2 years ago

full error:

$ makepkg -sir

-- snip --

make[1]: Entering directory '/home/ezra/code/aur/wine-lol/wine-lol/src/wine-lol-32-build/dlls/wldap32'
gcc -m32 -c -o add.o ../../../wine-lol/dlls/wldap32/add.c -I. -I../../../wine-lol/dlls/wldap32 \
  -I../../include -I../../../wine-lol/include -D__WINESRC__ -D_REENTRANT -fno-PIC \
  -fasynchronous-unwind-tables -Wall -pipe -fcf-protection=none -fno-stack-protector \
  -fno-strict-aliasing -Wdeclaration-after-statement -Wempty-body -Wignored-qualifiers \
  -Wno-packed-not-aligned -Wshift-overflow=2 -Wstrict-prototypes -Wtype-limits \
  -Wunused-but-set-parameter -Wvla -Wwrite-strings -Wpointer-arith -Wlogical-op \
  -fno-omit-frame-pointer -m32 -march=x86-64 -mtune=generic -O2 -pipe  -fexceptions         -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security         -fstack-clash-protection -fcf-protection -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0
<command-line>: warning: "_FORTIFY_SOURCE" redefined
<command-line>: note: this is the location of the previous definition
In file included from ../../../wine-lol/dlls/wldap32/add.c:33:
../../../wine-lol/dlls/wldap32/winldap_private.h:323:13: error: conflicting types for ‘ldap_connect’; have ‘ULONG(WLDAP32_LDAP *, LDAP_TIMEVAL *)’ {aka ‘unsigned int(struct wldap32 *, struct l_timeval *)’}
  323 | ULONG CDECL ldap_connect(WLDAP32_LDAP*,LDAP_TIMEVAL*);
      |             ^~~~~~~~~~~~
In file included from ../../../wine-lol/dlls/wldap32/add.c:26:
/usr/include/ldap.h:1555:1: note: previous declaration of ‘ldap_connect’ with type ‘int(LDAP *)’ {aka ‘int(struct ldap *)’}
 1555 | ldap_connect( LDAP *ld );
      | ^~~~~~~~~~~~
make[1]: *** [Makefile:208: add.o] Error 1
make[1]: Leaving directory '/home/ezra/code/aur/wine-lol/wine-lol/src/wine-lol-32-build/dlls/wldap32'
make: *** [Makefile:9310: dlls/wldap32] Error 2
==> ERROR: A failure occurred in build().
    Aborting...

current LDAP-related libraries installed:

$ pacman -Qs ldap
local/krb5 1.19.2-2
local/ldb 2:2.4.1-2
local/lib32-krb5 1.19.2-2
local/lib32-libldap 2.6.0-1
local/libldap 2.6.0-2

misc system info:

$ neofetch --stdout
OS: Arch Linux x86_64
Kernel: 5.15.5-arch1-1
Packages: 939 (pacman)
Shell: zsh 5.8
CPU: AMD Ryzen 7 2700X (16) @ 4.000GHz
GPU: AMD ATI Radeon RX 470/480/570/570X/580/580X/590
Memory: 4483MiB / 32068MiB
ezracelli commented 2 years ago

after finding this discussion in the AUR comments for wine-valve, i downgraded libldap and lib32-libldap to 2.4.59-1 and was able to build successfully :sparkles:

M-Reimer commented 2 years ago

As always the reminder: For a fast fix it is always possible to use the binary packages: https://m-reimer.de/wine-lol/

There probably was some fix in upstream wine to cover this. Would be really nice if someone tried to find the relevant change. It probably happened in the file referenced in the build errors. The proper fix would be to backport this change.

I will probably not find the time to fix this in the near future without anyone helping with finding the commit that fixes the issue or, even better, provides a Pull Request.

yuiiio commented 2 years ago

at upstream wine, this problem is not happen because change build system for pe-build. but. wine-stable branch has same issue(conflict ldap func name), https://bugs.winehq.org/show_bug.cgi?id=51129 I personaly use this change https://github.com/yuiiio/wine-lol-src/commit/69b2494e526246aab5f32c7b233594a393988a51

M-Reimer commented 2 years ago

Thanks to @yuiiio for his fix and @kyechou for the Pull Request.

AUR is updated now. I did not rebuild any binaries as I think the old ones will still work.

Disclaimer: I did not test anything. Stopped playing LoL about 2 years ago.