This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Linux 2.6 nanosecond time stamp weirdness breaks GCC build
- From: Alexandre Oliva <aoliva at redhat dot com>
- To: Ulrich Weigand <weigand at i1 dot informatik dot uni-erlangen dot de>
- Cc: gcc at gcc dot gnu dot org, linux-kernel at vger dot kernel dot org, schwidefsky at de dot ibm dot com, ak at suse dot de
- Date: 02 Apr 2004 14:27:56 -0300
- Subject: Re: Linux 2.6 nanosecond time stamp weirdness breaks GCC build
- Organization: Red Hat Global Engineering Services Compiler Team
- References: <200404011928.VAA23657@faui1d.informatik.uni-erlangen.de>
On Apr 1, 2004, Ulrich Weigand <weigand@i1.informatik.uni-erlangen.de> wrote:
> - STAMP = echo timestamp >
> + STAMP = sleep 1 >
I don't think this will fix the problem, at least not portably.
sleep 1 > filename
will truncate filename before sleep starts, modifying its timestamp at
that point, and leave it unchanged afterwards. Some systems might
update the timestamp again when the file truncated&opened for writing
is closed, but I don't think this is required. Worse yet: some
systems don't support empty files, and will error out because sleep 1
produced no output. Also, since some filesystems don't have 1-second
granularity, you should probably use `sleep 2' instead.
A more portable way to spell it would be:
STAMP = sleep 2; echo timestamp >
or, in order to make $(STAMP) usable in the middle of &&/|| sequences:
STAMP = { sleep 2; echo timestamp; } >
--
Alexandre Oliva http://www.ic.unicamp.br/~oliva/
Red Hat Compiler Engineer aoliva@{redhat.com, gcc.gnu.org}
Free Software Evangelist oliva@{lsd.ic.unicamp.br, gnu.org}