[ccache] Inline assembly .incbin directive

Stefan Hajnoczi stefanha at gmail.com
Tue Mar 2 15:21:08 MST 2010


ccache does not detect when the GNU assembler .incbin directive [1] is
used to include a binary file.

If the contents of the referenced binary file have changed, ccache
gets a false cache hit.  The C source file hasn't changed - it still
has an .incbin directive referencing the same filename but the binary
file has changed.  The result is a stale cached object file.

Several projects carry Makefile workarounds for this.  I am now
introducing a workaround in gPXE [2].

It would be nice to see ccache detect .incbin directives.  The
conservative approach would be to simply detect .incbin and refuse to
cache the file.  A more aggressive approach would include the binary
file in its cache hit decision.

Since this bug breaks the idea that ccache does not affect the
semantics of the build, only the performance, I feel it makes sense to
treat it as a bug and fix it.

Thoughts?  I can supply a test case if that helps.

Stefan

[1] http://sourceware.org/binutils/docs/as/Incbin.html#Incbin
[2] http://git.etherboot.org/?p=people/stefanha/gpxe.git;a=commitdiff;h=c70f00cc6df4b7d6ab05928fa0f6e87eb4527df1


More information about the ccache mailing list