Re: [PATCH 2/3] Consistently use BFD's time

Tom Tromey
2020-06-18T16:01:00Z

>>>>> "Eli" == Eli Zaretskii <eliz@gnu.org> writes:

Eli> I meant a different part of Gnulib's sys/stat.h:

Thanks.

Eli> AFAICT, gnulib/import/m4/stat.m4 does that for MinGW unconditionally:

Eli> case "$host_os" in
Eli> mingw*)
Eli> dnl On this platform, the original stat() returns st_atime, st_mtime,
Eli> dnl st_ctime values that are affected by the time zone.
Eli> REPLACE_STAT=1
Eli> ;;

Eli> So the way to avoid the replacement is to modify this test, right?

I tried that, but unfortunately I think it didn't really work -- gnulib
still builds and uses _gl_convert_FILETIME_to_POSIX and
_gl_fstat_by_handle.

I considered two other approaches:

1. Link BFD and binutils against gnulib. This seems like a pain because
at least Fedora installs libbfd.so, so we'd either have to arrange to
build a gnulib.so (I guess under some other name) or get the gnulib
objects into the shared libbfd... ugh.

2. Use --avoid=stat --avoid=fstat. So far this seems like the best
approach. Pedro pointed out that this means we won't get any gnulib
fixes for other bugs in this area. However, given gdb's relatively
minimal needs from stat, and given the fact that gnulib is
introducing other bugs, this seems like an acceptable tradeoff to me.

Tom