bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

select self-tests causes build failures under mingw


From: Simon Josefsson
Subject: select self-tests causes build failures under mingw
Date: Mon, 17 Nov 2008 13:24:45 +0100
User-agent: Gnus/5.110011 (No Gnus v0.11) Emacs/22.2 (gnu/linux)

GnuTLS fails to build under mingw (see output below), and the reason is
that the select-tests module depends on gettimeofday module, which under
mingw does this:

  AC_DEFINE([localtime], [rpl_localtime],
    [Define to rpl_localtime if the replacement function should be used.])

This re-definition causes the link failure, because gettimeofday.c is
not build as part of the replacement gnulib library, so there is no
rpl_localtime symbol.  It is only built in the gnulib self-test
directory (gl/tests/ in gnutls).

Does anyone see a clean solution to this problem?

It seems the '#define localtime rpl_localtime' should only be active
when building the gnulib self-tests, but how to go from that observation
to a patch that solves the problem is not clear to me.

Meanwhile, I've added a block like this:

#if GETTIMEOFDAY_CLOBBERS_LOCALTIME
#undef localtime
#endif

after #include <config.h>.

/Simon


make[1]: Entering directory `/home/jas/gnutls4win/build/gnutls-2.7.2/src'
/bin/bash ../libtool --tag=CC   --mode=link i586-mingw32msvc-gcc -std=gnu99  -g 
-O2   -o gnutls-serv.exe serv-gaa.o serv.o common.o ../lib/libgnutls.la 
../libextra/libgnutls-extra.la ../gl/libgnu.la -lws2_32 -lws2_32
libtool: link: i586-mingw32msvc-gcc -std=gnu99 -g -O2 -o .libs/gnutls-serv.exe 
serv-gaa.o serv.o common.o  ../lib/.libs/libgnutls.dll.a 
-L/home/jas/gnutls4win/inst/lib ../libextra/.libs/libgnutls-extra.dll.a 
/home/jas/gnutls4win/build/gnutls-2.7.2/lib/.libs/libgnutls.dll.a 
/home/jas/gnutls4win/inst/lib/libtasn1.dll.a 
/home/jas/gnutls4win/inst/lib/libgcrypt.dll.a 
/home/jas/gnutls4win/inst/lib/libgpg-error.dll.a ../gl/.libs/libgnu.a -lws2_32 
-L/home/jas/gnutls4win/inst/lib
Info: resolving _gnutls_malloc by linking to __imp__gnutls_malloc (auto-import)
Info: resolving _gnutls_free by linking to __imp__gnutls_free (auto-import)
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/bin/ld: 
warning: auto-importing has been activated without --enable-auto-import 
specified on the command line.
This should work unless it involves constant data structures referencing 
symbols from auto-imported DLLs.common.o: In function `my_ctime':
/home/jas/gnutls4win/build/gnutls-2.7.2/src/../../../src/gnutls-2.7.2/src/common.c:75:
 undefined reference to `_rpl_localtime'
collect2: ld returned 1 exit status




reply via email to

[Prev in Thread] Current Thread [Next in Thread]