https://bugs.winehq.org/show_bug.cgi?id=51129
Bug ID: 51129 Summary: Function name conflict (ldap_connect) with OpenLDAP 2.5 Product: Wine Version: unspecified Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: wldap32 Assignee: wine-bugs@winehq.org Reporter: sergio.durigan@canonical.com Distribution: ---
Hello,
Wine installs the "/usr/include/wine/wine/windows/winldap.h" file, which exports the ldap_connect function:
ULONG CDECL ldap_connect(LDAP*,struct l_timeval*);
With the recent OpenLDAP 2.5 release, we now have an "ldap_connection" function being exported by it as well (with a different prototype):
https://git.openldap.org/openldap/openldap/-/blame/OPENLDAP_REL_ENG_2_5_4/in...
This will need to be fixed in order to prevent linking problems with OpenLDAP.
https://bugs.winehq.org/show_bug.cgi?id=51129
--- Comment #1 from Sergio Durigan Junior sergio.durigan@canonical.com --- For what it's worth, I haven't checked whether other ldap_* functions have the same problem.
https://bugs.winehq.org/show_bug.cgi?id=51129
--- Comment #2 from Hans Leidekker hans@meelstraat.net --- (In reply to Sergio Durigan Junior from comment #0)
Wine installs the "/usr/include/wine/wine/windows/winldap.h" file, which exports the ldap_connect function:
ULONG CDECL ldap_connect(LDAP*,struct l_timeval*);
With the recent OpenLDAP 2.5 release, we now have an "ldap_connection" function being exported by it as well (with a different prototype):
https://git.openldap.org/openldap/openldap/-/blame/OPENLDAP_REL_ENG_2_5_4/ include/ldap.h#L1553
This will need to be fixed in order to prevent linking problems with OpenLDAP.
What linking problem do you see?
https://bugs.winehq.org/show_bug.cgi?id=51129
--- Comment #3 from Sergio Durigan Junior sergio.durigan@canonical.com --- (In reply to Hans Leidekker from comment #2)
(In reply to Sergio Durigan Junior from comment #0)
Wine installs the "/usr/include/wine/wine/windows/winldap.h" file, which exports the ldap_connect function:
ULONG CDECL ldap_connect(LDAP*,struct l_timeval*);
With the recent OpenLDAP 2.5 release, we now have an "ldap_connection" function being exported by it as well (with a different prototype):
https://git.openldap.org/openldap/openldap/-/blame/OPENLDAP_REL_ENG_2_5_4/ include/ldap.h#L1553
This will need to be fixed in order to prevent linking problems with OpenLDAP.
What linking problem do you see?
OK, let me backtrack a bit. I'm not familiar with Wine, so apologies for any misunderstandings here.
I gave it a try and it seems that the "winldap.h" file is supposed to contain the Windows-specific definitions of OpenLDAP's "ldap.h", am I right? I gave it a try here, and I try to include both "winldap.h" and "ldap.h" I get a bunch of errors due to conflicting definitions:
$ gcc -l:wldap32.dll.so test.c -I/usr/include/wine/wine/windows/ -L/usr/lib/x86_64-linux-gnu/wine/ -lldap In file included from /usr/include/ldap.h:30, from test.c:3: /usr/include/lber.h:212:16: error: redefinition of ‘struct berval’ 212 | typedef struct berval { | ^~~~~~ In file included from test.c:2: /usr/include/wine/wine/windows/winldap.h:276:16: note: originally defined here 276 | typedef struct berval | ^~~~~~ In file included from /usr/include/ldap.h:30, from test.c:3: /usr/include/lber.h:215:3: error: conflicting types for ‘BerValue’ 215 | } BerValue; | ^~~~~~~~ .... and on it goes
In this case, and IIUC, "winldap.h" is not supposed to be used along with "ldap.h". I don't know if Wine offers its own version of libldap for Windows, but it seems to be the case given the "winldap32.dll.so" shlib. Is this a correct assumption? If it is, then this bug should probably be closed as invalid (and I apologize for the noise).
Thanks.
https://bugs.winehq.org/show_bug.cgi?id=51129
Hans Leidekker hans@meelstraat.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |INVALID Status|UNCONFIRMED |RESOLVED
--- Comment #4 from Hans Leidekker hans@meelstraat.net --- (In reply to Sergio Durigan Junior from comment #3)
I gave it a try and it seems that the "winldap.h" file is supposed to contain the Windows-specific definitions of OpenLDAP's "ldap.h", am I right? I gave it a try here, and I try to include both "winldap.h" and "ldap.h" I get a bunch of errors due to conflicting definitions:
$ gcc -l:wldap32.dll.so test.c -I/usr/include/wine/wine/windows/ -L/usr/lib/x86_64-linux-gnu/wine/ -lldap In file included from /usr/include/ldap.h:30,
from test.c:3:
/usr/include/lber.h:212:16: error: redefinition of ‘struct berval’
212 | typedef struct berval {
| ^~~~~~
In file included from test.c:2:
/usr/include/wine/wine/windows/winldap.h:276:16: note: originally defined here 276 | typedef struct berval | ^~~~~~ In file included from /usr/include/ldap.h:30, from test.c:3: /usr/include/lber.h:215:3: error: conflicting types for ‘BerValue’ 215 | } BerValue; | ^~~~~~~~ .... and on it goes
In this case, and IIUC, "winldap.h" is not supposed to be used along with "ldap.h". I don't know if Wine offers its own version of libldap for Windows, but it seems to be the case given the "winldap32.dll.so" shlib. Is this a correct assumption? If it is, then this bug should probably be closed as invalid (and I apologize for the noise).
Wine implements the wldap32 dll on top of openldap. As you found it's not possible to include both headers in the same file due to conflicts.
https://bugs.winehq.org/show_bug.cgi?id=51129
--- Comment #5 from Sergio Durigan Junior sergio.durigan@canonical.com --- (In reply to Hans Leidekker from comment #4)
Wine implements the wldap32 dll on top of openldap. As you found it's not possible to include both headers in the same file due to conflicts.
Alright, thanks for confirming.
https://bugs.winehq.org/show_bug.cgi?id=51129
Sergio Durigan Junior sergio.durigan@canonical.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Resolution|INVALID |--- Version|unspecified |6.0 Status|RESOLVED |UNCONFIRMED
--- Comment #6 from Sergio Durigan Junior sergio.durigan@canonical.com --- Hi again,
Let me give this another try. I am taking the liberty to "reopen" this bug (even though Bugzilla won't let me set its status to NEW, just to UNCONFIRMED) because there *is* a build failure that is happening with Wine 6.0 (stable) when I link it against OpenLDAP 2.5. This build failure doesn't happen with the development version of Wine (I tried Wine 6.9).
After talking to the Debian Wine package maintainer, he suggested that I file a bug upstream requesting the backport of the patch series that fix this build failure for Wine 6.9 for the next point release of Wine (I'm assuming Wine 6.0.1 or some such). This would be extremely helpful for downstream projects that are working towards updating to OpenLDAP 2.5 but are using Wine stable.
Please let me know if you need more details and I'll be happy to provide them.
Thank you in advance.
https://bugs.winehq.org/show_bug.cgi?id=51129
--- Comment #7 from Hans Leidekker hans@meelstraat.net --- (In reply to Sergio Durigan Junior from comment #6)
Let me give this another try. I am taking the liberty to "reopen" this bug (even though Bugzilla won't let me set its status to NEW, just to UNCONFIRMED) because there *is* a build failure that is happening with Wine 6.0 (stable) when I link it against OpenLDAP 2.5. This build failure doesn't happen with the development version of Wine (I tried Wine 6.9).
After talking to the Debian Wine package maintainer, he suggested that I file a bug upstream requesting the backport of the patch series that fix this build failure for Wine 6.9 for the next point release of Wine (I'm assuming Wine 6.0.1 or some such). This would be extremely helpful for downstream projects that are working towards updating to OpenLDAP 2.5 but are using Wine stable.
It's probably the PE conversion that 'fixed' this, which might be a bit too much to backport to stable.
https://bugs.winehq.org/show_bug.cgi?id=51129
--- Comment #8 from Sergio Durigan Junior sergio.durigan@canonical.com --- (In reply to Hans Leidekker from comment #7)
(In reply to Sergio Durigan Junior from comment #6)
Let me give this another try. I am taking the liberty to "reopen" this bug (even though Bugzilla won't let me set its status to NEW, just to UNCONFIRMED) because there *is* a build failure that is happening with Wine 6.0 (stable) when I link it against OpenLDAP 2.5. This build failure doesn't happen with the development version of Wine (I tried Wine 6.9).
After talking to the Debian Wine package maintainer, he suggested that I file a bug upstream requesting the backport of the patch series that fix this build failure for Wine 6.9 for the next point release of Wine (I'm assuming Wine 6.0.1 or some such). This would be extremely helpful for downstream projects that are working towards updating to OpenLDAP 2.5 but are using Wine stable.
It's probably the PE conversion that 'fixed' this, which might be a bit too much to backport to stable.
Thanks for the reply.
Do you think it would be possible to fix this with a less intrusive approach?
Thanks.
https://bugs.winehq.org/show_bug.cgi?id=51129
--- Comment #9 from Hans Leidekker hans@meelstraat.net --- (In reply to Sergio Durigan Junior from comment #8)
(In reply to Hans Leidekker from comment #7)
(In reply to Sergio Durigan Junior from comment #6) It's probably the PE conversion that 'fixed' this, which might be a bit too much to backport to stable.
Thanks for the reply.
Do you think it would be possible to fix this with a less intrusive approach?
Probably, though it's up to the stable maintainer to accept it. Can you post the error you get when building Wine 6.0 against OpenLDAP 2.5?
https://bugs.winehq.org/show_bug.cgi?id=51129
--- Comment #10 from Sergio Durigan Junior sergio.durigan@canonical.com --- Created attachment 70063 --> https://bugs.winehq.org/attachment.cgi?id=70063 Build failure log
Sure, I'm attaching the excerpt to this bug.
https://bugs.winehq.org/show_bug.cgi?id=51129
--- Comment #11 from Hans Leidekker hans@meelstraat.net --- Created attachment 70064 --> https://bugs.winehq.org/attachment.cgi?id=70064 patch
Does this patch help?
https://bugs.winehq.org/show_bug.cgi?id=51129
--- Comment #12 from Sergio Durigan Junior sergio.durigan@canonical.com --- (In reply to Hans Leidekker from comment #11)
Does this patch help?
Well, yeah, I'm almost sure it should fix the problem, but this also breaks the API/ABI of wldap32. Is that OK?
https://bugs.winehq.org/show_bug.cgi?id=51129
--- Comment #13 from Hans Leidekker hans@meelstraat.net --- (In reply to Sergio Durigan Junior from comment #12)
(In reply to Hans Leidekker from comment #11)
Does this patch help?
Well, yeah, I'm almost sure it should fix the problem, but this also breaks the API/ABI of wldap32. Is that OK?
No it doesn't.
https://bugs.winehq.org/show_bug.cgi?id=51129
--- Comment #14 from Sergio Durigan Junior sergio.durigan@canonical.com --- OK, let me give this patch a try and I will let you know if it works. Thanks.
https://bugs.winehq.org/show_bug.cgi?id=51129
Gianfranco costamagnagianfranco@yahoo.it changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |costamagnagianfranco@yahoo. | |it
--- Comment #15 from Gianfranco costamagnagianfranco@yahoo.it --- Hello, thanks Hans for the patch, looks like wine is now correctly built on Ubuntu! https://launchpad.net/ubuntu/+source/wine-development/5.17-1ubuntu1
https://bugs.winehq.org/show_bug.cgi?id=51129
Hans Leidekker hans@meelstraat.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|--- |6.0.x Distribution|--- |Ubuntu
--- Comment #16 from Hans Leidekker hans@meelstraat.net --- (In reply to Gianfranco from comment #15)
Hello, thanks Hans for the patch, looks like wine is now correctly built on Ubuntu! https://launchpad.net/ubuntu/+source/wine-development/5.17-1ubuntu1
Thanks for testing. Adding 6.0.x target so it can be considered for the next stable release.
https://bugs.winehq.org/show_bug.cgi?id=51129
--- Comment #17 from Sergio Durigan Junior sergio.durigan@canonical.com --- (In reply to Hans Leidekker from comment #16)
(In reply to Gianfranco from comment #15)
Hello, thanks Hans for the patch, looks like wine is now correctly built on Ubuntu! https://launchpad.net/ubuntu/+source/wine-development/5.17-1ubuntu1
Thanks for testing. Adding 6.0.x target so it can be considered for the next stable release.
Sorry, I forgot to get back to this bug. As Gianfranco said, the patch works and I've already released new versions of wine/wine-development on Ubuntu with the patch applied. Thanks.
https://bugs.winehq.org/show_bug.cgi?id=51129
Michael Stefaniuc mstefani@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |mstefani@winehq.org Target Milestone|6.0.x |---
--- Comment #18 from Michael Stefaniuc mstefani@winehq.org --- Moving 6.0.x tag to the bug #51932
https://bugs.winehq.org/show_bug.cgi?id=51129
joaopa jeremielapuree@yahoo.fr changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |jeremielapuree@yahoo.fr
--- Comment #19 from joaopa jeremielapuree@yahoo.fr --- This bug is awful. It prevents to do regression tests in Ubuntu Impish.
https://bugs.winehq.org/show_bug.cgi?id=51129
--- Comment #20 from Hans Leidekker hans@meelstraat.net --- (In reply to joaopa from comment #19)
This bug is awful. It prevents to do regression tests in Ubuntu Impish.
You can work around the issue by passing --without-ldap to configure.
https://bugs.winehq.org/show_bug.cgi?id=51129
Hans Leidekker hans@meelstraat.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Fixed by SHA1| |8db46756ca91695c7242e05d24a | |3e5ec4340c10c Status|UNCONFIRMED |RESOLVED Resolution|--- |FIXED
--- Comment #21 from Hans Leidekker hans@meelstraat.net --- Fixed with 8db46756ca91695c7242e05d24a3e5ec4340c10c.
https://bugs.winehq.org/show_bug.cgi?id=51129
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #22 from Alexandre Julliard julliard@winehq.org --- Closing bugs fixed in 7.13.