[PATCH] Update gnulib to current trunk

Joel Brobecker brobecker@adacore.com
Sun Aug 23 21:37:25 GMT 2020


Hi Pedro,

Christian seems to be busy these days, so I thought I could try to
help get this one in.

I'm going to quote the whole discussion below hoping this helps make it
easier for you to remember the details of this thread. which is about
updating gnulib to a newer version in order to bring in a change that
Eli wants for support of mingw.org's version of MinGW. If we wanted
a quick summary, my understanding is that following: After a closer
inspection of the delta in terms of modules this update causes,
we found that:

  - btowc gets added, for which you say that we should keep an eye
    on it wrt the logic in gdb/gdb_wchar.h, but I understand
    we should be OK for now;

  - We lose gettimeofday, and decided to add it.

  - We lose sys_time, and you suggested that the easiest is probably
    to accept that for now.

I have taken Christian's patch, and rebased it (there was one conflict
in gnulib/configure, which I resolved by regenerating it), and then
modified it to add gettimeofday.

As it happens, when doing that, we get sys_time back, as well as
localtime-buffer too. So, even though we said we could wait and
do nothing about it, the question becomes moot.

Attached is the diff between Christian's patch (once rebased).
I am attaching those even though this is not the patch I am proposing
because it should allow everyone to see the actual effect of adding
gettimeofday back, and see that the new version does bring what we want
and only what we want. It's only a few files, but still rather large
because of the files being added (back). So I made two versions:
One with the new files being elided, and the second containing the full
diff, but gziped.  Hopefully that'll fit within the mailinglist's
maximum email size.

I will send the actuall full patch, which consists of Christian
and my changes combined, with the ChangeLog updated accordingly,
in a separate email, also in an effort to stay under the maximum
email size limit.

Does this look OK to you now?

Thanks!

> On 7/6/20 7:19 PM, Christian Biesinger wrote:
> > Fair enough. This is the module diff:
> > 
> > --- /tmp/old 2020-07-06 13:04:17.837482577 -0500
> > +++ /tmp/new 2020-07-06 13:02:48.636984706 -0500
> > @@ -1,9 +1,12 @@
> > +Module list with included dependencies (indented):
> >      absolute-header
> >    alloca
> >      alloca-opt
> >      arpa_inet
> >      assure
> >      at-internal
> > +    attribute
> > +    btowc
> 
> I wonder whether "btowc" potentially conflicts with the logic
> in gdb/gdb_wchar.h .  We should keep an eye out for that.
> 
> 
> >      builtin-expect
> >      c99
> >    canonicalize-lgpl
> > @@ -13,12 +16,12 @@
> >      close
> >      closedir
> >    count-one-bits
> > +    ctype
> >      d-ino
> >      d-type
> >    dirent
> >    dirfd
> >      dirname-lgpl
> > -    dosname
> >      double-slash-root
> >      dup
> >      dup2
> > @@ -52,8 +55,8 @@
> >      getdtablesize
> >      getlogin_r
> >      getprogname
> > +    getrandom
> >      gettext-h
> > -    gettimeofday
> >    glob
> >      glob-h
> >      hard-locale
> > @@ -62,6 +65,7 @@
> >      intprops
> >    inttypes
> >      inttypes-incomplete
> > +    isblank
> >      isnand-nolibm
> >      isnanl-nolibm
> >      largefile
> > @@ -69,7 +73,6 @@
> >    limits-h
> >      localcharset
> >      locale
> > -    localtime-buffer
> >      lock
> >    lstat
> >      malloc-posix
> > @@ -78,11 +81,13 @@
> >      mbrtowc
> >      mbsinit
> >      mbsrtowcs
> > +    mbtowc
> >    memchr
> >    memmem
> >      memmem-simple
> >      mempcpy
> >      memrchr
> > +    minmax
> >    mkdir
> >    mkdtemp
> >    mkostemp
> > @@ -132,13 +137,14 @@
> >      strerror-override
> >    strerror_r-posix
> >      string
> > +    strnlen
> >      strnlen1
> >    strstr
> >      strstr-simple
> >    strtok_r
> > +    sys_random
> >      sys_socket
> >    sys_stat
> > -    sys_time
> >      sys_types
> >      sys_uio
> >      tempname
> > @@ -156,5 +162,7 @@
> >      windows-once
> >      windows-recmutex
> >      windows-rwlock
> > +    wmemchr
> > +    wmempcpy
> >      xalloc-oversized
> > 
> > It seems what is getting removed is:
> > -    dosname  (deprecated module and we don't use dosname.h)
> > -    gettimeofday (it looks like we use this in remote-fileio.c)
> > -    localtime-buffer (looks like basically an implementation detail)
> > -    sys_time (looks like GDB specifically did *not* want this per
> > comments in gdbsupport/gdb_sys_time.h)
> > 
> > So:
> > - For gettimeofday, the fixes in
> > https://www.gnu.org/software/gnulib/manual/html_node/gettimeofday.html#gettimeofday
> > don't look that important for gdb, but we could include the module.
> > Let me know if you want me to.
> 
> I guess it doesn't hurt to explicitly include it.  Might as well do it,
> since we use the function and have been using the module thus far.
> 
> > 
> > - For sys_time, we could perhaps replace the #undef in gdb_sys_time.h
> > with an #error. Let me know.
> 
> I suspect this gnulib commit is what caused gettimeofday and sys_time to
> drop for us:
> 
>  commit 78f55d5374d6ff9b8460c48a42e924bf69775cd7
>  Author:     Paul Eggert <eggert@cs.ucla.edu>
>  AuthorDate: Sun May 31 20:15:25 2020 -0700
> 
>     tempname: merge from glibc and coreutils
> ...
>     * modules/tempname (Depends-on): Remove gettimeofday, sys_time.
>     Add getentropy, libc-config.
> 
> As we can see from your diff:
> 
> >    sys_stat
> > -    sys_time
> >      sys_types
> >      sys_uio
> >      tempname
> 
> tempname is a dependency of sys_stat.
> 
> Another option would be to just get rid of gdb_sys_time.h,
> i.e., revert all or most of:
> 
>  commit 438e1e427e8393de73d22617abe4d8eba0270e72
>  Author:     Pedro Alves <palves@redhat.com>
>  AuthorDate: Mon Aug 24 18:50:55 2015 +0100
> 
>     Prepare for gnulib update
> 
> But I'd be fine with just leaving this alone for now, in case
> gnulib brings back the dependency.  It's also the easiest thing to
> do (i.e., do nothing).
> 
> Thanks,
> Pedro Alves

-- 
Joel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cbiesinger-v2-after-pedro-comments-summarized.diff
Type: text/x-diff
Size: 42909 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/gdb-patches/attachments/20200823/c7e2e5d6/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cbiesinger-v2-after-pedro-comments.diff.gz
Type: application/gzip
Size: 14740 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/gdb-patches/attachments/20200823/c7e2e5d6/attachment-0001.gz>


More information about the Gdb-patches mailing list