cctools-port/cctools
Pierre Bourdon 17c2bf9247
ranlib: attempt to use utimens variants when available
When finalizing an archive, ranlib performs the following operations:
1. stat to obtain the current mtime (pre-write mtime)
2. rewrite the timestamp in the archive header
3. utime to restore the pre-write mtime

Unfortunately, utime only supports a 1s resolution. This means that on systems
with sub-second filesystem timestamps resolution (one notable example being
APFS), the following sequence of events can happen:
1. stat to obtain the current mtime (pre-write mtime) returns hh:mm:ss.123
2. rewrite the timestamp in the archive header
3. utime to restore the pre-write mtime ends up restoring hh:mm:ss.000.

This can cause ranlib to roll back the mtime of an archive in the past instead
of moving it into the future. Given that "make" heavily relies on filesystem
timestamps to determine dependencies and required rebuilds, this can lead to
many problems. This was discovered because it caused random failures when
parallel building postgresql.

To address the issue, we attempt to use utimensat if available. This is checked
via autoconf, but on macOS this is not enough: utimensat can be present at
compile time without being available at link time, and it was only added very
recently (10.13). Inspired by how CPython is handling this, we use #pragma weak
to make the runtime dependency optional.
2018-11-30 05:12:50 +01:00
..
ar Update autogenerated files 2018-10-20 18:31:53 -05:00
as Update autogenerated files 2018-10-20 18:31:53 -05:00
cbtlibs merge cctools-855 2014-05-08 19:55:29 +02:00
efitools merge cctools-862 2014-11-21 22:10:09 +01:00
gprof merge cctools-855 2014-05-08 19:55:29 +02:00
include Port to musl libc 2017-10-26 15:25:21 -04:00
ld64 Update autogenerated files 2018-10-20 18:31:53 -05:00
libobjc2 Update autogenerated files 2018-10-20 18:31:53 -05:00
libstuff Update autogenerated files 2018-10-20 18:31:53 -05:00
m4 Add TAPIv2 support 2017-04-01 20:42:35 +02:00
man Update autogenerated files 2018-10-20 18:31:53 -05:00
misc ranlib: attempt to use utimens variants when available 2018-11-30 05:12:50 +01:00
otool Update autogenerated files 2018-10-20 18:31:53 -05:00
APPLE_LICENSE import 'cctools-839-ld64-134.9-1.3' from https://code.google.com/p/ios-toolchain-based-on-clang-for-linux/ 2013-11-14 20:36:34 +01:00
AUTHORS import 'cctools-839-ld64-134.9-1.3' from https://code.google.com/p/ios-toolchain-based-on-clang-for-linux/ 2013-11-14 20:36:34 +01:00
autogen.sh autogen.sh fixes: run libtoolize 'after' creating the m4 directory. run aclocal with '-I m4' switches. 2014-12-24 11:55:19 +01:00
cctools-ld64.workspace Update the CodeLite project 2015-10-02 20:42:26 +02:00
cctools.project Update the CodeLite project 2015-10-24 11:29:36 +02:00
ChangeLog import 'cctools-839-ld64-134.9-1.3' from https://code.google.com/p/ios-toolchain-based-on-clang-for-linux/ 2013-11-14 20:36:34 +01:00
compile Add TAPIv2 support 2017-04-01 20:42:35 +02:00
config.guess Update autogenerated files 2018-10-24 22:04:36 +02:00
config.sub Update autogenerated files 2018-10-24 22:04:36 +02:00
configure ranlib: attempt to use utimens variants when available 2018-11-30 05:12:50 +01:00
configure.ac ranlib: attempt to use utimens variants when available 2018-11-30 05:12:50 +01:00
COPYING import 'cctools-839-ld64-134.9-1.3' from https://code.google.com/p/ios-toolchain-based-on-clang-for-linux/ 2013-11-14 20:36:34 +01:00
install-sh Update autogenerated files 2018-10-24 22:04:36 +02:00
ld64.project Update the CodeLite project 2015-10-24 11:29:36 +02:00
ltmain.sh Update autogenerated files 2018-10-24 22:04:36 +02:00
Makefile.am Fix building otool 2018-10-24 22:04:25 +02:00
Makefile.in Update autogenerated files 2018-10-24 22:04:36 +02:00
missing Add TAPIv2 support 2017-04-01 20:42:35 +02:00
NEWS import 'cctools-839-ld64-134.9-1.3' from https://code.google.com/p/ios-toolchain-based-on-clang-for-linux/ 2013-11-14 20:36:34 +01:00
README import 'cctools-839-ld64-134.9-1.3' from https://code.google.com/p/ios-toolchain-based-on-clang-for-linux/ 2013-11-14 20:36:34 +01:00