Code to address some issues in #1421.
different directories, with the tradeoff of potentially getting an incorrect
directory in the `.gcno` file. *gcno_cwd* also disables hashing of the
current working directory if `-fprofile-abs-path` is used.
+*incbin*::
+ By default, ccache will ignore all files containing an `.incbin` directive.
+ While this is the correct behaviour as ccache does not detect incbin changes,
+ this restriction can make some projects difficult to cache. This sloppiness
+ will pretend the `.incbin` directive doesn't exist and simply allow caching.
*include_file_ctime*::
By default, ccache will disable caching if a source code file has a status
change time (ctime) after the start of the ccache invocation. This
result.insert(core::Sloppy::file_stat_matches_ctime);
} else if (token == "gcno_cwd") {
result.insert(core::Sloppy::gcno_cwd);
+ } else if (token == "incbin") {
+ result.insert(core::Sloppy::incbin);
} else if (token == "include_file_ctime") {
result.insert(core::Sloppy::include_file_ctime);
} else if (token == "include_file_mtime") {
if (sloppiness.contains(core::Sloppy::gcno_cwd)) {
result += "gcno_cwd, ";
}
+ if (sloppiness.contains(core::Sloppy::incbin)) {
+ result += "incbin, ";
+ }
if (sloppiness.contains(core::Sloppy::include_file_ctime)) {
result += "include_file_ctime, ";
}
&& ((q[7] == ' '
&& (q[8] == '"' || (q[8] == '\\' && q[9] == '"')))
|| q[7] == '"')) {
+ // Instead of bailing we ignore changes as sloppy incbin handling is
+ // enabled
+ if (ctx.config.sloppiness().contains(core::Sloppy::incbin)) {
+ LOG_RAW(
+ "Found potential unsupported .inc"
+ "bin directive in source code "
+ "but continuing due to enabled sloppy incbin handling");
+ q += sizeof(incbin_directive);
+ continue;
+ }
// An assembler .inc bin (without the space) 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
gcno_cwd = 1U << 11,
// Ignore -frandom-seed=*string*.
random_seed = 1U << 12,
+ // Enables sloppy handling of incbin
+ incbin = 1U << 13,
};
using Sloppiness = util::BitSet<Sloppy>;