This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: Disabling timestamps, was Re: [PATCH roland/Versions.def]....
- From: Michael Matz <matz at suse dot de>
- To: Brooks Moses <bmoses at google dot com>
- Cc: Andreas Schwab <schwab at linux-m68k dot org>, Roland McGrath <roland at hack dot frob dot com>, libc-alpha <libc-alpha at sourceware dot org>, Carlos O'Donell <carlos at redhat dot com>
- Date: Tue, 18 Mar 2014 11:38:40 +0100 (CET)
- Subject: Re: Disabling timestamps, was Re: [PATCH roland/Versions.def]....
- Authentication-results: sourceware.org; auth=none
- References: <20140228214559 dot BD8BF744B6 at topped-with-meat dot com> <53236661 dot 7070509 at redhat dot com> <53237C9C dot 2030504 at google dot com> <53237FC3 dot 4010002 at redhat dot com> <20140314230343 dot 6A6177445A at topped-with-meat dot com> <87mwgru91t dot fsf at igel dot home> <5326864F dot 2010004 at redhat dot com> <CAOxa4KoBOWpxeV6mxEG9c3MaGiB3PLgfsWCM2ZFLzO2iwb1=jQ at mail dot gmail dot com>
Hi,
On Mon, 17 Mar 2014, Brooks Moses wrote:
> We were discussing binutils --enable-deterministic-archives in
> libc-alpha@, and Andreas mentioned your recent SUSE binutils commit that
> had the description "Disable --enable-deterministic-archives again, as
> it breaks valid Makefiles." Any chance you could comment on what
> exactly it broke?
Sure. The testsuite of GNU make will break (in particular
features/archives), and it points to a real conflict of expectations
between make and enable-deterministic-archives ar:
If I write such Makefile:
---------------------------
all: libxx.a(a1.o)
---------------------------
then touch a1.o, any POSIX make will create libxx.a via 'ar rv libx.a
a1.o'. When I then make all again (without touching a1.o again), then
libxx.a must not be remade. When binutils is configured with
--enable-deterministic-archives it will be remade (because the recorded
timestamp of a1.o in libxx.a will be epoch, which will always be older
than the real filedate of a1.o, so libxx.a is always out of date).
As Makefiles can be validly written in a way to expect that targets aren't
remade when their prerequisites aren't such binutils are broken. I'll
freely admit that such use of native archive support in make is not very
common, so the real-world breakage is probably small. But as I also
couldn't think of a way to have both (short of something like an
environment variable that could be set for those few programs that neither
can change ARFLAGS but still expect normal behaviour) I had to remove
--enable-deterministic-archives again.
Of course the behaviour of ar can be changed with adding U to ARFLAGS, but
that isn't POSIX anymore and effectively is a change of the Makefile, the
whole point being that it must work unchanged.
I think a better way to achieve the intention of that option is rather to
ignore timestamps in .a files when comparing them, or even more
aggressive, to zero out those timestamps when installing archives.
Ciao,
Michael.