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

collectd fails to build with -Werror because it uses deprecated gcrypt functions #632

Closed
rubenk opened this Issue Jun 4, 2014 · 9 comments

Comments

Projects
None yet
7 participants
@rubenk
Contributor

rubenk commented Jun 4, 2014

Building collectd with -Werror on Fedora Rawhide currently fails:

make[4]: Entering directory `/builddir/build/BUILD/collectd-5.4.1/src/libcollectdclient'
CC libcollectdclient_la-client.lo
CC libcollectdclient_la-network.lo
CC libcollectdclient_la-network_buffer.lo
network_buffer.c:57:15: error: 'gcry_thread_cbs' is deprecated (declared at /usr/include/gcrypt.h:213) [-Werror=deprecated-declarations]
GCRY_THREAD_OPTION_PTHREAD_IMPL;
^
cc1: all warnings being treated as errors
make[4]: *** [libcollectdclient_la-network_buffer.lo] Error 1

This is with libgcrypt-1.6.1-4.fc21.x86_64

@mfournier mfournier added Bug labels Jul 24, 2014

@fedya

This comment has been minimized.

Show comment
Hide comment
@fedya

fedya Jul 25, 2014

+1 same for me

er.c -fPIC -DPIC -o .libs/libcollectdclient_la-network_buffer.o
network_buffer.c:57:1: error: 'gcry_thread_cbs' is deprecated [-Werror,-Wdeprecated-declarations]
GCRY_THREAD_OPTION_PTHREAD_IMPL;
^
/usr/include/gcrypt.h:227:17: note: expanded from macro 'GCRY_THREAD_OPTION_PTHREAD_IMPL'
static struct gcry_thread_cbs gcry_threads_pthread = {
^
/usr/include/gcrypt.h:213:8: note: 'gcry_thread_cbs' has been explicitly marked deprecated here
struct gcry_thread_cbs

fedya commented Jul 25, 2014

+1 same for me

er.c -fPIC -DPIC -o .libs/libcollectdclient_la-network_buffer.o
network_buffer.c:57:1: error: 'gcry_thread_cbs' is deprecated [-Werror,-Wdeprecated-declarations]
GCRY_THREAD_OPTION_PTHREAD_IMPL;
^
/usr/include/gcrypt.h:227:17: note: expanded from macro 'GCRY_THREAD_OPTION_PTHREAD_IMPL'
static struct gcry_thread_cbs gcry_threads_pthread = {
^
/usr/include/gcrypt.h:213:8: note: 'gcry_thread_cbs' has been explicitly marked deprecated here
struct gcry_thread_cbs

@silb

This comment has been minimized.

Show comment
Hide comment
@silb

silb Aug 12, 2014

I got the same error when building collectd-5.4.1 from the FreeBSD ports tree with clang 3.3 on FreeBSD 10.0-RELEASE-p6 on amd64:

gmake[6]: Entering directory `/usr/ports/net-mgmt/collectd5/work/collectd-5.4.1/src/libcollectdclient'
  CC       libcollectdclient_la-network_buffer.lo
network_buffer.c:57:1: error: 'gcry_thread_cbs' is deprecated [-Werror,-Wdeprecated-declarations]
GCRY_THREAD_OPTION_PTHREAD_IMPL;
^
/usr/local/include/gcrypt.h:227:17: note: expanded from macro 'GCRY_THREAD_OPTION_PTHREAD_IMPL'
  static struct gcry_thread_cbs gcry_threads_pthread = {                \
                ^
/usr/local/include/gcrypt.h:213:8: note: 'gcry_thread_cbs' declared here
struct gcry_thread_cbs
       ^
1 error generated.
gmake[6]: *** [libcollectdclient_la-network_buffer.lo] Error 1

silb commented Aug 12, 2014

I got the same error when building collectd-5.4.1 from the FreeBSD ports tree with clang 3.3 on FreeBSD 10.0-RELEASE-p6 on amd64:

gmake[6]: Entering directory `/usr/ports/net-mgmt/collectd5/work/collectd-5.4.1/src/libcollectdclient'
  CC       libcollectdclient_la-network_buffer.lo
network_buffer.c:57:1: error: 'gcry_thread_cbs' is deprecated [-Werror,-Wdeprecated-declarations]
GCRY_THREAD_OPTION_PTHREAD_IMPL;
^
/usr/local/include/gcrypt.h:227:17: note: expanded from macro 'GCRY_THREAD_OPTION_PTHREAD_IMPL'
  static struct gcry_thread_cbs gcry_threads_pthread = {                \
                ^
/usr/local/include/gcrypt.h:213:8: note: 'gcry_thread_cbs' declared here
struct gcry_thread_cbs
       ^
1 error generated.
gmake[6]: *** [libcollectdclient_la-network_buffer.lo] Error 1
@xjflyttp

This comment has been minimized.

Show comment
Hide comment
@xjflyttp

xjflyttp Sep 1, 2014

I'm have the same problem
FreeBSD 10.0-RELEASE-p7

clang -v

FreeBSD clang version 3.3 (tags/RELEASE_33/final 183502) 20130610
Target: x86_64-unknown-freebsd10.0
Thread model: posix

And...
libgcrypt-1.5.3 is correct,
libgcrypt-1.6 will fail

Making all in libcollectdclient
gmake[5]: Entering directory `/usr/ports/net-mgmt/collectd5/work/collectd-5.4.1/src/libcollectdclient'
gmake  all-am
gmake[6]: Entering directory `/usr/ports/net-mgmt/collectd5/work/collectd-5.4.1/src/libcollectdclient'
  CC       libcollectdclient_la-client.lo
  CC       libcollectdclient_la-network.lo
  CC       libcollectdclient_la-network_buffer.lo
network_buffer.c:57:1: error: 'gcry_thread_cbs' is deprecated [-Werror,-Wdeprecated-declarations]
GCRY_THREAD_OPTION_PTHREAD_IMPL;
^
/usr/local/include/gcrypt.h:227:17: note: expanded from macro 'GCRY_THREAD_OPTION_PTHREAD_IMPL'
  static struct gcry_thread_cbs gcry_threads_pthread = {                \
                ^
/usr/local/include/gcrypt.h:213:8: note: 'gcry_thread_cbs' declared here
struct gcry_thread_cbs
       ^
1 error generated.
gmake[6]: *** [libcollectdclient_la-network_buffer.lo] Error 1
gmake[6]: Leaving directory `/usr/ports/net-mgmt/collectd5/work/collectd-5.4.1/src/libcollectdclient'
gmake[5]: *** [all] Error 2
gmake[5]: Leaving directory `/usr/ports/net-mgmt/collectd5/work/collectd-5.4.1/src/libcollectdclient'
gmake[4]: *** [all-recursive] Error 1
gmake[4]: Leaving directory `/usr/ports/net-mgmt/collectd5/work/collectd-5.4.1/src'
gmake[3]: *** [all] Error 2
gmake[3]: Leaving directory `/usr/ports/net-mgmt/collectd5/work/collectd-5.4.1/src'
gmake[2]: *** [all-recursive] Error 1
gmake[2]: Leaving directory `/usr/ports/net-mgmt/collectd5/work/collectd-5.4.1'
===> Compilation failed unexpectedly.
Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure to
the maintainer.
*** Error code 1

Stop.
make[1]: stopped in /usr/ports/net-mgmt/collectd5
*** Error code 1

Stop.
make: stopped in /usr/ports/net-mgmt/collectd5

xjflyttp commented Sep 1, 2014

I'm have the same problem
FreeBSD 10.0-RELEASE-p7

clang -v

FreeBSD clang version 3.3 (tags/RELEASE_33/final 183502) 20130610
Target: x86_64-unknown-freebsd10.0
Thread model: posix

And...
libgcrypt-1.5.3 is correct,
libgcrypt-1.6 will fail

Making all in libcollectdclient
gmake[5]: Entering directory `/usr/ports/net-mgmt/collectd5/work/collectd-5.4.1/src/libcollectdclient'
gmake  all-am
gmake[6]: Entering directory `/usr/ports/net-mgmt/collectd5/work/collectd-5.4.1/src/libcollectdclient'
  CC       libcollectdclient_la-client.lo
  CC       libcollectdclient_la-network.lo
  CC       libcollectdclient_la-network_buffer.lo
network_buffer.c:57:1: error: 'gcry_thread_cbs' is deprecated [-Werror,-Wdeprecated-declarations]
GCRY_THREAD_OPTION_PTHREAD_IMPL;
^
/usr/local/include/gcrypt.h:227:17: note: expanded from macro 'GCRY_THREAD_OPTION_PTHREAD_IMPL'
  static struct gcry_thread_cbs gcry_threads_pthread = {                \
                ^
/usr/local/include/gcrypt.h:213:8: note: 'gcry_thread_cbs' declared here
struct gcry_thread_cbs
       ^
1 error generated.
gmake[6]: *** [libcollectdclient_la-network_buffer.lo] Error 1
gmake[6]: Leaving directory `/usr/ports/net-mgmt/collectd5/work/collectd-5.4.1/src/libcollectdclient'
gmake[5]: *** [all] Error 2
gmake[5]: Leaving directory `/usr/ports/net-mgmt/collectd5/work/collectd-5.4.1/src/libcollectdclient'
gmake[4]: *** [all-recursive] Error 1
gmake[4]: Leaving directory `/usr/ports/net-mgmt/collectd5/work/collectd-5.4.1/src'
gmake[3]: *** [all] Error 2
gmake[3]: Leaving directory `/usr/ports/net-mgmt/collectd5/work/collectd-5.4.1/src'
gmake[2]: *** [all-recursive] Error 1
gmake[2]: Leaving directory `/usr/ports/net-mgmt/collectd5/work/collectd-5.4.1'
===> Compilation failed unexpectedly.
Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure to
the maintainer.
*** Error code 1

Stop.
make[1]: stopped in /usr/ports/net-mgmt/collectd5
*** Error code 1

Stop.
make: stopped in /usr/ports/net-mgmt/collectd5
@silb

This comment has been minimized.

Show comment
Hide comment
@silb

silb Sep 7, 2014

It compiles again from the FreeBSD ports tree after compile warnings were allowed: https://svnweb.freebsd.org/ports?view=revision&revision=366979

silb commented Sep 7, 2014

It compiles again from the FreeBSD ports tree after compile warnings were allowed: https://svnweb.freebsd.org/ports?view=revision&revision=366979

@octo

This comment has been minimized.

Show comment
Hide comment
@octo

octo Sep 16, 2014

Member

This appears to be caused by a rewrite of the threading support in GNU-TLS. I think this is still required for older versions of GNU-TLS / gcrypt, so we should check if the version is available to the preprocessor or, should it not provide this, add a configure check.

Member

octo commented Sep 16, 2014

This appears to be caused by a rewrite of the threading support in GNU-TLS. I think this is still required for older versions of GNU-TLS / gcrypt, so we should check if the version is available to the preprocessor or, should it not provide this, add a configure check.

@octo octo self-assigned this Sep 16, 2014

@octo

This comment has been minimized.

Show comment
Hide comment
@octo

octo Sep 16, 2014

Member

http://gnutls.org/manual/html_node/Version-check.html writes:

#if GNUTLS_VERSION_NUMBER >= 0x030201
 ...
#endif
Member

octo commented Sep 16, 2014

http://gnutls.org/manual/html_node/Version-check.html writes:

#if GNUTLS_VERSION_NUMBER >= 0x030201
 ...
#endif

vincentbernat added a commit to vincentbernat/collectd that referenced this issue Nov 7, 2014

network: don't enable gcrypt thread callbacks when gcrypt recent enough
From `gcrypt.h`:

> NOTE: Since Libgcrypt 1.6 the thread callbacks are not anymore used.
> However we keep it to allow for some source code compatibility if used
> in the standard way.

Otherwise, we get a deprecation warning which is turned into an error:

```
  CC       libcollectdclient_la-network_buffer.lo
../../../src/libcollectdclient/network_buffer.c:58:15: error: 'gcry_thread_cbs' is deprecated (declared at /usr/include/gcrypt.h:213) [-Werror=deprecated-declarations]
 GCRY_THREAD_OPTION_PTHREAD_IMPL;
```

Fixes: #632
@pyr

This comment has been minimized.

Show comment
Hide comment
@pyr

pyr Nov 7, 2014

Member

LGTM

Member

pyr commented Nov 7, 2014

LGTM

vincentbernat added a commit to vincentbernat/collectd that referenced this issue Nov 10, 2014

network: don't enable gcrypt thread callbacks when gcrypt recent enough
From `gcrypt.h`:

> NOTE: Since Libgcrypt 1.6 the thread callbacks are not anymore used.
> However we keep it to allow for some source code compatibility if used
> in the standard way.

Otherwise, we get a deprecation warning which is turned into an error:

```
  CC       libcollectdclient_la-network_buffer.lo
../../../src/libcollectdclient/network_buffer.c:58:15: error: 'gcry_thread_cbs' is deprecated (declared at /usr/include/gcrypt.h:213) [-Werror=deprecated-declarations]
 GCRY_THREAD_OPTION_PTHREAD_IMPL;
```

Fixes: #632

mfournier added a commit that referenced this issue Nov 11, 2014

network: don't enable gcrypt thread callbacks when gcrypt recent enough
From `gcrypt.h`:

> NOTE: Since Libgcrypt 1.6 the thread callbacks are not anymore used.
> However we keep it to allow for some source code compatibility if used
> in the standard way.

Otherwise, we get a deprecation warning which is turned into an error:

```
  CC       libcollectdclient_la-network_buffer.lo
../../../src/libcollectdclient/network_buffer.c:58:15: error: 'gcry_thread_cbs' is deprecated (declared at /usr/include/gcrypt.h:213) [-Werror=deprecated-declarations]
 GCRY_THREAD_OPTION_PTHREAD_IMPL;
```

Fixes: #632
@mfournier

This comment has been minimized.

Show comment
Hide comment
@mfournier

mfournier Nov 11, 2014

Contributor

@rubenk & al, a fix for this issue has been merged recently. It will be part of the upcoming bugfix releases (5.3.2 & 5.4.2) as well as the 5.5.0. The patch is fairly short and can be backported easily to current releases, if needed.

Thanks for reporting & thanks to @vincentbernat for figuring out the patch !

Contributor

mfournier commented Nov 11, 2014

@rubenk & al, a fix for this issue has been merged recently. It will be part of the upcoming bugfix releases (5.3.2 & 5.4.2) as well as the 5.5.0. The patch is fairly short and can be backported easily to current releases, if needed.

Thanks for reporting & thanks to @vincentbernat for figuring out the patch !

@mfournier mfournier closed this Nov 11, 2014

@rubenk

This comment has been minimized.

Show comment
Hide comment
@rubenk

rubenk Nov 11, 2014

Contributor

Great, thanks all!

Contributor

rubenk commented Nov 11, 2014

Great, thanks all!

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