using gcc 4.8.2 ... Making all in crywrap make[4]: Entering directory `/var/tmp/portage/net-libs/gnutls-3.2.8/work/gnutls-3.2.8/src/crywrap' x86_64-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I../.. -I./../../lib/includes -I./../../lib/includes -DSYSCONFDIR=\"/etc\" -DCRYWRAP_PATCHLEVEL=\"3\" -march=core-avx-i -O2 -pipe -c -o crywrap.o crywrap.c crywrap.c: In function '_crywrap_do_one': crywrap.c:859:7: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] (gnutls_transport_ptr_t) insock, ^ crywrap.c:860:7: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] (gnutls_transport_ptr_t) outsock); ^ crywrap.c: In function '_crywrap_setup_pidfile': crywrap.c:812:8: warning: ignoring return value of 'fchown', declared with attribute warn_unused_result [-Wunused-result] fchown(pidfilefd, config->uid, (gid_t) - 1); ^ crywrap.c:816:7: warning: ignoring return value of 'write', declared with attribute warn_unused_result [-Wunused-result] write(pidfilefd, mypid, strlen(mypid)); ^ /bin/sh ../../libtool --tag=CC --mode=link x86_64-pc-linux-gnu-gcc -march=core-avx-i -O2 -pipe -Wl,-O1 -Wl,--as-needed -o crywrap crywrap.o ../../lib/libgnutls.la -lidn libtool: link: x86_64-pc-linux-gnu-gcc -march=core-avx-i -O2 -pipe -Wl,-O1 -o .libs/crywrap crywrap.o -Wl,--as-needed ../../lib/.libs/libgnutls.so -L/usr/lib64 -lz -lnettle -lhogweed -lgmp -lidn ../../lib/.libs/libgnutls.so: undefined reference to `clock_gettime' collect2: error: ld returned 1 exit status make[4]: *** [crywrap] Error 1 make[4]: Leaving directory `/var/tmp/portage/net-libs/gnutls-3.2.8/work/gnutls-3.2.8/src/crywrap' make[3]: *** [all-recursive] Error 1 make[3]: Leaving directory `/var/tmp/portage/net-libs/gnutls-3.2.8/work/gnutls-3.2.8/src' make[2]: *** [all] Error 2 make[2]: Leaving directory `/var/tmp/portage/net-libs/gnutls-3.2.8/work/gnutls-3.2.8/src' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/var/tmp/portage/net-libs/gnutls-3.2.8/work/gnutls-3.2.8' make: *** [all] Error 2 * ERROR: net-libs/gnutls-3.2.8::gentoo failed (compile phase): * emake failed * * If you need support, post the output of `emerge --info '=net-libs/gnutls-3.2.8::gentoo'`, * the complete build log and the output of `emerge -pqv '=net-libs/gnutls-3.2.8::gentoo'`. * The complete build log is located at '/var/log/portage/net-libs:gnutls-3.2.8:20131221-111826.log'. * For convenience, a symlink to the build log is located at '/var/tmp/portage/net-libs/gnutls-3.2.8/temp/build.log'. * The ebuild environment file is located at '/var/tmp/portage/net-libs/gnutls-3.2.8/temp/environment'. * Working directory: '/var/tmp/portage/net-libs/gnutls-3.2.8/work/gnutls-3.2.8' * S: '/var/tmp/portage/net-libs/gnutls-3.2.8/work/gnutls-3.2.8' >>> Failed to emerge net-libs/gnutls-3.2.8, Log file: ... Reproducible: Always
just a guess: probably a -lrt linkage is required
configure.ac introduces the new variables gnutls_needs_librt and NEEDS_LIBRT. NEEDS_LIBRT is incorrectly set to FALSE, so I think gnutls_needs_librt never gets set (or tested?).
well, I have investigated this the issue a little bit and after reading this post http://gnu-autoconf.7623.n7.nabble.com/Correct-way-to-check-for-clock-gettime-td12276.html I suggest the following patch, which I have tested successfully : >>> Preparing source in /var/tmp/portage/net-libs/gnutls-3.2.8/work/gnutls-3.2.8 ... * Applying user patches from /etc/portage/patches//net-libs/gnutls ... * gnutls-3.2.8-librt-linkage.patch ... [ ok ] * Done with patching here is the patch: diff -urN gnutls-3.2.8/configure.ac gnutls-3.2.8-a/configure.ac --- gnutls-3.2.8/configure.ac 2013-12-16 18:33:56.000000000 +0100 +++ gnutls-3.2.8-a/configure.ac 2013-12-21 20:35:09.032596590 +0100 @@ -233,6 +233,12 @@ #include <signal.h> ], [timer_create (0,0,0);]) +AC_SEARCH_LIBS([clock_gettime], [rt],) + +if test "$ac_cv_search_clock_gettime" = "-lrt"; then + LIBS="$LIBS -lrt" +fi + if test "$ac_cv_func_pthread_mutex_lock" != "yes";then AC_LIB_HAVE_LINKFLAGS(pthread,, [#include <pthread.h>], [pthread_mutex_lock (0);]) fi
Created attachment 365840 [details, diff] proposed patch for -lrt correct linkage
(In reply to Evgeny Bobkin from comment #4) > Created attachment 365840 [details, diff] [details, diff] > proposed patch for -lrt correct linkage Thanks! But I think the following should also do the trick without any conditional, can you please check it out? if not, can you please attach config.log? AC_SEARCH_LIBS([clock_gettime], [rt])
(In reply to Alon Bar-Lev from comment #5) > (In reply to Evgeny Bobkin from comment #4) > > Created attachment 365840 [details, diff] [details, diff] [details, diff] > > proposed patch for -lrt correct linkage > > Thanks! > > But I think the following should also do the trick without any conditional, > can you please check it out? if not, can you please attach config.log? > > AC_SEARCH_LIBS([clock_gettime], [rt]) yep, indeed, it's enough.
Created attachment 365842 [details, diff] 0001-build-detect-clock_gettime-out-of-librt.patch Hmm... while looking at code, it seems that gnutls has its own way of doing so, can you please checkout this patch?
(In reply to Alon Bar-Lev from comment #7) > Created attachment 365842 [details, diff] [details, diff] > 0001-build-detect-clock_gettime-out-of-librt.patch > > Hmm... while looking at code, it seems that gnutls has its own way of doing > so, can you please checkout this patch? the second patch proposal fails with the same error message as in the first comment. ... checking for library containing clock_gettime... -lrt checking for clock_gettime... yes checking for clock_settime... yes checking for error_at_line... yes ... however -lrt does not seem to be appended to CLIBS
Created attachment 365856 [details] buildlog
My ebuild skills are a bit rusty :( I saved your patch as gnutls-3.2.8-build.patch and put it in /usr/portage/net-libs/gnutls/files/ I regenerated the Manifest file and then emerged gnutls again, which failed with the same error because configure.ac was not, in fact, patched. Shouldn't build.log contain messages about patches being applied right near the beginning of the log? There are no such messages, even about the already existing patches. (BTW, this package emerged with no errors on a ~amd64 machine I run in virtualbox, and the installed libgnutls.so.28.29.0 is *not* linked to librt.)
(In reply to walt from comment #10) > My ebuild skills are a bit rusty :( > > I saved your patch as gnutls-3.2.8-build.patch and put it in > /usr/portage/net-libs/gnutls/files/ user patches for this ebuild should be placed in /etc/portage/patches/net-libs/gnutls. for more details please consider the official wiki pages http://wiki.gentoo.org/wiki//etc/portage/patches > > I regenerated the Manifest file and then emerged gnutls again, which failed > with the same error because configure.ac was not, in fact, patched. > > Shouldn't build.log contain messages about patches being applied right near > the beginning of the log? There are no such messages, even about the > already existing patches. yep, then you should observe something like: ... * Applying user patches from /etc/portage/patches//net-libs/gnutls ... * gnutls-3.2.8-librt-linkage.patch ... [ ok ] * Done with patching > > > (BTW, this package emerged with no errors on a ~amd64 machine I run in > virtualbox, and the installed libgnutls.so.28.29.0 is *not* linked to librt.)
(In reply to Evgeny Bobkin from comment #11) > user patches for this ebuild should be placed in > /etc/portage/patches/net-libs/gnutls. Did that. And it worked :) Thanks Evgeny. Unfortunately I reproduced your failure in Comment 8, even though Alon's patch was definitely applied this time (I double-checked).
Hi, I need config.log of a run that reproduce this issue and this patch applied. Thanks!
No need, reproduced.
So, what is the way to proceed here? Has anyone forwarded it to upstream? the solution AC_SEARCH_LIBS([clock_gettime], [rt], [], [ AC_MSG_ERROR([unable to find the clock_gettime() function]) ]) is the only working at the moment!!
(In reply to Evgeny Bobkin from comment #15) > So, what is the way to proceed here? > Has anyone forwarded it to upstream? > > the solution > > AC_SEARCH_LIBS([clock_gettime], [rt], [], [ > AC_MSG_ERROR([unable to find the clock_gettime() function]) > ]) > > is the only working at the moment!! patience.