bug-gnulib
[Top][All Lists]
Advanced

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

Re: time_r module does not work on MingW


From: Christian Biesinger
Subject: Re: time_r module does not work on MingW
Date: Mon, 11 Nov 2019 12:47:39 -0800

(I accidentally sent this from the wrong email address. Please respond to my google.com address, not gmail.com)

Thanks for your responses!

The patch above does not fix the issue because apparently REPLACE_LOCALTIME_R is defined as GNULIB_PORTCHECK which is not defined. Replacing that with #if 1 does fix it.

gdb does not define GNULIB_NAMESPACE. 
 713 S["GNULIB_TIME_R"]="1"
 707 S["REPLACE_LOCALTIME_R"]="GNULIB_PORTCHECK"
 711 S["HAVE_DECL_LOCALTIME_R"]="0"

It includes gnulib's config.h as the second file after gdb's config.h.

Here is the testcase:
#include "build-gnulib-gdbserver/config.h"
#include "pathmax.h"
#include "time.h"

x86_64-w64-mingw32-g++ test.cc -I build-gnulib-gdbserver/import/ -I ~/binutils-gdb/gnulib/import/

It turns out that the pathmax.h include is required for this to fail. Alternatively, including just unistd.h before time.h will fail. Error:
https://pastebin.com/Vp8LUqaQ

The enabled gnulib modules are:
IMPORTED_GNULIB_MODULES="\
    alloca \
    canonicalize-lgpl \
    dirent \
    dirfd \
    errno \
    fnmatch-gnu \
    frexpl \
    getcwd \
    glob \
    inet_ntop
    inttypes \
    lstat \
    limits-h \
    memchr \
    memmem \
    mkdir \
    mkdtemp \
    mkostemp \
    pathmax \
    rawmemchr \
    readlink \
    rename \
    setenv \
    signal-h \
    strchrnul \
    strerror_r-posix \
    strstr \
    strtok_r \
    sys_stat \
    time_r \
    unistd \
    unsetenv \
    update-copyright \
    wchar \
    wctype-h \
"

Christian

On Mon, Nov 11, 2019 at 11:59 AM Bruno Haible <address@hidden> wrote:
Hi,

Christian Biesinger wrote:
> I tried to use the time_r module with GDB (using Gnulib
> revision 38237baf99386101934cd93278023aa4ae523ec0)
>
> However, I found that it does not compile, see logs at:
> https://gdb-buildbot.osci.io/#/builders/23/builds/934

It is hard for me to do guesswork, based on a large set of sources such
as gdb and a log file that shows mixed output from two parallel processes
(the revenge of "make -j2").

Can you please provide a simple test case?

Or at least help the investigation by showing the values of
  GNULIB_TIME_R
  REPLACE_LOCALTIME_R
  HAVE_DECL_LOCALTIME_R
that you find in config.status? Also we would need to know whether
the gdb build defines GNULIB_NAMESPACE and whether the source file
(amd64.c) starts with '#include <config.h>'.

Bruno


reply via email to

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