Fixes #136.
Caveats
-------
-* ccache doesn't handle the GNU Assembler's *.incbin* directive correctly. This
- directive can be embedded in the source code inside an *__asm__* statement in
- order to include a file verbatim in the object file. If the included file is
- modified, ccache doesn't pick up the change since the inclusion isn't done by
- the preprocessor. A workaround of this problem is to set
- *extra_files_to_hash* to the path of the included file.
-
* The direct mode fails to pick up new header files in some rare scenarios. See
<<_the_direct_mode,THE DIRECT MODE>> above.
ccache news
===========
+Unreleased 3.3.3
+----------------
+
+Bug fixes
+~~~~~~~~~
+
+- ccache now detects usage of `.incbin` assembler directives in the source code
+ and avoids caching such compilations.
+
+
ccache 3.3.2
------------
Release date: 2016-09-28
inc_path = make_relative_path(inc_path);
remember_include_file(inc_path, hash, system);
p = q;
+ } else if (q[0] == '.' && q[1] == 'i' && q[2] == 'n' && q[3] == 'c'
+ && q[4] == 'b' && q[5] == 'i' && q[6] == 'n') {
+ // An assembler .incbin statement (which could be part of inline
+ // assembly) refers to an external file. If the file changes, the hash
+ // should change as well, but finding out what file to hash is too hard
+ // for ccache, so just bail out.
+ cc_log("Found unsupported .incbin directive in source code");
+ stats_update(STATS_UNSUPPORTED_DIRECTIVE);
+ failed();
} else {
q++;
}
STATS_CANTUSEPCH = 27,
STATS_PREPROCESSING = 28,
STATS_NUMCLEANUPS = 29,
+ STATS_UNSUPPORTED_DIRECTIVE = 30,
STATS_END
};
NULL,
0
},
+ {
+ STATS_UNSUPPORTED_DIRECTIVE,
+ "unsupported code directive",
+ NULL,
+ 0
+ },
{
STATS_OUTSTDOUT,
"output to stdout",
if [ "$(./c)" != OK ]; then
test_failed "Incorrect header file used"
fi
+
+ # -------------------------------------------------------------------------
+ TEST ".incbin"
+
+ cat <<EOF >incbin.c
+char x[] = ".incbin";
+EOF
+
+ $CCACHE_COMPILE -c incbin.c
+ expect_stat 'cache hit (preprocessed)' 0
+ expect_stat 'cache miss' 0
+ expect_stat 'unsupported code directive' 1
}
# =============================================================================