[Buildroot] [autobuild.buildroot.net] Daily results for 2021-08-17

Thomas Petazzoni thomas.petazzoni at bootlin.com
Mon Aug 23 22:06:34 UTC 2021


Hello,

On Mon, 23 Aug 2021 22:55:30 +0200
Arnout Vandecappelle <arnout at mind.be> wrote:

>  I have a theory, but it's a bit far out... We basically have this:
> 
> gcc -o empty empty.c
> objcopy --dump-section .interp=/dev/stdout empty > loader.txt
> 
> The timestamp of 'empty' is going to be near the end of the gcc run. The
> timestamp of 'loader.txt', on the other hand, is going to be all the way at the
> beginning of the shell run. So, if the filesystem doesn't have nanosecond
> precision, it's possible that 'empty' and 'loader.txt' have the same timestamp.
> 
>  It's not a good theory, though, because make shouldn't consider 'loader.txt'
> older than 'empty' if they have exactly the same timestamp.
> 
> 
> 
>  Ooh, I just discovered something nasty! Apparently, objcopy updates the
> modification time of its input file...
> 
> $ touch empty; ls -l --full-time empty loader.txt; make SHARED=yes loader.txt;
> ls -l --full-time empty loader.txt
> -rwxr-xr-x 1 arnout arnout 24K 2021-08-23 22:53:27.450172624 +0200 empty*
> -rw-r--r-- 1 arnout arnout  28 2021-08-23 22:52:57.949935937 +0200 loader.txt
> objcopy --dump-section .interp=/dev/stdout empty > loader.txt
> -rwxr-xr-x 1 arnout arnout 24K 2021-08-23 22:53:27.563173530 +0200 empty*
> -rw-r--r-- 1 arnout arnout  28 2021-08-23 22:53:27.563173530 +0200 loader.txt
> 
> I guess this way there is some chance that loader.txt gets a modification time
> just before the updated mtime of empty...
> 
> So the solution would be to touch loader.txt just after creating it. We could
> patch it like that, give it a go in the autobuilders, then send the patch upstream?

Wow, great investigation! Really odd that objcopy updates the mtime of
its input file, though.

Thomas
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com


More information about the buildroot mailing list