]> git.ipfire.org Git - thirdparty/ccache.git/log
thirdparty/ccache.git
4 years agoRemove -lgcov from profiling tests (#679) 3.7-maint
Chris Burr [Sat, 10 Oct 2020 18:00:19 +0000 (20:00 +0200)] 
Remove -lgcov from profiling tests (#679)

This fixes an issue when running the test suite with a Clang installation
without a GCC installation since libgcov then isn't found.

4 years agoPrepare for v3.7.12 v3.7.12
Joel Rosdahl [Thu, 1 Oct 2020 12:20:10 +0000 (14:20 +0200)] 
Prepare for v3.7.12

4 years agoMake “-fstack-usage” test work when $COMPILER is a masquerading ccache
Joel Rosdahl [Thu, 17 Sep 2020 10:35:11 +0000 (12:35 +0200)] 
Make “-fstack-usage” test work when $COMPILER is a masquerading ccache

(cherry picked from commit db423cffb5836e80c119bc12efa43642738ba7ef)

4 years agoUpdate NEWS
Joel Rosdahl [Thu, 1 Oct 2020 12:03:26 +0000 (14:03 +0200)] 
Update NEWS

4 years agoHandle missing .gcno file gracefully
Joel Rosdahl [Thu, 1 Oct 2020 11:00:30 +0000 (13:00 +0200)] 
Handle missing .gcno file gracefully

GCC ≥9 has changed behavior for -ftest-coverage and --coverage in
combination with -fprofile-dir=dir:

- Without -fprofile-dir=dir the file is placed next to the object file
  but with a “.gcno” extension.
- With -fprofile-dir=dir the file is also place next to the object file
  (i.e. not in the specified profile directory) but the same style of
  name as used for “.gcda” files (full pathname with slashes replaced
  with hash characters).

Fix this by:

- Checking if the expected (GCC <9) .gcno file is present. If not, fall
  back to running the compiler and increment the “unsupported option”
  counter.
- Making sure to perform the above check before copying the object file
  to the cache so that a later ccache invocation won’t believe that
  there is a result in the cache.
- Improving the copy_file routine to not create the destination file
  until it knows that there is a source file to copy from.

Fixes #674.

4 years agoFix test errors with GCC 4.4
Joel Rosdahl [Wed, 2 Sep 2020 08:53:45 +0000 (10:53 +0200)] 
Fix test errors with GCC 4.4

4 years agoIgnore Clang error about setting _FILE_OFFSET_BITS
Joel Rosdahl [Wed, 2 Sep 2020 08:20:18 +0000 (10:20 +0200)] 
Ignore Clang error about setting _FILE_OFFSET_BITS

4 years agoSet _FILE_OFFSET_BITS to 64
Joel Rosdahl [Wed, 2 Sep 2020 07:51:54 +0000 (09:51 +0200)] 
Set _FILE_OFFSET_BITS to 64

This allows for operating on large files when compiled in 32-bit mode.

Fixes #649.

4 years agoFix debug_prefix_map failure with old objdump versions
Joel Rosdahl [Tue, 1 Sep 2020 14:51:32 +0000 (16:51 +0200)] 
Fix debug_prefix_map failure with old objdump versions

“objdump -g” does not list debug info like the “Multiple
-fdebug-prefix-map” test expects when using objdump 2.20, e.g. on CentOS
6. “objdump -W” does however work, and it seems to work for object files
with compressed .debug_str section as well.

Related to issue #639.

5 years agodoc: Improve wording in “Sharing a cache on NFS”
Joel Rosdahl [Sun, 14 Jun 2020 08:43:47 +0000 (10:43 +0200)] 
doc: Improve wording in “Sharing a cache on NFS”

(cherry picked from commit 293a9c8fb1b865ed355581d5cf4f90d985c8174f)

5 years agoImprove documentation about sharing a cache on NFS (#604)
Deepak Yadav [Sun, 14 Jun 2020 08:37:08 +0000 (14:07 +0530)] 
Improve documentation about sharing a cache on NFS (#604)

(cherry picked from commit 231a151be84ab7998409b2ccbf4e7ee86082392a)

5 years agoUpdate NEWS v3.7.11
Joel Rosdahl [Tue, 21 Jul 2020 18:21:01 +0000 (20:21 +0200)] 
Update NEWS

5 years agoUse apostrophes and citation marks in NEWS.adoc consistently
Joel Rosdahl [Tue, 21 Jul 2020 18:14:38 +0000 (20:14 +0200)] 
Use apostrophes and citation marks in NEWS.adoc consistently

5 years agoAllow (require) argument to -Werror for NVCC
Joel Rosdahl [Tue, 21 Jul 2020 17:45:58 +0000 (19:45 +0200)] 
Allow (require) argument to -Werror for NVCC

Fixes #598.

5 years agoSupport NVCC’s “--Werror” option
Joel Rosdahl [Sun, 14 Jun 2020 08:55:29 +0000 (10:55 +0200)] 
Support NVCC’s “--Werror” option

(cherry picked from commit 7bfae2087a5371b6de440aa7e94cc9e00e32a018)

5 years agoHandle all Intel “-xCODE” compiler options correctly
Joel Rosdahl [Wed, 20 May 2020 19:26:35 +0000 (21:26 +0200)] 
Handle all Intel “-xCODE” compiler options correctly

“CODE” in the Intel compiler’s “-xCODE” option for specifying processor
features seems to always start with an uppercase letter, and since GCC’s
language specifications always are lowercase we can just treat uppercase
codes as an ordinary compiler argument.

(cherry picked from commit a1964c685ba111ed79f6ae10e85e1e5355068ec5)

5 years agoHandle Intel compiler option “-xHost” correctly
Joel Rosdahl [Tue, 5 May 2020 18:31:24 +0000 (20:31 +0200)] 
Handle Intel compiler option “-xHost” correctly

Fixes #587.

(cherry picked from commit 1073151532cbbd839aa3ed383a8712b1959ee81f)

5 years agoAdd knowledge about -fprofile-{correction,reorder-functions,values}
Joel Rosdahl [Tue, 21 Jul 2020 13:00:59 +0000 (15:00 +0200)] 
Add knowledge about -fprofile-{correction,reorder-functions,values}

Fixes #615.

5 years agoSkip “Directory is not hashed if using -gz[=zlib]” tests for GCC 6
Joel Rosdahl [Sun, 5 Jul 2020 18:34:54 +0000 (20:34 +0200)] 
Skip “Directory is not hashed if using -gz[=zlib]” tests for GCC 6

The GCC 6 (tested with GCC 6.3) preprocessor includes the current
working directory in the preprocessed output if run with -gz, which
means that there won’t be cache hits between directories, thus failing
the “Directory is not hashed if using -gz[=zlib]” tests. Fix this by
skipping the test if the preprocessor behaves that way.

Fixes #602.

(cherry picked from commit 8b58982dc099a5ea2bbd8abc7803a9f5a3b1148d)

5 years agoUpdate authors
Joel Rosdahl [Mon, 22 Jun 2020 18:48:46 +0000 (20:48 +0200)] 
Update authors

5 years agoUpdate NEWS v3.7.10
Joel Rosdahl [Mon, 22 Jun 2020 13:13:39 +0000 (15:13 +0200)] 
Update NEWS

5 years agoRemove win32 GetFileNameFromHandle compatibility function
Joel Rosdahl [Sun, 21 Jun 2020 19:29:04 +0000 (21:29 +0200)] 
Remove win32 GetFileNameFromHandle compatibility function

The replacement function seems to be buggy, triggering failures in
x_realpath at least when the unit tests are run in Wine. The real
GetFinalPathNameByHandle function is allegedly supported in Windows
Vista and newer, so let’s just use it.

5 years agoFix indentation
Joel Rosdahl [Sun, 21 Jun 2020 19:05:10 +0000 (21:05 +0200)] 
Fix indentation

5 years agoFix typos
Joel Rosdahl [Sun, 21 Jun 2020 18:47:44 +0000 (20:47 +0200)] 
Fix typos

5 years agoAllow the config file to be a symlink
Joel Rosdahl [Wed, 17 Jun 2020 19:40:02 +0000 (21:40 +0200)] 
Allow the config file to be a symlink

Fixes #607.

5 years agoOnly try to hard link object files to/from the cache
Joel Rosdahl [Fri, 29 May 2020 18:43:19 +0000 (20:43 +0200)] 
Only try to hard link object files to/from the cache

The compiler unlinks the destination object file before writing, but it
apparently doesn’t do that for dependency files. This means that
compilation can corrupt a .d file that shares i-node with a cached .d
file when using the hard link mode. Here is a scenario where this can
happen:

1. There is a test.c which includes test.h.
2. When test.c is compiled, the compiler writes test.d which mentions
   test.h and ccache hard links test.d into cache entry 1. test.d and
   cache entry 1's .d file now share i-nodes.
3. The include of test.h is removed from test.c.
4. When test.c is compiled again the compiler overwrites test.d with new
   content without test.h and ccache hard links test.d into cache entry
   2. test.d, cache entry 1 and cache entry 2 now share i-nodes, all of
   which contain the new content without test.h.

Since we can’t be sure how the compiler behaves for other types of files
(.dwo, .cov, etc.), only try to to hard link object files.

Fixes #599.

5 years agoAdd missing O_TRUNC when opening destination file
Joel Rosdahl [Fri, 29 May 2020 18:38:26 +0000 (20:38 +0200)] 
Add missing O_TRUNC when opening destination file

Should have been there in a16778a6243e271d501da95232cbe7c9ff58649b.

5 years agoRegister temporary compiler stdout/stderr files as pending
Joel Rosdahl [Thu, 28 May 2020 20:08:26 +0000 (22:08 +0200)] 
Register temporary compiler stdout/stderr files as pending

This avoids leaking them when a compilation is interrupted via e.g.
Ctrl+C.

5 years agoCreate parent directories if hard linking fails with ENOENT
Joel Rosdahl [Thu, 28 May 2020 20:05:54 +0000 (22:05 +0200)] 
Create parent directories if hard linking fails with ENOENT

This makes hard linking work for an empty cache structure as well.

5 years agoCopy directly from cache to destination file instead of via tmp file
Joel Rosdahl [Fri, 22 May 2020 19:16:48 +0000 (21:16 +0200)] 
Copy directly from cache to destination file instead of via tmp file

ccache copies files to the cache via a temporary file which is then
renamed into place. For simplicity reasons the same file copy function
is used when copying files from the cache as well. This however makes
ccache fail for very long destination filenames.

Fix this by introducing a “via_tmp_file” parameter to copy_file, similar
to how it works on master.

Closes #593.

5 years agoSupport clang options for compiling with sampled profiles (#589)
Olle Liljenzin [Fri, 8 May 2020 17:12:05 +0000 (19:12 +0200)] 
Support clang options for compiling with sampled profiles (#589)

Add support for -fprofile-sample-use and -fprofile-sample-accurate.

(cherry picked from commit 4b1b7d4b36c036c190831d9283f8c1e22e640e24)

5 years agoImprove handling of profiling options
Joel Rosdahl [Thu, 30 Apr 2020 06:29:31 +0000 (08:29 +0200)] 
Improve handling of profiling options

Handling of -fprofile-{generate,use}[=path] was implemented in PR #2
(2011). ccache has since then gained support for Clang, which is not
GCC-compatible for -fprofile-{generate,use}[=path]. Furthermore, GCC 9
changed the semantics of -fprofile-{generate,use}=path, making it
incompatible with ccache’s original implementation.

One crucial problem with the implementation is that there is no error
handling when the expected profiling data file cannot be found. This
means that there will be false positives cache hits for Clang and GCC
9+.

Fix this by:

* Checking for different profiling data file locations to handle
  different compilers and versions.
* Bailing out if no profiling data file can be found.

Also:

* Implemented support for Clang’s -fprofile-instr-{generate,use}[=path]
  options.
* Implemented support for -fauto-profile[=path].
* Removed the conversion of absolute path to the profile directory.
  91a2954e says that the directory is rewritten to increase the hit
  rate, but I don’t understand how that could be the case.
* Added tests for the profiling options. Exception:
  -fauto-profile[=path], since that would require running the perf tool.

Fixes #582.

5 years agoFix #559 partially (setting base_dir and cache_dir_levels) (#576)
Alexander Lanin [Mon, 6 Apr 2020 18:26:44 +0000 (20:26 +0200)] 
Fix #559 partially (setting base_dir and cache_dir_levels) (#576)

5 years agoPrepare for v3.7.9 v3.7.9
Joel Rosdahl [Sun, 29 Mar 2020 14:11:08 +0000 (16:11 +0200)] 
Prepare for v3.7.9

5 years agoRemove incorrect result check in `format`
Joel Rosdahl [Tue, 24 Mar 2020 20:33:56 +0000 (21:33 +0100)] 
Remove incorrect result check in `format`

`format` considers a zero-length result (e.g. from `format("%s", "")`)
to be a fatal error. The check originates from 0a7cea64 where it was
appropriate but become incorrect later when refactoring the original
`x_asprintf2` function to `format`.

I can’t find any call to `format` that would trigger this edge case, but
let’s remove the erroneous check anyway.

Related to #568.

5 years agoClean up backported commits slightly
Joel Rosdahl [Tue, 24 Mar 2020 19:58:39 +0000 (20:58 +0100)] 
Clean up backported commits slightly

5 years agoFix comparison with the “cu” language
Joel Rosdahl [Fri, 2 Aug 2019 18:37:57 +0000 (20:37 +0200)] 
Fix comparison with the “cu” language

This should have been done in c4fffda0.

Related to PR #381.

(cherry picked from commit 0dec5c2df3e3ebc1fbbf33f74c992bef6264f37a)

5 years agoRemove .ic extension and cuda/cuda-output languages
Joel Rosdahl [Wed, 31 Jul 2019 19:06:21 +0000 (21:06 +0200)] 
Remove .ic extension and cuda/cuda-output languages

CUDA/NVCC, at least not version 10.1, does not recognize “.ic” as a
valid extension and neither “cuda” nor “cuda-output” as languages.

Also made sure to compare with “cu” instead of “cuda” when detecting
whether to force run_second_cpp.

(cherry picked from commit c4fffda031034f930df2cf188878b8f9160027df)

5 years agotest/suites/nvcc.bash: Test -x cu and -dc options
Alexander Korsunsky [Wed, 17 Apr 2019 16:55:44 +0000 (18:55 +0200)] 
test/suites/nvcc.bash: Test -x cu and -dc options

(cherry picked from commit c4bac76687c66b1ed7c6b57c1c7d184bb0e46e17)

5 years agoWhen compiling CUDA code, recognize -dc as compilation only argument
Alexander Korsunsky [Tue, 16 Apr 2019 14:38:51 +0000 (16:38 +0200)] 
When compiling CUDA code, recognize -dc as compilation only argument

nvcc's options -dc or --device-c imply -c but also generates device
code. We catch it as an option if our guessed compiler is NVCC

(cherry picked from commit cece6046bbab113eb57018b41a679b82ff6d8f62)

5 years agoAdd cu language as an alias to cuda
Alexander Korsunsky [Tue, 16 Apr 2019 14:38:27 +0000 (16:38 +0200)] 
Add cu language as an alias to cuda

(cherry picked from commit a5e5b6dc8eae73e707d125bb3328713c4fa43892)

5 years agoImprove name of tmp file in x_unlink
Joel Rosdahl [Sun, 22 Mar 2020 13:41:44 +0000 (14:41 +0100)] 
Improve name of tmp file in x_unlink

There is no need to generate a unique temporary name in x_unlink since
we don’t care whether the temporary file is clobbered on NFS. The
previous usage of tmp_string() was not quite correct since the returned
string is supposed to be passed to mkstemp, not used as is.

5 years agoDisable hard link mode when the output object file is /dev/null
Joel Rosdahl [Sun, 22 Mar 2020 13:30:23 +0000 (14:30 +0100)] 
Disable hard link mode when the output object file is /dev/null

When hard link mode is enabled, ccache ≥3.6 unlinks the output file
before writing to it as a workaround for a bug in Clang (#331). This
unfortunately means that /dev/null will be removed when building as root
(don’t do that, BTW) with hard link mode enabled and /dev/null as the
the output file. A similar problem exists if the dependency file is
/dev/null, regardless of hard link mode.

Fix this by not unlinking the output file if it’s /dev/null and by not
copying files to /dev/null at all. (There is no need to handle other
non-regular output files since /dev/null is the only allowed non-regular
output file.)

Fixes #564.

5 years agoPrepare for v3.7.8 v3.7.8
Joel Rosdahl [Mon, 16 Mar 2020 20:58:29 +0000 (21:58 +0100)] 
Prepare for v3.7.8

5 years agowin32: Log epoch timestamp if localtime_r fails
Joel Rosdahl [Sat, 14 Mar 2020 14:55:12 +0000 (15:55 +0100)] 
win32: Log epoch timestamp if localtime_r fails

5 years agodoc: Clarify include_file_ctime sloppiness in the Performance section
Joel Rosdahl [Sat, 14 Mar 2020 09:18:53 +0000 (10:18 +0100)] 
doc: Clarify include_file_ctime sloppiness in the Performance section

5 years agoUse tmp_unlink to remove temporary file in use_relative_paths_in_depfile
Joel Rosdahl [Tue, 10 Mar 2020 18:51:39 +0000 (19:51 +0100)] 
Use tmp_unlink to remove temporary file in use_relative_paths_in_depfile

No need to remove via another temporary file.

5 years agoRewrite the Windows version of the lockfile routines
Joel Rosdahl [Wed, 26 Feb 2020 21:50:12 +0000 (22:50 +0100)] 
Rewrite the Windows version of the lockfile routines

Instead of emulating the POSIX version, use the native Windows file API
to create a lockfile. This should mitigate several problems with the old
implementation.

Hopefully fixes #537.

5 years agoCap time to sleep to 10 ms when failing to acquire a lock
Joel Rosdahl [Wed, 26 Feb 2020 21:48:31 +0000 (22:48 +0100)] 
Cap time to sleep to 10 ms when failing to acquire a lock

5 years agoFix conf_set_unknown_option unit test failure on Windows
Joel Rosdahl [Sun, 23 Feb 2020 21:26:48 +0000 (22:26 +0100)] 
Fix conf_set_unknown_option unit test failure on Windows

5 years agoAdd pch test suite probe for seemingly broken compiler support
Joel Rosdahl [Sat, 22 Feb 2020 21:18:48 +0000 (22:18 +0100)] 
Add pch test suite probe for seemingly broken compiler support

This fixes a problem mentioned by Orion Poplawski in a comment to PR #217.

(cherry picked from commit 0d06da7803c082b43cdccfcdfd56911ba4e7d458)

5 years agowin32: Fix -Werror=stringop-truncation warning in GetFileNameFromHandle
Joel Rosdahl [Sat, 22 Feb 2020 21:12:42 +0000 (22:12 +0100)] 
win32: Fix -Werror=stringop-truncation warning in GetFileNameFromHandle

5 years agowin32: Use MOVEFILE_REPLACE_EXISTING to replace file x_rename
Joel Rosdahl [Sat, 22 Feb 2020 21:04:14 +0000 (22:04 +0100)] 
win32: Use MOVEFILE_REPLACE_EXISTING to replace file x_rename

This is a partial cherry-pick of 743f35a1.

Co-authored-by: Cristian Adam <cristian.adam@gmail.com>
5 years agoUse apparent CWD when checking for CWD in preprocessed output
Joel Rosdahl [Fri, 7 Feb 2020 22:15:42 +0000 (23:15 +0100)] 
Use apparent CWD when checking for CWD in preprocessed output

Also when checking debug prefix maps.

This fixes a problem when $PWD includes a symlink part and the user has
set “hash_dir = false”.

Closes #531.

5 years agoInclude “Co-authored-by” attributions when calculating authors
Joel Rosdahl [Wed, 15 Jan 2020 21:49:23 +0000 (22:49 +0100)] 
Include “Co-authored-by” attributions when calculating authors

5 years agoMake it harder to misinterpret semantics of boolean environment settings
Joel Rosdahl [Tue, 14 Jan 2020 21:10:17 +0000 (22:10 +0100)] 
Make it harder to misinterpret semantics of boolean environment settings

Closes #502.

Co-authored-by: Steffen Dettmer <steffen.dettmer@rail.bombardier.com>
5 years agoAvoid passing compilation-only options to the preprocessor redux
Joel Rosdahl [Tue, 14 Jan 2020 20:30:29 +0000 (21:30 +0100)] 
Avoid passing compilation-only options to the preprocessor redux

25e73c1f (“Include compiler-only arguments in the hash”) attempted to
fix a regression in 5d8585b5 (“Don’t pass -Werror and compilation-only
options to the preprocessor”). It succeeded fixing the regression all
right, but it also essentially reverted the essence of 5d8585b5 (#312)
since compiler-only arguments once again are passed to the preprocessor.
Sigh.

Fix this for real and also write a test that proves it.

5 years agoPrepare for v3.7.7 v3.7.7
Joel Rosdahl [Sun, 5 Jan 2020 20:09:28 +0000 (21:09 +0100)] 
Prepare for v3.7.7

5 years agoPrepare for v3.7.7
Joel Rosdahl [Sun, 5 Jan 2020 20:09:00 +0000 (21:09 +0100)] 
Prepare for v3.7.7

5 years agoUpdate NEWS
Joel Rosdahl [Sat, 4 Jan 2020 18:24:39 +0000 (19:24 +0100)] 
Update NEWS

5 years agoMake sure to always log a “Result:” line
Joel Rosdahl [Sat, 4 Jan 2020 18:19:01 +0000 (19:19 +0100)] 
Make sure to always log a “Result:” line

Fixes #500.

A side effect of this is that read-only cache misses now will update the
“cache miss” statistics counter, which is consistent with the cache hit
cases (which already now update the counters).

5 years agoAdd tests for verifying dependency file content
Joel Rosdahl [Wed, 1 Jan 2020 21:17:11 +0000 (22:17 +0100)] 
Add tests for verifying dependency file content

5 years agoRevert "Only pass implicit -MQ to preprocessor if needed"
Joel Rosdahl [Wed, 1 Jan 2020 20:59:29 +0000 (21:59 +0100)] 
Revert "Only pass implicit -MQ to preprocessor if needed"

This reverts commit 19c3729d30640fc2c78242cb46136e619fdbd802 and also
removes the incorrect and superfluous condition that the fix fixes.

The reason for reverting is that the change introduced a nasty bug: the
dependency file will get an incorrect object file location if 1) build
directory != source directory and 2) -MF is not specified explictly by
the user.

Details: The dependency file is created by the preprocessor pass which
does not have access to the final output file name, so the preprocessor
uses the default object location derived from the source file location
instead.

Note that this partly reverts a compatibility improvement for EDG-based
compilers (see issue #460).

It should be possible to pass the dependency arguments to the compiler
instead of the preprocessor to make -MD/-MMD without -MQ work, but
that’s too risky to be done as a bug fix.

Fixes #499.

5 years agoAdd “--nocpp2” option to misc/performance
Joel Rosdahl [Wed, 1 Jan 2020 20:49:11 +0000 (21:49 +0100)] 
Add “--nocpp2” option to misc/performance

5 years agoTest .incbin detection for assembler compilation
Joel Rosdahl [Sun, 29 Dec 2019 19:06:32 +0000 (20:06 +0100)] 
Test .incbin detection for assembler compilation

5 years agoRemove the unify mode
Joel Rosdahl [Sun, 29 Dec 2019 18:21:39 +0000 (19:21 +0100)] 
Remove the unify mode

The unify mode has not received enough attention and has at least these
bugs:

1. The direct mode doesn’t work if the unify mode is enabled. This is
   because the unify mode doesn’t call into process_preprocessed_file
   which stores the paths and hashes of included files needed by the
   direct mode.
2. The .incbin directive detection has no effect when using the unify
   mode. This is again because the unify mode doesn’t use
   process_preprocessed_file which is where the .incbin detection takes
   place.
3. The unifier’s tokenizer doesn’t understand C++11 raw string literals.
4. The unifier ignores comments, but comments may have semantic meaning
   to modern compilers, e.g. “fall through” comments.

Bugs 3 and 4 are fixable by improving the unifier’s tokenization
algorithm, but since it’s a bit tricky it likely won’t be worth the
effort, especially not as a bug fix.

Bugs 1 and 2 are also fixable by unifying the two code paths, but that’s
a non-trivial effort.

In addition to the bugs, I believe that the usefullness of the unify
mode is low:

* It’s only applicable when not using -g.
* It won't be enabled for C++ unless somebody fixes bug 3.
* It can make line numbers in warning messages and __LINE__ expansions
  incorrect.
* Since comments should not be ignored, the unify mode can only make a
  difference for some types of whitespace changes, like adding or
  removing blank lines or changing a+b to a + b. (a + b is already
  normalized to a + b by the preprocessor.)

Therefore I’ll just remove the unify mode to fix the bugs.

Fixes #497.

5 years agoUpdate .mailmap
Joel Rosdahl [Mon, 2 Dec 2019 21:00:06 +0000 (22:00 +0100)] 
Update .mailmap

5 years agoImprove comments related to save_timestamp
Joel Rosdahl [Mon, 2 Dec 2019 20:58:56 +0000 (21:58 +0100)] 
Improve comments related to save_timestamp

5 years agoStore mtime/ctime as -1 if sloppy_file_stat is not set (#495)
MizuhaHimuraki [Mon, 2 Dec 2019 20:54:22 +0000 (04:54 +0800)] 
Store mtime/ctime as -1 if sloppy_file_stat is not set (#495)

As discussed in #493.

5 years agoPrepare for v3.7.6 v3.7.6
Joel Rosdahl [Sun, 17 Nov 2019 19:09:58 +0000 (20:09 +0100)] 
Prepare for v3.7.6

5 years agoUpdate NEWS
Joel Rosdahl [Sat, 16 Nov 2019 22:39:58 +0000 (23:39 +0100)] 
Update NEWS

5 years agoAlways include input file path in direct mode hash
Joel Rosdahl [Sat, 16 Nov 2019 21:59:33 +0000 (22:59 +0100)] 
Always include input file path in direct mode hash

The “file_macro sloppiness” mode is a way of opting out of inclusion of
the input file path in the direct mode hash. This can produce a false
cache hit in the following scenario:

- a/r.h exists.
- a/x.c has #include "r.h".
- b/x.c is identical to a/x.c.
- Compiling a/x.c records a/r.h in the manifest.
- Compiling b/x.c results in a false cache hit since a/x.c and b/x.c
  share manifests and a/r.h exists.

Therefore, ditch the file_macro sloppiness mode so that the input file
path is always included in the direct mode hash.

This bug has existed ever since the file_macro sloppiness was introduced
in eb5d9bd3beb5 (ccache 3.0). It has remained undetected since
compilations tend to use .d files and ccache before 3.7.5 added an
implicit “-MQ <output_file_path>” argument, thus in practice including
the output file path in the hash and therefore making manifests unique
when the object file path mirrors the source file path. However, ccache
3.7.5 no longer adds the implicit -MQ option, thus exposing the bug.

Fixes #489.

5 years agoIgnore unknown sloppiness values in configuration files
Joel Rosdahl [Sat, 16 Nov 2019 21:51:54 +0000 (22:51 +0100)] 
Ignore unknown sloppiness values in configuration files

Similar to 22db9ed893e9: This way legacy ccache versions can still work
with modern ccache configuration keys in the configuration files.

5 years agoHandle properly color diagnostics also in depend mode (#484)
Luboš Luňák [Thu, 14 Nov 2019 19:23:03 +0000 (20:23 +0100)] 
Handle properly color diagnostics also in depend mode (#484)

Compiler invocation in the depend mode uses the original arguments,
which means the added -fcolor-diagnostics (or -fdiagnostics-color)
was dropped.

(cherry picked from commit 061e57ced8abfd31d7eb41924d64e0765e806d89)

5 years agoFormat code with uncrustify
Joel Rosdahl [Sun, 10 Nov 2019 20:35:11 +0000 (21:35 +0100)] 
Format code with uncrustify

5 years agoCorrect "-MJ" bail out, identify both "-MJ file" and "-MJfile" (#486)
Thomas Otto [Sun, 10 Nov 2019 20:32:59 +0000 (21:32 +0100)] 
Correct "-MJ" bail out, identify both "-MJ file" and "-MJfile" (#486)

Also added test to detect the invalid case TOO_HARD | TAKES_CONCAT_ARG.

5 years agostats: Fix statistics update with full filesystem
Russell King [Thu, 31 Oct 2019 16:30:22 +0000 (16:30 +0000)] 
stats: Fix statistics update with full filesystem

The statistics file update does not check for write errors correctly
as stdio files are normally buffered.  This means that data can be
written to the stdio buffer but not written out until fclose().
Hence, it is imperative that the fclose() return value is also
checked.

If either fprintf() or fclose() fail, clean up the temporary file,
rather than littering the filesystem with needless temporary files.

Signed-off-by: Russell King <rmk@armlinux.org.uk>
5 years agoPrepare for v3.7.5 v3.7.5
Joel Rosdahl [Tue, 22 Oct 2019 18:48:58 +0000 (20:48 +0200)] 
Prepare for v3.7.5

5 years agoUpdate NEWS
Joel Rosdahl [Tue, 22 Oct 2019 18:16:29 +0000 (20:16 +0200)] 
Update NEWS

5 years agoFix spelling
Joel Rosdahl [Tue, 22 Oct 2019 18:16:14 +0000 (20:16 +0200)] 
Fix spelling

5 years agoFix possible NULL pointer dereference (#433)
Igor Pylypiv [Mon, 10 Jun 2019 20:52:35 +0000 (13:52 -0700)] 
Fix possible NULL pointer dereference (#433)

cppcheck:
  [src/manifest.c:270] -> [src/manifest.c:269]: (warning)
  Either the condition '!errmsg' is redundant or there is possible null pointer
  dereference: errmsg.

(cherry picked from commit 359be01b408ba4c60b968575ee6382ec5483f69f)

5 years agoPlease Clang’s -Wmissing-variable-declarations
Joel Rosdahl [Tue, 22 Oct 2019 18:29:19 +0000 (20:29 +0200)] 
Please Clang’s -Wmissing-variable-declarations

5 years agoIncrease interval for cleaning up $CCACHE_DIR/tmp to 2 days
Joel Rosdahl [Tue, 22 Oct 2019 18:04:01 +0000 (20:04 +0200)] 
Increase interval for cleaning up $CCACHE_DIR/tmp to 2 days

This will reduce problems when adjusting system time; see #480.

5 years agoDon’t fail fatally if temporary cpp_stderr file is missing
Joel Rosdahl [Mon, 21 Oct 2019 18:06:22 +0000 (20:06 +0200)] 
Don’t fail fatally if temporary cpp_stderr file is missing

If the temporary cpp_stderr file is missing when the compilation command
has finished then either some user removed it or ccache removed it in
clean_up_internal_tempdir (since the compilation took more than hour or
the system clock was adjusted?). In either case, let’s just fall back to
running the real compiler instead of failing fatally.

Fixes #480 and #154.

5 years agoFix warning during configure in out of tree build (#479)
Erik Johansson [Fri, 18 Oct 2019 17:25:44 +0000 (19:25 +0200)] 
Fix warning during configure in out of tree build (#479)

../configure: line 2250: src/version.cpp: No such file or directory

5 years agoAdd -MQ to compilation flags to make dependency files work properly
Joel Rosdahl [Sun, 13 Oct 2019 19:58:31 +0000 (21:58 +0200)] 
Add -MQ to compilation flags to make dependency files work properly

Looks like ccache’s own header dependencies have been broken since
4aa357782e48 and nobody noticed.

5 years agoImprove test case order
Joel Rosdahl [Thu, 3 Oct 2019 18:58:34 +0000 (20:58 +0200)] 
Improve test case order

5 years agoAdd support for -MF=arg as understood by EDG-based compilers
Joel Rosdahl [Thu, 3 Oct 2019 18:40:06 +0000 (20:40 +0200)] 
Add support for -MF=arg as understood by  EDG-based compilers

Closes #460.

5 years agoOnly pass implicit -MQ to preprocessor if needed
Joel Rosdahl [Thu, 3 Oct 2019 18:21:54 +0000 (20:21 +0200)] 
Only pass implicit -MQ to preprocessor if needed

This is a bug fix of 76a9959f3d3e.

5 years agoUpdate NEWS
Joel Rosdahl [Thu, 3 Oct 2019 18:15:52 +0000 (20:15 +0200)] 
Update NEWS

5 years agoDon’t crash if localtime returns null pointer in localtime_r replacement
Joel Rosdahl [Sun, 22 Sep 2019 17:46:42 +0000 (19:46 +0200)] 
Don’t crash if localtime returns null pointer in localtime_r replacement

This seems to happen in some unknown Windows environment, see #450.

Fixes #450.

5 years agoInclude compiler-only arguments in the hash
Joel Rosdahl [Tue, 17 Sep 2019 20:37:57 +0000 (22:37 +0200)] 
Include compiler-only arguments in the hash

After 5d8585b5 (#312), arguments that are not considered affecting the
preprocessor output won’t be passed to the preprocessor. -Werror and
-Wno-error are also not passed to the preprocessor so that options not
properly marked as “compiler only” will only trigger warnings, not
errors. This was a workaround for Clang complaining about unused
arguments in the preprocessor step performed by ccache.

However, it also introduced a regression: -Werror and the other options
were excluded from the hash as well. This means that

  cc -c file_with_warnings.c

would be cached by ccache, including the warning message. A later

  cc -Werror -c file_with_warnings.c

call would then be a cache hit, resulting in a compilation warning
instead of an error.

This commit fixes the problem by also including the compiler-only
arguments in the hash.

5 years agoOnly enable more warnings in dev mode when requested
Joel Rosdahl [Sun, 15 Sep 2019 19:32:50 +0000 (21:32 +0200)] 
Only enable more warnings in dev mode when requested

21ded3ae enabled “more warnings” in dev mode unconditionally, but that
doesn’t play well in dev builds with a Clang version older than the one
used in Travis-CI since the “-Wno-foo” options may be unknown. Instead
of doing feature tests for those options, just enable “more warnings”
when --enable-more-warnings is specified and specify it for Travis-CI
builds.

5 years agoPrepare for v3.7.4 v3.7.4
Joel Rosdahl [Thu, 12 Sep 2019 19:14:09 +0000 (21:14 +0200)] 
Prepare for v3.7.4

5 years agoUpdate NEWS
Joel Rosdahl [Thu, 12 Sep 2019 19:14:06 +0000 (21:14 +0200)] 
Update NEWS

5 years agoSupport GCC 9’s -gz=[type] option
Joel Rosdahl [Thu, 12 Sep 2019 18:50:46 +0000 (20:50 +0200)] 
Support GCC 9’s -gz=[type] option

-gz[=type] neither disables nor enables generation of debug info, so
don’t enable the fallback behavior of hashing the current directory when
seeing -gz[=type] alone.

Closes #464.

5 years agoWin32: make_relative_path also accept /c/users (#455)
Cristian Adam [Wed, 28 Aug 2019 17:07:21 +0000 (19:07 +0200)] 
Win32: make_relative_path also accept /c/users (#455)

Patch copied from jd-gascuel@f3b85c9

(cherry picked from commit 1fa9f0c8130177578020cdb89b9c93792f42400e)

5 years agoPrepare for v3.7.3 v3.7.3
Joel Rosdahl [Sat, 17 Aug 2019 20:07:43 +0000 (22:07 +0200)] 
Prepare for v3.7.3

5 years agoUpdate NEWS
Joel Rosdahl [Sat, 17 Aug 2019 19:59:53 +0000 (21:59 +0200)] 
Update NEWS

5 years agoFix typo in NEWS
Joel Rosdahl [Fri, 16 Aug 2019 17:27:20 +0000 (19:27 +0200)] 
Fix typo in NEWS