1CCACHE(1) ccache Manual CCACHE(1)
2
3
4
6 ccache - a fast C/C++ compiler cache
7
9 ccache [options]
10 ccache compiler [compiler options]
11 compiler [compiler options] (via symbolic link)
12
14 ccache is a compiler cache. It speeds up recompilation by caching the
15 result of previous compilations and detecting when the same compilation
16 is being done again. Supported languages are C, C++, Objective-C and
17 Objective-C++.
18
19 ccache has been carefully written to always produce exactly the same
20 compiler output that you would get without the cache. The only way you
21 should be able to tell that you are using ccache is the speed.
22 Currently known exceptions to this goal are listed under CAVEATS. If
23 you ever discover an undocumented case where ccache changes the output
24 of your compiler, please let us know.
25
26 Features
27 · Keeps statistics on hits/misses.
28
29 · Automatic cache size management.
30
31 · Can cache compilations that generate warnings.
32
33 · Easy installation.
34
35 · Low overhead.
36
37 · Optionally compresses files in the cache to reduce disk space.
38
39 Limitations
40 · Only knows how to cache the compilation of a single
41 C/C++/Objective-C/Objective-C++ file. Other types of compilations
42 (multi-file compilation, linking, etc) will silently fall back to
43 running the real compiler.
44
45 · Only works with GCC and compilers that behave similar enough.
46
47 · Some compiler flags are not supported. If such a flag is detected,
48 ccache will silently fall back to running the real compiler.
49
51 There are two ways to use ccache. You can either prefix your
52 compilation commands with ccache or you can let ccache masquerade as
53 the compiler by creating a symbolic link (named as the compiler) to
54 ccache. The first method is most convenient if you just want to try out
55 ccache or wish to use it for some specific projects. The second method
56 is most useful for when you wish to use ccache for all your
57 compilations.
58
59 To use the first method, just make sure that ccache is in your PATH.
60
61 To use the symlinks method, do something like this:
62
63 cp ccache /usr/local/bin/
64 ln -s ccache /usr/local/bin/gcc
65 ln -s ccache /usr/local/bin/g++
66 ln -s ccache /usr/local/bin/cc
67 ln -s ccache /usr/local/bin/c++
68
69 And so forth. This will work as long as the directory with symlinks
70 comes before the path to the compiler (which is usually in /usr/bin).
71 After installing you may wish to run “which gcc” to make sure that the
72 correct link is being used.
73
74 Warning
75 The technique of letting ccache masquerade as the compiler works
76 well, but currently doesn’t interact well with other tools that do
77 the same thing. See USING CCACHE WITH OTHER COMPILER WRAPPERS.
78
79 Warning
80 Do not use a hard link, use a symbolic link. A hard link will cause
81 “interesting” problems.
82
84 These options only apply when you invoke ccache as “ccache”. When
85 invoked as a compiler (via a symlink as described in the previous
86 section), the normal compiler options apply and you should refer to the
87 compiler’s documentation.
88
89 -c, --cleanup
90 Clean up the cache by removing old cached files until the specified
91 file number and cache size limits are not exceeded. This also
92 recalculates the cache file count and size totals. Normally, there
93 is no need to initiate cleanup manually as ccache keeps the cache
94 below the specified limits at runtime and keeps statistics up to
95 date on each compilation. Forcing a cleanup is mostly useful if you
96 manually modify the cache contents or believe that the cache size
97 statistics may be inaccurate.
98
99 -C, --clear
100 Clear the entire cache, removing all cached files, but keeping the
101 configuration file.
102
103 --dump-manifest=PATH
104 Dump manifest file at PATH in text format. This is only useful when
105 debugging ccache and its behavior.
106
107 -k, --get-config=KEY
108 Print the value of configuration option KEY. See CONFIGURATION for
109 more information.
110
111 --hash-file=PATH
112 Print the hash (in format <MD4>-<size>) of the file at PATH. This
113 is only useful when debugging ccache and its behavior.
114
115 -h, --help
116 Print an options summary page.
117
118 -F, --max-files=N
119 Set the maximum number of files allowed in the cache. Use 0 for no
120 limit. The value is stored in a configuration file in the cache
121 directory and applies to all future compilations.
122
123 -M, --max-size=SIZE
124 Set the maximum size of the files stored in the cache. SIZE should
125 be a number followed by an optional suffix: k, M, G, T (decimal),
126 Ki, Mi, Gi or Ti (binary). The default suffix is G. Use 0 for no
127 limit. The value is stored in a configuration file in the cache
128 directory and applies to all future compilations.
129
130 --print-stats
131 Print statistics counter IDs and corresponding values
132 machine-parsable (tab-separated) format.
133
134 -o, --set-config=KEY=VALUE
135 Set configuration option KEY to VALUE. See CONFIGURATION for more
136 information.
137
138 -p, --show-config
139 Print current configuration options and from where they originate
140 (environment variable, configuration file or compile-time default)
141 in human-readable format.
142
143 -s, --show-stats
144 Print a summary of configuration and statistics counters in
145 human-readable format.
146
147 -V, --version
148 Print version and copyright information.
149
150 -z, --zero-stats
151 Zero the cache statistics (but not the configuration options).
152
154 When run as a compiler, ccache usually just takes the same command line
155 options as the compiler you are using. The only exception to this is
156 the option --ccache-skip. That option can be used to tell ccache to
157 avoid interpreting the next option in any way and to pass it along to
158 the compiler as-is.
159
160 Note
161 --ccache-skip currently only tells ccache not to interpret the next
162 option as a special compiler option — the option will still be
163 included in the direct mode hash.
164
165 The reason this can be important is that ccache does need to parse the
166 command line and determine what is an input filename and what is a
167 compiler option, as it needs the input filename to determine the name
168 of the resulting object file (among other things). The heuristic ccache
169 uses when parsing the command line is that any argument that exists as
170 a file is treated as an input file name. By using --ccache-skip you can
171 force an option to not be treated as an input file name and instead be
172 passed along to the compiler as a command line option.
173
174 Another case where --ccache-skip can be useful is if ccache interprets
175 an option specially but shouldn’t, since the option has another meaning
176 for your compiler than what ccache thinks.
177
179 ccache’s default behavior can be overridden by configuration file
180 settings, which in turn can be overridden by environment variables with
181 names starting with CCACHE_. ccache normally reads configuration from
182 two files: first a system-level configuration file and secondly a
183 cache-specific configuration file. The priority of configuration
184 settings is as follows (where 1 is highest):
185
186 1. Environment variables.
187
188 2. The cache-specific configuration file <ccachedir>/ccache.conf
189 (typically $HOME/.ccache/ccache.conf).
190
191 3. The system-wide configuration file <sysconfdir>/ccache.conf
192 (typically /etc/ccache.conf or /usr/local/etc/ccache.conf).
193
194 4. Compile-time defaults.
195
196 As a special case, if the environment variable CCACHE_CONFIGPATH is
197 set, ccache reads configuration from the specified path instead of the
198 default paths.
199
200 Configuration file syntax
201 Configuration files are in a simple “key = value” format, one setting
202 per line. Lines starting with a hash sign are comments. Blank lines are
203 ignored, as is whitespace surrounding keys and values. Example:
204
205 # Set maximum cache size to 10 GB:
206 max_size = 10G
207
208 Boolean values
209 Some settings are boolean values (i.e. truth values). In a
210 configuration file, such values must be set to the string true or
211 false. For the corresponding environment variables, the semantics are a
212 bit different: a set environment variable means “true” (even if set to
213 the empty string), the following case-insensitive negative values are
214 considered an error (rather than surprising the user): 0, false,
215 disable and no, and an unset environment variable means “false”. Each
216 boolean environment variable also has a negated form starting with
217 CCACHE_NO. For example, CCACHE_COMPRESS can be set to force compression
218 and CCACHE_NOCOMPRESS can be set to force no compression.
219
220 Configuration settings
221 Below is a list of available configuration settings. The corresponding
222 environment variable name is indicated in parentheses after each
223 configuration setting key.
224
225 base_dir (CCACHE_BASEDIR)
226 This setting should be an absolute path to a directory. ccache then
227 rewrites absolute paths into relative paths before computing the
228 hash that identifies the compilation, but only for paths under the
229 specified directory. If set to the empty string (which is the
230 default), no rewriting is done. A typical path to use as the base
231 directory is your home directory or another directory that is a
232 parent of your build directories. Don’t use / as the base directory
233 since that will make ccache also rewrite paths to system header
234 files, which doesn’t gain anything.
235
236 See also the discussion under COMPILING IN DIFFERENT DIRECTORIES.
237
238 cache_dir (CCACHE_DIR)
239 This setting specifies where ccache will keep its cached compiler
240 outputs. It will only take effect if set in the system-wide
241 configuration file or as an environment variable. The default is
242 $HOME/.ccache.
243
244 cache_dir_levels (CCACHE_NLEVELS)
245 This setting allows you to choose the number of directory levels in
246 the cache directory. The default is 2. The minimum is 1 and the
247 maximum is 8.
248
249 compiler (CCACHE_COMPILER or (deprecated) CCACHE_CC)
250 This setting can be used to force the name of the compiler to use.
251 If set to the empty string (which is the default), ccache works it
252 out from the command line.
253
254 compiler_check (CCACHE_COMPILERCHECK)
255 By default, ccache includes the modification time (“mtime”) and
256 size of the compiler in the hash to ensure that results retrieved
257 from the cache are accurate. This setting can be used to select
258 another strategy. Possible values are:
259
260 content
261 Hash the content of the compiler binary. This makes ccache very
262 slightly slower compared to the mtime setting, but makes it
263 cope better with compiler upgrades during a build bootstrapping
264 process.
265
266 mtime
267 Hash the compiler’s mtime and size, which is fast. This is the
268 default.
269
270 none
271 Don’t hash anything. This may be good for situations where you
272 can safely use the cached results even though the compiler’s
273 mtime or size has changed (e.g. if the compiler is built as
274 part of your build system and the compiler’s source has not
275 changed, or if the compiler only has changes that don’t affect
276 code generation). You should only use the none setting if you
277 know what you are doing.
278
279 string:value
280 Use value as the string to calculate hash from. This can be the
281 compiler revision number you retrieved earlier and set here via
282 environment variable.
283
284 a command string
285 Hash the standard output and standard error output of the
286 specified command. The string will be split on whitespace to
287 find out the command and arguments to run. No other
288 interpretation of the command string will be done, except that
289 the special word %compiler% will be replaced with the path to
290 the compiler. Several commands can be specified with semicolon
291 as separator. Examples:
292
293 %compiler% -v
294
295 %compiler% -dumpmachine; %compiler% -dumpversion
296
297 You should make sure that the specified command is as fast as
298 possible since it will be run once for each ccache invocation.
299
300 Identifying the compiler using a command is useful if you want
301 to avoid cache misses when the compiler has been rebuilt but
302 not changed.
303
304 Another case is when the compiler (as seen by ccache) actually
305 isn’t the real compiler but another compiler wrapper — in that
306 case, the default mtime method will hash the mtime and size of
307 the other compiler wrapper, which means that ccache won’t be
308 able to detect a compiler upgrade. Using a suitable command to
309 identify the compiler is thus safer, but it’s also slower, so
310 you should consider continue using the mtime method in
311 combination with the prefix_command setting if possible. See
312 USING CCACHE WITH OTHER COMPILER WRAPPERS.
313
314 compression (CCACHE_COMPRESS or CCACHE_NOCOMPRESS, see Boolean values
315 above)
316 If true, ccache will compress object files and other compiler
317 output it puts in the cache. However, this setting has no effect on
318 how files are retrieved from the cache; compressed and uncompressed
319 results will still be usable regardless of this setting. The
320 default is false.
321
322 compression_level (CCACHE_COMPRESSLEVEL)
323 This setting determines the level at which ccache will compress
324 object files. It only has effect if compression is enabled. The
325 value defaults to 6, and must be no lower than 1 (fastest, worst
326 compression) and no higher than 9 (slowest, best compression).
327
328 cpp_extension (CCACHE_EXTENSION)
329 This setting can be used to force a certain extension for the
330 intermediate preprocessed file. The default is to automatically
331 determine the extension to use for intermediate preprocessor files
332 based on the type of file being compiled, but that sometimes
333 doesn’t work. For example, when using the “aCC” compiler on HP-UX,
334 set the cpp extension to i.
335
336 debug (CCACHE_DEBUG or CCACHE_NODEBUG, see Boolean values above)
337 If true, enable the debug mode. The debug mode creates per-object
338 debug files that are helpful when debugging unexpected cache
339 misses. Note however that ccache performance will be reduced
340 slightly. See debugging for more information. The default is false.
341
342 depend_mode (CCACHE_DEPEND or CCACHE_NODEPEND, see Boolean values
343 above)
344 If true, the depend mode will be used. The default is false. See
345 THE DEPEND MODE.
346
347 direct_mode (CCACHE_DIRECT or CCACHE_NODIRECT, see Boolean values
348 above)
349 If true, the direct mode will be used. The default is true. See THE
350 DIRECT MODE.
351
352 disable (CCACHE_DISABLE or CCACHE_NODISABLE, see Boolean values above)
353 When true, ccache will just call the real compiler, bypassing the
354 cache completely. The default is false.
355
356 extra_files_to_hash (CCACHE_EXTRAFILES)
357 This setting is a list of paths to files that ccache will include
358 in the the hash sum that identifies the build. The list separator
359 is semicolon on Windows systems and colon on other systems.
360
361 hard_link (CCACHE_HARDLINK or CCACHE_NOHARDLINK, see Boolean values
362 above)
363 If true, ccache will attempt to use hard links from the cache
364 directory when creating the compiler output rather than using a
365 file copy. Hard links are never made for compressed cache files.
366 This means that you should not enable compression if you want to
367 use hard links. The default is false.
368
369 Warning
370 Do not enable this option unless you are aware of the
371 consequences. Using hard links may be slightly faster in some
372 situations, but there are several pitfalls since the resulting
373 object file will share i-node with the cached object file:
374
375 1. If the resulting object file is modified in any way, the cached
376 object file will be modified as well. For instance, if you run
377 strip object.o or echo >object.o, you will corrupt the cache.
378
379 2. Programs that rely on modification times (like “make”) can be
380 confused since ccache updates the cached files' modification
381 times as part of the automatic cache size management. This will
382 affect object files in the build tree as well, which can
383 retrigger the linking step even though nothing really has
384 changed.
385
386 hash_dir (CCACHE_HASHDIR or CCACHE_NOHASHDIR, see Boolean values above)
387 If true (which is the default), ccache will include the current
388 working directory (CWD) in the hash that is used to distinguish two
389 compilations when generating debug info (compiler option -g with
390 variations). Exception: The CWD will not be included in the hash if
391 base_dir is set (and matches the CWD) and the compiler option
392 -fdebug-prefix-map is used. See also the discussion under COMPILING
393 IN DIFFERENT DIRECTORIES.
394
395 The reason for including the CWD in the hash by default is to
396 prevent a problem with the storage of the current working directory
397 in the debug info of an object file, which can lead ccache to
398 return a cached object file that has the working directory in the
399 debug info set incorrectly.
400
401 You can disable this setting to get cache hits when compiling the
402 same source code in different directories if you don’t mind that
403 CWD in the debug info might be incorrect.
404
405 ignore_headers_in_manifest (CCACHE_IGNOREHEADERS)
406 This setting is a list of paths to files (or directories with
407 headers) that ccache will not include in the manifest list that
408 makes up the direct mode. Note that this can cause stale cache hits
409 if those headers do indeed change. The list separator is semicolon
410 on Windows systems and colon on other systems.
411
412 keep_comments_cpp (CCACHE_COMMENTS or CCACHE_NOCOMMENTS, see Boolean
413 values above)
414 If true, ccache will not discard the comments before hashing
415 preprocessor output. This can be used to check documentation with
416 -Wdocumentation.
417
418 limit_multiple (CCACHE_LIMIT_MULTIPLE)
419 Sets the limit when cleaning up. Files are deleted (in LRU order)
420 until the levels are below the limit. The default is 0.8 (= 80%).
421 See AUTOMATIC CLEANUP for more information.
422
423 log_file (CCACHE_LOGFILE)
424 If set to a file path, ccache will write information on what it is
425 doing to the specified file. This is useful for tracking down
426 problems.
427
428 max_files (CCACHE_MAXFILES)
429 This option specifies the maximum number of files to keep in the
430 cache. Use 0 for no limit (which is the default). See also CACHE
431 SIZE MANAGEMENT.
432
433 max_size (CCACHE_MAXSIZE)
434 This option specifies the maximum size of the cache. Use 0 for no
435 limit. The default value is 5G. Available suffixes: k, M, G, T
436 (decimal) and Ki, Mi, Gi, Ti (binary). The default suffix is G. See
437 also CACHE SIZE MANAGEMENT.
438
439 path (CCACHE_PATH)
440 If set, ccache will search directories in this list when looking
441 for the real compiler. The list separator is semicolon on Windows
442 systems and colon on other systems. If not set, ccache will look
443 for the first executable matching the compiler name in the normal
444 PATH that isn’t a symbolic link to ccache itself.
445
446 pch_external_checksum (CCACHE_PCH_EXTSUM or CCACHE_NOPCH_EXTSUM, see
447 Boolean values above)
448 When this option is set, and ccache finds a precompiled header
449 file, ccache will look for a file with the extension “.sum” added
450 (e.g. “pre.h.gch.sum”), and if found, it will hash this file
451 instead of the precompiled header itself to work around the
452 performance penalty of hashing very large files.
453
454 prefix_command (CCACHE_PREFIX)
455 This option adds a list of prefixes (separated by space) to the
456 command line that ccache uses when invoking the compiler. See also
457 USING CCACHE WITH OTHER COMPILER WRAPPERS.
458
459 prefix_command_cpp (CCACHE_PREFIX_CPP)
460 This option adds a list of prefixes (separated by space) to the
461 command line that ccache uses when invoking the preprocessor.
462
463 read_only (CCACHE_READONLY or CCACHE_NOREADONLY, see Boolean values
464 above)
465 If true, ccache will attempt to use existing cached object files,
466 but it will not to try to add anything new to the cache. If you are
467 using this because your ccache directory is read-only, then you
468 need to set temporary_dir as otherwise ccache will fail to create
469 temporary files.
470
471 read_only_direct (CCACHE_READONLY_DIRECT or CCACHE_NOREADONLY_DIRECT,
472 see Boolean values above)
473 Just like read_only except that ccache will only try to retrieve
474 results from the cache using the direct mode, not the preprocessor
475 mode. See documentation for read_only regarding using a read-only
476 ccache directory.
477
478 recache (CCACHE_RECACHE or CCACHE_NORECACHE, see Boolean values above)
479 If true, ccache will not use any previously stored result. New
480 results will still be cached, possibly overwriting any pre-existing
481 results.
482
483 run_second_cpp (CCACHE_CPP2 or CCACHE_NOCPP2, see Boolean values above)
484 If true, ccache will first run the preprocessor to preprocess the
485 source code (see THE PREPROCESSOR MODE) and then on a cache miss
486 run the compiler on the source code to get hold of the object file.
487 This is the default.
488
489 If false, ccache will first run preprocessor to preprocess the
490 source code and then on a cache miss run the compiler on the
491 preprocessed source code instead of the original source code. This
492 makes cache misses slightly faster since the source code only has
493 to be preprocessed once. The downside is that some compilers won’t
494 produce the same result (for instance diagnostics warnings) when
495 compiling preprocessed source code.
496
497 A solution to the above mentioned downside is to set run_second_cpp
498 to false and pass -fdirectives-only (for GCC) or -frewrite-includes
499 (for Clang) to the compiler. This will cause the compiler to leave
500 the macros and other preprocessor information, and only process the
501 #include directives. When run in this way, the preprocessor
502 arguments will be passed to the compiler since it still has to do
503 some preprocessing (like macros).
504
505 sloppiness (CCACHE_SLOPPINESS)
506 By default, ccache tries to give as few false cache hits as
507 possible. However, in certain situations it’s possible that you
508 know things that ccache can’t take for granted. This setting makes
509 it possible to tell ccache to relax some checks in order to
510 increase the hit rate. The value should be a comma-separated string
511 with options. Available options are:
512
513 clang_index_store
514 Ignore the Clang compiler option -index-store-path and its
515 argument when computing the manifest hash. This is useful if
516 you use Xcode, which uses an index store path derived from the
517 local project path. Note that the index store won’t be updated
518 correctly on cache hits if you enable this option.
519
520 file_stat_matches
521 ccache normally examines a file’s contents to determine whether
522 it matches the cached version. With this option set, ccache
523 will consider a file as matching its cached version if the
524 mtimes and ctimes match.
525
526 file_stat_matches_ctime
527 Ignore ctimes when file_stat_matches is enabled. This can be
528 useful when backdating files' mtimes in a controlled way.
529
530 include_file_ctime
531 By default, ccache also will not cache a file if it includes a
532 header whose ctime is too new. This option disables that check.
533
534 include_file_mtime
535 By default, ccache will not cache a file if it includes a
536 header whose mtime is too new. This option disables that check.
537
538 locale
539 ccache includes the environment variables LANG, LC_ALL,
540 LC_CTYPE and LC_MESSAGES in the hash by default since they may
541 affect localization of compiler warning messages. Set this
542 option to tell ccache not to do that.
543
544 pch_defines
545 Be sloppy about #defines when precompiling a header file. See
546 PRECOMPILED HEADERS for more information.
547
548 system_headers
549 By default, ccache will also include all system headers in the
550 manifest. With this option set, ccache will only include system
551 headers in the hash but not add the system header files to the
552 list of include files.
553
554 time_macros
555 Ignore __DATE__ and __TIME__ being present in the source code.
556
557 See the discussion under TROUBLESHOOTING for more information.
558
559 stats (CCACHE_STATS or CCACHE_NOSTATS, see Boolean values above)
560 If true, ccache will update the statistics counters on each
561 compilation. The default is true.
562
563 temporary_dir (CCACHE_TEMPDIR)
564 This setting specifies where ccache will put temporary files. The
565 default is <cache_dir>/tmp.
566
567 Note
568 In previous versions of ccache, CCACHE_TEMPDIR had to be on the
569 same filesystem as the CCACHE_DIR path, but this requirement
570 has been relaxed.)
571
572 umask (CCACHE_UMASK)
573 This setting specifies the umask for ccache and all child processes
574 (such as the compiler). This is mostly useful when you wish to
575 share your cache with other users. Note that this also affects the
576 file permissions set on the object files created from your
577 compilations.
578
579 unify (CCACHE_UNIFY or CCACHE_NOUNIFY, see Boolean values above)
580 If true, ccache will use a C/C++ unifier when hashing the
581 preprocessor output if the -g option is not used. The unifier is
582 slower than a normal hash, so setting this environment variable
583 loses a little bit of speed, but it means that ccache can take
584 advantage of not recompiling when the changes to the source code
585 consist of reformatting only. Note that enabling the unifier
586 changes the hash, so cached compilations produced when the unifier
587 is enabled cannot be reused when the unifier is disabled, and vice
588 versa. Enabling the unifier may result in incorrect line number
589 information in compiler warning messages and expansions of the
590 __LINE__ macro.
591
593 By default, ccache has a 5 GB limit on the total size of files in the
594 cache and no limit on the number of files. You can set different limits
595 using the -M/--max-size and -F/--max-files options. Use ccache
596 -s/--show-stats to see the cache size and the currently configured
597 limits (in addition to other various statistics).
598
599 Cleanup can be triggered in two different ways: automatic and manual.
600
601 Automatic cleanup
602 ccache maintains counters for various statistics about the cache,
603 including the size and number of all cached files. In order to improve
604 performance and reduce issues with concurrent ccache invocations, there
605 is one statistics file for each of the sixteen subdirectories in the
606 cache.
607
608 After a new compilation result has been written to the cache, ccache
609 will update the size and file number statistics for the subdirectory
610 (one of sixteen) to which the result was written. Then, if the size
611 counter for said subdirectory is greater than max_size / 16 or the file
612 number counter is greater than max_files / 16, automatic cleanup is
613 triggered.
614
615 When automatic cleanup is triggered for a subdirectory in the cache,
616 ccache will:
617
618 1. Count all files in the subdirectory and compute their aggregated
619 size.
620
621 2. Remove files in LRU (least recently used) order until the size is
622 at most limit_multiple * max_size / 16 and the number of files is
623 at most limit_multiple * max_files / 16, where limit_multiple,
624 max_size and max_files are configuration settings.
625
626 3. Set the size and file number counters to match the files that were
627 kept.
628
629 The reason for removing more files than just those needed to not exceed
630 the max limits is that a cleanup is a fairly slow operation, so it
631 would not be a good idea to trigger it often, like after each cache
632 miss.
633
634 Manual cleanup
635 You can run ccache -c/--cleanup to force cleanup of the whole cache,
636 i.e. all of the sixteen subdirectories. This will recalculate the
637 statistics counters and make sure that the max_size and max_files
638 settings are not exceeded. Note that limit_multiple is not taken into
639 account for manual cleanup.
640
642 ccache can optionally compress all files it puts into the cache using
643 the compression library zlib. While this may involve a tiny performance
644 slowdown, it increases the number of files that fit in the cache. You
645 can turn on compression with the compression configuration setting and
646 you can also tweak the compression level with compression_level.
647
649 ccache -s/--show-stats can show the following statistics:
650
651 ┌───────────────────────────┬────────────────────────────┐
652 │Name │ Description │
653 ├───────────────────────────┼────────────────────────────┤
654 │ │ │
655 │autoconf compile/link │ Uncachable compilation or │
656 │ │ linking by an autoconf │
657 │ │ test. │
658 ├───────────────────────────┼────────────────────────────┤
659 │ │ │
660 │bad compiler arguments │ Malformed compiler │
661 │ │ argument, e.g. missing a │
662 │ │ value for an option that │
663 │ │ requires an argument or │
664 │ │ failure to read a file │
665 │ │ specified by an option │
666 │ │ argument. │
667 ├───────────────────────────┼────────────────────────────┤
668 │ │ │
669 │cache file missing │ A file was unexpectedly │
670 │ │ missing from the cache. │
671 │ │ This only happens in rare │
672 │ │ situations, e.g. if one │
673 │ │ ccache instance is about │
674 │ │ to get a file from the │
675 │ │ cache while another │
676 │ │ instance removed the file │
677 │ │ as part of cache cleanup. │
678 ├───────────────────────────┼────────────────────────────┤
679 │ │ │
680 │cache hit (direct) │ A result was successfully │
681 │ │ found using the direct │
682 │ │ mode. │
683 ├───────────────────────────┼────────────────────────────┤
684 │ │ │
685 │cache hit (preprocessed) │ A result was successfully │
686 │ │ found using the │
687 │ │ preprocessor mode. │
688 ├───────────────────────────┼────────────────────────────┤
689 │ │ │
690 │cache miss │ No result was found. │
691 ├───────────────────────────┼────────────────────────────┤
692 │ │ │
693 │cache size │ Current size of the cache. │
694 ├───────────────────────────┼────────────────────────────┤
695 │ │ │
696 │called for link │ The compiler was called │
697 │ │ for linking, not │
698 │ │ compiling. │
699 ├───────────────────────────┼────────────────────────────┤
700 │ │ │
701 │called for preprocessing │ The compiler was called │
702 │ │ for preprocessing, not │
703 │ │ compiling. │
704 ├───────────────────────────┼────────────────────────────┤
705 │ │ │
706 │can’t use precompiled │ Preconditions for using │
707 │header │ precompiled headers were │
708 │ │ not fulfilled. │
709 ├───────────────────────────┼────────────────────────────┤
710 │ │ │
711 │ccache internal error │ Unexpected failure, e.g. │
712 │ │ due to problems │
713 │ │ reading/writing the cache. │
714 ├───────────────────────────┼────────────────────────────┤
715 │ │ │
716 │cleanups performed │ Number of cleanups │
717 │ │ performed, either │
718 │ │ implicitly due to the │
719 │ │ cache size limit being │
720 │ │ reached or due to explicit │
721 │ │ ccache -c/--cleanup calls. │
722 ├───────────────────────────┼────────────────────────────┤
723 │ │ │
724 │compile failed │ The compilation failed. No │
725 │ │ result stored in the │
726 │ │ cache. │
727 ├───────────────────────────┼────────────────────────────┤
728 │ │ │
729 │compiler check failed │ A compiler check program │
730 │ │ specified by │
731 │ │ compiler_check │
732 │ │ (CCACHE_COMPILERCHECK) │
733 │ │ failed. │
734 ├───────────────────────────┼────────────────────────────┤
735 │ │ │
736 │compiler produced empty │ The compiler’s output file │
737 │output │ (typically an object file) │
738 │ │ was empty after │
739 │ │ compilation. │
740 ├───────────────────────────┼────────────────────────────┤
741 │ │ │
742 │compiler produced no │ The compiler’s output file │
743 │output │ (typically an object file) │
744 │ │ was missing after │
745 │ │ compilation. │
746 ├───────────────────────────┼────────────────────────────┤
747 │ │ │
748 │compiler produced stdout │ The compiler wrote data to │
749 │ │ standard output. This is │
750 │ │ something that compilers │
751 │ │ normally never do, so │
752 │ │ ccache is not designed to │
753 │ │ store such output in the │
754 │ │ cache. │
755 ├───────────────────────────┼────────────────────────────┤
756 │ │ │
757 │couldn’t find the compiler │ The compiler to execute │
758 │ │ could not be found. │
759 ├───────────────────────────┼────────────────────────────┤
760 │ │ │
761 │error hashing extra file │ Failure reading a file │
762 │ │ specified by │
763 │ │ extra_files_to_hash │
764 │ │ (CCACHE_EXTRAFILES). │
765 ├───────────────────────────┼────────────────────────────┤
766 │ │ │
767 │files in cache │ Current number of files in │
768 │ │ the cache. │
769 ├───────────────────────────┼────────────────────────────┤
770 │ │ │
771 │multiple source files │ The compiler was called to │
772 │ │ compile multiple source │
773 │ │ files in one go. This is │
774 │ │ not supported by ccache. │
775 ├───────────────────────────┼────────────────────────────┤
776 │ │ │
777 │no input file │ No input file was │
778 │ │ specified to the compiler. │
779 ├───────────────────────────┼────────────────────────────┤
780 │ │ │
781 │output to a non-regular │ The output path specified │
782 │file │ with -o is not a file │
783 │ │ (e.g. a directory or a │
784 │ │ device node). │
785 ├───────────────────────────┼────────────────────────────┤
786 │ │ │
787 │output to stdout │ The compiler was │
788 │ │ instructed to write its │
789 │ │ output to standard output │
790 │ │ using -o -. This is not │
791 │ │ supported by ccache. │
792 ├───────────────────────────┼────────────────────────────┤
793 │ │ │
794 │preprocessor error │ Preprocessing the source │
795 │ │ code using the compiler’s │
796 │ │ -E option failed. │
797 ├───────────────────────────┼────────────────────────────┤
798 │ │ │
799 │stats updated │ When statistics were │
800 │ │ updated the last time. │
801 ├───────────────────────────┼────────────────────────────┤
802 │ │ │
803 │stats zeroed │ When ccache -z was called │
804 │ │ the last time. │
805 ├───────────────────────────┼────────────────────────────┤
806 │ │ │
807 │unsupported code directive │ Code like the assembler │
808 │ │ .incbin directive was │
809 │ │ found. This is not │
810 │ │ supported by ccache. │
811 ├───────────────────────────┼────────────────────────────┤
812 │ │ │
813 │unsupported compiler │ A compiler option not │
814 │option │ supported by ccache was │
815 │ │ found. │
816 ├───────────────────────────┼────────────────────────────┤
817 │ │ │
818 │unsupported source │ A source language e.g. │
819 │language │ specified with -x was │
820 │ │ unsupported by ccache. │
821 └───────────────────────────┴────────────────────────────┘
822
824 The basic idea is to detect when you are compiling exactly the same
825 code a second time and reuse the previously produced output. The
826 detection is done by hashing different kinds of information that should
827 be unique for the compilation and then using the hash sum to identify
828 the cached output. ccache uses MD4, a very fast cryptographic hash
829 algorithm, for the hashing. (MD4 is nowadays too weak to be useful in
830 cryptographic contexts, but it should be safe enough to be used to
831 identify recompilations.) On a cache hit, ccache is able to supply all
832 of the correct compiler outputs (including all warnings, dependency
833 file, etc) from the cache.
834
835 ccache has two ways of gathering information used to look up results in
836 the cache:
837
838 · the direct mode, where ccache hashes the source code and include
839 files directly
840
841 · the preprocessor mode, where ccache runs the preprocessor on the
842 source code and hashes the result
843
844 The direct mode is generally faster since running the preprocessor has
845 some overhead.
846
847 If no previous result is detected (i.e., there is a cache miss) using
848 the direct mode, ccache will fall back to the preprocessor mode unless
849 the depend mode is enabled. In the depend mode, ccache never runs the
850 preprocessor, not even on cache misses. Read more in THE DEPEND MODE
851 below.
852
853 Common hashed information
854 The following information is always included in the hash:
855
856 · the extension used by the compiler for a file with preprocessor
857 output (normally .i for C code and .ii for C++ code)
858
859 · the compiler’s size and modification time (or other
860 compiler-specific information specified by the compiler_check
861 setting)
862
863 · the name of the compiler
864
865 · the current directory (if the hash_dir setting is enabled)
866
867 · contents of files specified by the extra_files_to_hash setting (if
868 any)
869
870 The direct mode
871 In the direct mode, the hash is formed of the common information and:
872
873 · the input source file
874
875 · the command line options
876
877 Based on the hash, a data structure called “manifest” is looked up in
878 the cache. The manifest contains:
879
880 · references to cached compilation results (object file, dependency
881 file, etc) that were produced by previous compilations that matched
882 the hash
883
884 · paths to the include files that were read at the time the
885 compilation results were stored in the cache
886
887 · hash sums of the include files at the time the compilation results
888 were stored in the cache
889
890 The current contents of the include files are then hashed and compared
891 to the information in the manifest. If there is a match, ccache knows
892 the result of the compilation. If there is no match, ccache falls back
893 to running the preprocessor. The output from the preprocessor is parsed
894 to find the include files that were read. The paths and hash sums of
895 those include files are then stored in the manifest along with
896 information about the produced compilation result.
897
898 There is a catch with the direct mode: header files that were used by
899 the compiler are recorded, but header files that were not used, but
900 would have been used if they existed, are not. So, when ccache checks
901 if a result can be taken from the cache, it currently can’t check if
902 the existence of a new header file should invalidate the result. In
903 practice, the direct mode is safe to use in the absolute majority of
904 cases.
905
906 The direct mode will be disabled if any of the following holds:
907
908 · the configuration setting direct_mode is false
909
910 · a modification time of one of the include files is too new (needed
911 to avoid a race condition)
912
913 · a compiler option not supported by the direct mode is used:
914
915 · a -Wp,X compiler option other than -Wp,-MD,path, -Wp,-MMD,path
916 and -Wp,-D_define_
917
918 · -Xpreprocessor
919
920 · the string __TIME__ is present in the source code
921
922 The preprocessor mode
923 In the preprocessor mode, the hash is formed of the common information
924 and:
925
926 · the preprocessor output from running the compiler with -E
927
928 · the command line options except options that affect include files
929 (-I, -include, -D, etc; the theory is that these options will
930 change the preprocessor output if they have any effect at all)
931
932 · any standard error output generated by the preprocessor
933
934 Based on the hash, the cached compilation result can be looked up
935 directly in the cache.
936
937 The depend mode
938 If the depend mode is enabled, ccache will not use the preprocessor at
939 all. The hash used to identify results in the cache will be based on
940 the direct mode hash described above plus information about include
941 files read from the dependency file generated by the compiler with -MD
942 or -MMD.
943
944 Advantages:
945
946 · The ccache overhead of a cache miss will be much smaller.
947
948 · Not running the preprocessor at all can be good if compilation is
949 performed remotely, for instance when using distcc or similar;
950 ccache then won’t make potentially costly preprocessor calls on the
951 local machine.
952
953 Disadvantages:
954
955 · The cache hit rate will likely be lower since any change to
956 compiler options or source code will make the hash different.
957 Compare this with the default setup where ccache will fall back to
958 the preprocessor mode, which is tolerant to some types of changes
959 of compiler options and source code changes.
960
961 · If -MD is used, the manifest entries will include system header
962 files as well, thus slowing down cache hits slightly, just as using
963 -MD slows down make.
964
965 · If -MMD is used, the manifest entries will not include system
966 header files, which means ccache will ignore changes in them.
967
968 The depend mode will be disabled if any of the following holds:
969
970 · the configuration setting depend_mode is false
971
972 · the configuration setting run_second_cpp is false
973
974 · the configuration setting unify is true
975
976 · the compiler is not generating dependencies using -MD or -MMD
977
979 To find out what information ccache actually is hashing, you can enable
980 the debug mode via the configuration setting debug or by setting
981 CCACHE_DEBUG in the environment. This can be useful if you are
982 investigating why you don’t get cache hits. Note that performance will
983 be reduced slightly.
984
985 When the debug mode is enabled, ccache will create up to five
986 additional files next to the object file:
987
988 ┌───────────────────────────────┬───────────────────────────┐
989 │Filename │ Description │
990 ├───────────────────────────────┼───────────────────────────┤
991 │ │ │
992 │<objectfile>.ccache-input-c │ Binary input hashed by │
993 │ │ both the direct mode and │
994 │ │ the preprocessor mode. │
995 ├───────────────────────────────┼───────────────────────────┤
996 │ │ │
997 │<objectfile>.ccache-input-d │ Binary input only hashed │
998 │ │ by the direct mode. │
999 ├───────────────────────────────┼───────────────────────────┤
1000 │ │ │
1001 │<objectfile>.ccache-input-p │ Binary input only hashed │
1002 │ │ by the preprocessor mode. │
1003 ├───────────────────────────────┼───────────────────────────┤
1004 │ │ │
1005 │<objectfile>.ccache-input-text │ Human-readable combined │
1006 │ │ diffable text version of │
1007 │ │ the three files above. │
1008 ├───────────────────────────────┼───────────────────────────┤
1009 │ │ │
1010 │<objectfile>.ccache-log │ Log for this object file. │
1011 └───────────────────────────────┴───────────────────────────┘
1012
1013 In the direct mode, ccache uses the MD4 hash of the ccache-input-c +
1014 ccache-input-d data (where + means concatenation), while the
1015 ccache-input-c + ccache-input-p data is used in the preprocessor mode.
1016
1017 The ccache-input-text file is a combined text version of the three
1018 binary input files. It has three sections (“COMMON”, “DIRECT MODE” and
1019 “PREPROCESSOR MODE”), which is turn contain annotations that say what
1020 kind of data comes next.
1021
1022 To debug why you don’t get an expected cache hit for an object file,
1023 you can do something like this:
1024
1025 1. Build with debug mode enabled.
1026
1027 2. Save the <objectfile>.ccache-* files.
1028
1029 3. Build again with debug mode enabled.
1030
1031 4. Compare <objectfile>.ccache-input-text for the two builds. This
1032 together with the <objectfile>.ccache-log files should give you
1033 some clues about what is happening.
1034
1036 Some information included in the hash that identifies a unique
1037 compilation can contain absolute paths:
1038
1039 · The preprocessed source code may contain absolute paths to include
1040 files if the compiler option -g is used or if absolute paths are
1041 given to -I and similar compiler options.
1042
1043 · Paths specified by compiler options (such as -I, -MF, etc) on the
1044 command line may be absolute.
1045
1046 · The source code file path may be absolute, and that path may
1047 substituted for __FILE__ macros in the source code or included in
1048 warnings emitted to standard error by the preprocessor.
1049
1050 This means that if you compile the same code in different locations,
1051 you can’t share compilation results between the different build
1052 directories since you get cache misses because of the absolute build
1053 directory paths that are part of the hash.
1054
1055 Here’s what can be done to enable cache hits between different build
1056 directories:
1057
1058 · If you build with -g (or similar) to add debug information to the
1059 object file, you must either:
1060
1061 · use the -fdebug-prefix-map=old=new option for relocating debug
1062 info to a common prefix (e.g. -fdebug-prefix-map=$PWD=.); or
1063
1064 · set hash_dir = false.
1065
1066 · If you use absolute paths anywhere on the command line (e.g. the
1067 source code file path or an argument to compiler options like -I
1068 and -MF), you must to set base_dir to an absolute path to a “base
1069 directory”. ccache will then rewrite absolute paths under that
1070 directory to relative before computing the hash.
1071
1073 ccache has support for GCC’s precompiled headers. However, you have to
1074 do some things to make it work properly:
1075
1076 · You must set sloppiness to pch_defines,time_macros. The reason is
1077 that ccache can’t tell whether __TIME__ or __DATE__ is used when
1078 using a precompiled header. Further, it can’t detect changes in
1079 #defines in the source code because of how preprocessing works in
1080 combination with precompiled headers.
1081
1082 · You must either:
1083
1084 · use the -include compiler option to include the precompiled
1085 header (i.e., don’t use #include in the source code to include
1086 the header; the filename itself must be sufficient to find the
1087 header, i.e. -I paths are not searched); or
1088
1089 · (for the Clang compiler) use the -include-pch compiler option
1090 to include the PCH file generated from the precompiled header;
1091 or
1092
1093 · (for the GCC compiler) add the -fpch-preprocess compiler option
1094 when compiling.
1095
1096 If you don’t do this, either the non-precompiled version of the
1097 header file will be used (if available) or ccache will fall back to
1098 running the real compiler and increase the statistics counter
1099 “preprocessor error” (if the non-precompiled header file is not
1100 available).
1101
1103 A group of developers can increase the cache hit rate by sharing a
1104 cache directory. To share a cache without unpleasant side effects, the
1105 following conditions should to be met:
1106
1107 · Use the same cache directory.
1108
1109 · Make sure that the configuration setting hard_link is false (which
1110 is the default).
1111
1112 · Make sure that all users are in the same group.
1113
1114 · Set the configuration setting umask to 002. This ensures that
1115 cached files are accessible to everyone in the group.
1116
1117 · Make sure that all users have write permission in the entire cache
1118 directory (and that you trust all users of the shared cache).
1119
1120 · Make sure that the setgid bit is set on all directories in the
1121 cache. This tells the filesystem to inherit group ownership for new
1122 directories. The following command might be useful for this:
1123
1124 find $CCACHE_DIR -type d | xargs chmod g+s
1125
1126 The reason to avoid the hard link mode is that the hard links cause
1127 unwanted side effects, as all links to a cached file share the file’s
1128 modification timestamp. This results in false dependencies to be
1129 triggered by timestamp-based build systems whenever another user links
1130 to an existing file. Typically, users will see that their libraries and
1131 binaries are relinked without reason.
1132
1133 You may also want to make sure that a base directory is set
1134 appropriately, as discussed in a previous section.
1135
1137 It is possible to put the cache directory on an NFS filesystem (or
1138 similar filesystems), but keep in mind that:
1139
1140 · Having the cache on NFS may slow down compilation. Make sure to do
1141 some benchmarking to see if it’s worth it.
1142
1143 · ccache hasn’t been tested very thoroughly on NFS.
1144
1145 A tip is to set temporary_dir to a directory on the local host to avoid
1146 NFS traffic for temporary files.
1147
1149 The recommended way of combining ccache with another compiler wrapper
1150 (such as “distcc”) is by letting ccache execute the compiler wrapper.
1151 This is accomplished by defining the configuration setting
1152 prefix_command, for example by setting the environment variable
1153 CCACHE_PREFIX to the name of the wrapper (e.g. distcc). ccache will
1154 then prefix the command line with the specified command when running
1155 the compiler. To specify several prefix commands, set prefix_command to
1156 a colon-separated list of commands.
1157
1158 Unless you set compiler_check to a suitable command (see the
1159 description of that configuration option), it is not recommended to use
1160 the form ccache anotherwrapper compiler args as the compilation
1161 command. It’s also not recommended to use the masquerading technique
1162 for the other compiler wrapper. The reason is that by default, ccache
1163 will in both cases hash the mtime and size of the other wrapper instead
1164 of the real compiler, which means that:
1165
1166 · Compiler upgrades will not be detected properly.
1167
1168 · The cached results will not be shared between compilations with and
1169 without the other wrapper.
1170
1171 Another minor thing is that if prefix_command is used, ccache will not
1172 invoke the other wrapper when running the preprocessor, which increases
1173 performance. You can use the prefix_command_cpp configuration setting
1174 if you also want to invoke the other wrapper when doing preprocessing
1175 (normally by adding -E).
1176
1178 · The direct mode fails to pick up new header files in some rare
1179 scenarios. See THE DIRECT MODE above.
1180
1181 · When run via ccache, warning messages produced by GCC 4.9 and newer
1182 will only be colored when the environment variable GCC_COLORS is
1183 set. An alternative to setting GCC_COLORS is to pass
1184 -fdiagnostics-color explicitly when compiling (but then color codes
1185 will also be present when redirecting stderr to a file).
1186
1187 · If ccache guesses that the compiler may emit colored warnings, then
1188 a compilation with stderr referring to a TTY will be considered
1189 different from a compilation with a redirected stderr, thus not
1190 sharing cache entries. This happens for clang by default and for
1191 GCC when GCC_COLORS is set as mentioned above. If you want to share
1192 cache hits, you can pass -f[no-]diagnostics-color (GCC) or
1193 -f[no-]color-diagnostics (clang) explicitly when compiling (but
1194 then color codes will be either on or off for both the TTY and the
1195 redirected case).
1196
1198 General
1199 A general tip for getting information about what ccache is doing is to
1200 enable debug logging by setting the configuration option debug (or the
1201 environment variable CCACHE_DEBUG); see debugging for more information.
1202 Another way of keeping track of what is happening is to check the
1203 output of ccache -s.
1204
1205 Performance
1206 ccache has been written to perform well out of the box, but sometimes
1207 you may have to do some adjustments of how you use the compiler and
1208 ccache in order to improve performance.
1209
1210 Since ccache works best when I/O is fast, put the cache directory on a
1211 fast storage device if possible. Having lots of free memory so that
1212 files in the cache directory stay in the disk cache is also preferable.
1213
1214 A good way of monitoring how well ccache works is to run ccache -s
1215 before and after your build and then compare the statistics counters.
1216 Here are some common problems and what may be done to increase the hit
1217 rate:
1218
1219 · If “cache hit (preprocessed)” has been incremented instead of
1220 “cache hit (direct)”, ccache has fallen back to preprocessor mode,
1221 which is generally slower. Some possible reasons are:
1222
1223 · The source code has been modified in such a way that the
1224 preprocessor output is not affected.
1225
1226 · Compiler arguments that are hashed in the direct mode but not
1227 in the preprocessor mode have changed (-I, -include, -D, etc)
1228 and they didn’t affect the preprocessor output.
1229
1230 · The compiler option -Xpreprocessor or -Wp,X (except
1231 -Wp,-MD,path, -Wp,-MMD,path, and -Wp,-D_define_) is used.
1232
1233 · This was the first compilation with a new value of the base
1234 directory setting.
1235
1236 · A modification time of one of the include files is too new
1237 (created the same second as the compilation is being done).
1238 This check is made to avoid a race condition. To fix this,
1239 create the include file earlier in the build process, if
1240 possible, or set sloppiness to include_file_mtime if you are
1241 willing to take the risk. (The race condition consists of these
1242 events: the preprocessor is run; an include file is modified by
1243 someone; the new include file is hashed by ccache; the real
1244 compiler is run on the preprocessor’s output, which contains
1245 data from the old header file; the wrong object file is stored
1246 in the cache.)
1247
1248 · The __TIME__ preprocessor macro is (potentially) being used.
1249 ccache turns off direct mode if __TIME__ is present in the
1250 source code. This is done as a safety measure since the string
1251 indicates that a __TIME__ macro may affect the output. (To be
1252 sure, ccache would have to run the preprocessor, but the sole
1253 point of the direct mode is to avoid that.) If you know that
1254 __TIME__ isn’t used in practise, or don’t care if ccache
1255 produces objects where __TIME__ is expanded to something in the
1256 past, you can set sloppiness to time_macros.
1257
1258 · The __DATE__ preprocessor macro is (potentially) being used and
1259 the date has changed. This is similar to how __TIME__ is
1260 handled. If __DATE__ is present in the source code, ccache
1261 hashes the current date in order to be able to produce the
1262 correct object file if the __DATE__ macro affects the output.
1263 If you know that __DATE__ isn’t used in practise, or don’t care
1264 if ccache produces objects where __DATE__ is expanded to
1265 something in the past, you can set sloppiness to time_macros.
1266
1267 · The input file path has changed. ccache includes the input file
1268 path in the direct mode hash to be able to take relative
1269 include files into account and to produce a correct object file
1270 if the source code includes a __FILE__ macro.
1271
1272 · If “cache miss” has been incremented even though the same code has
1273 been compiled and cached before, ccache has either detected that
1274 something has changed anyway or a cleanup has been performed
1275 (either explicitly or implicitly when a cache limit has been
1276 reached). Some perhaps unobvious things that may result in a cache
1277 miss are usage of __TIME__ or __DATE__ macros, or use of
1278 automatically generated code that contains a timestamp, build
1279 counter or other volatile information.
1280
1281 · If “multiple source files” has been incremented, it’s an indication
1282 that the compiler has been invoked on several source code files at
1283 once. ccache doesn’t support that. Compile the source code files
1284 separately if possible.
1285
1286 · If “unsupported compiler option” has been incremented, enable debug
1287 logging and check which option was rejected.
1288
1289 · If “preprocessor error” has been incremented, one possible reason
1290 is that precompiled headers are being used. See PRECOMPILED HEADERS
1291 for how to remedy this.
1292
1293 · If “can’t use precompiled header” has been incremented, see
1294 PRECOMPILED HEADERS.
1295
1296 Corrupt object files
1297 It should be noted that ccache is susceptible to general storage
1298 problems. If a bad object file sneaks into the cache for some reason,
1299 it will of course stay bad. Some possible reasons for erroneous object
1300 files are bad hardware (disk drive, disk controller, memory, etc),
1301 buggy drivers or file systems, a bad prefix_command or compiler
1302 wrapper. If this happens, the easiest way of fixing it is this:
1303
1304 1. Build so that the bad object file ends up in the build tree.
1305
1306 2. Remove the bad object file from the build tree.
1307
1308 3. Rebuild with CCACHE_RECACHE set.
1309
1310 An alternative is to clear the whole cache with ccache -C if you don’t
1311 mind losing other cached results.
1312
1313 There are no reported issues about ccache producing broken object files
1314 reproducibly. That doesn’t mean it can’t happen, so if you find a
1315 repeatable case, please report it.
1316
1318 Credits, mailing list information, bug reporting instructions, source
1319 code, etc, can be found on ccache’s web site: https://ccache.dev.
1320
1322 ccache was originally written by Andrew Tridgell and is currently
1323 developed and maintained by Joel Rosdahl. See AUTHORS.txt or
1324 AUTHORS.html and https://ccache.dev/credits.html for a list of
1325 contributors.
1326
1327
1328
1329ccache 3.7.6 11/17/2019 CCACHE(1)