Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build fails with OpenLDAP 2.5.4 #7004

Closed
bagder opened this issue May 4, 2021 · 3 comments
Closed

build fails with OpenLDAP 2.5.4 #7004

bagder opened this issue May 4, 2021 · 3 comments
Assignees

Comments

@bagder
Copy link
Member

bagder commented May 4, 2021

Hi all,

OpenLDAP has released 2.5.4 version and curl compiling fails... Any chance to get it adopted soon?
Regards.

Originally posted by @3eka in #7003

@3eka
Copy link

3eka commented May 4, 2021

This is error:

  CC       libcurl_la-openldap.lo
openldap.c:83:17: error: conflicting types for 'ldap_connect'
   83 | static CURLcode ldap_connect(struct Curl_easy *data, bool *done);
      |                 ^~~~~~~~~~~~
In file included from openldap.c:39:
/pz/SFW/include/ldap.h:1554:1: note: previous declaration of 'ldap_connect' was here
 1554 | ldap_connect( LDAP *ld );
      | ^~~~~~~~~~~~
gmake[2]: *** [Makefile:2515: libcurl_la-openldap.lo] Error 1

PREFIX is where new OpenLDAP is installed (as well as OpenSSL)
PKG_CONFIG_PATH=${PREFIX}/lib/pkgconfig CPPFLAGS="-I${PREFIX}/include -D_POSIX_PTHREAD_SEMANTICS -D_XOPEN_SOURCE=600 -D_FILE_OFFSET_BITS=64 -D__EXTENSIONS__" CFLAGS="-m64 -march=native -std=c89 -std=c99" LDFLAGS="-L${PREFIX}/lib -R${PREFIX}/lib" LIBS="-lstdc++" ./configure --prefix=${PREFIX} --enable-optimize --enable-http --enable-ftp --enable-file --enable-proxy --enable-telnet --enable-tftp --enable-manual --enable-libcurl-option --enable-ipv6 --enable-threaded-resolver --enable-crypto-auth --enable-cookies --with-libssh2 --with-gssapi=${PREFIX} --with-ssl=${PREFIX} --with-ca-fallback --enable-ldap --enable-ldaps --with-ca-bundle=/etc/openssl/ca-bundle.crt --with-ca-path=/etc/openssl/certs
OS is OpenIndiana (Illumos based), GCC 9 suite used. Same configure works and curl compiles fine with OpenLDAP 2.4.xx.

Regards.

@bagder
Copy link
Member Author

bagder commented May 4, 2021

Yeah, turns out we use ldap_ prefixes on private functions in that source file and OpenLDAP has introduced a function that uses the exact same name as we use for a private function. The fix is to avoid that prefix for private functions.

bagder added a commit that referenced this issue May 5, 2021
Since openldap itself uses that prefix and with OpenĹDAP 2.5.4 (at
least) there's a symbol collision because of that.

The private functions now use the 'oldap_' prefix where it previously
used 'ldap_'.

Reported-by: 3eka on github
Fixes #7004
Closes #7005
@bagder bagder self-assigned this May 5, 2021
@bagder bagder closed this as completed in 8bdde6b May 5, 2021
@3eka
Copy link

3eka commented May 5, 2021

FYI:
it compiles now (tested against git clone):

:; curl --version
curl 7.77.0-DEV (x86_64-pc-solaris2.11) libcurl/7.77.0-DEV OpenSSL/1.1.1k zlib/1.2.11 brotli/1.0.9 zstd/1.4.10 libidn2/2.3.0 libssh2/1.9.0 nghttp2/1.37.0 librtmp/2.3 libgsasl/1.8.1
Release-Date: [unreleased]
Protocols: dict file ftp ftps gopher gophers http https imap imaps ldap ldaps mqtt pop3 pop3s rtmp rtsp scp sftp smb smbs smtp smtps telnet tftp
Features: alt-svc AsynchDNS brotli gsasl GSS-API HSTS HTTP2 HTTPS-proxy IDN IPv6 Kerberos Largefile libz NTLM NTLM_WB SPNEGO SSL TLS-SRP UnixSockets zstd

Many thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

2 participants