]> git.ipfire.org Git - thirdparty/ccache.git/log
thirdparty/ccache.git
4 years agoDocument the new directory structure plan
Joel Rosdahl [Tue, 15 Jun 2021 18:53:15 +0000 (20:53 +0200)] 
Document the new directory structure plan

See also #660 and #753.

4 years agoRemove now mostly obsolete note about transitioning to C++
Joel Rosdahl [Tue, 15 Jun 2021 18:20:01 +0000 (20:20 +0200)] 
Remove now mostly obsolete note about transitioning to C++

4 years agoTest Clang 11 in CI
Joel Rosdahl [Tue, 15 Jun 2021 05:50:01 +0000 (07:50 +0200)] 
Test Clang 11 in CI

4 years agoRemove Ubuntu 16.04 from CI
Joel Rosdahl [Tue, 15 Jun 2021 05:44:34 +0000 (07:44 +0200)] 
Remove Ubuntu 16.04 from CI

Ubuntu 16.04 has reached end of life already and GitHub Actions will
drop support for it soon anyway.

4 years agoRefactor away Result::Writer knowledge about counter_updates
Joel Rosdahl [Sun, 13 Jun 2021 18:41:32 +0000 (20:41 +0200)] 
Refactor away Result::Writer knowledge about counter_updates

4 years agoAdd nonstd::expected 0.5.0
Joel Rosdahl [Sun, 13 Jun 2021 18:21:05 +0000 (20:21 +0200)] 
Add nonstd::expected 0.5.0

4 years agoSilence stray printout from "-P -c" test case
Joel Rosdahl [Sun, 13 Jun 2021 18:43:03 +0000 (20:43 +0200)] 
Silence stray printout from "-P -c" test case

4 years agoAdd missing MTR_BEGIN call for file/file_put
Joel Rosdahl [Sat, 12 Jun 2021 08:13:06 +0000 (10:13 +0200)] 
Add missing MTR_BEGIN call for file/file_put

4 years agodoc: Switch to common AsciiDoc heading syntax
Joel Rosdahl [Mon, 7 Jun 2021 18:29:16 +0000 (20:29 +0200)] 
doc: Switch to common AsciiDoc heading syntax

4 years agoInclude config.h via command line instead of via system.h
Joel Rosdahl [Sun, 30 May 2021 18:40:35 +0000 (20:40 +0200)] 
Include config.h via command line instead of via system.h

This makes the definitions in config.h available to all source code,
including third_party_lib. It’s also a first step towards not having to
include system.hpp and its libc headers from all files.

4 years agoImprove defines for third_party_lib
Joel Rosdahl [Sun, 30 May 2021 18:20:07 +0000 (20:20 +0200)] 
Improve defines for third_party_lib

- Don’t filter out useful warnings like warning about implicit function
  declarations.
- Apply definitions in config.h to third party source code instead of
  passing feature defines as a special case.

4 years agoEnable minitrace tracing and stop it from crashing (#852)
Anders Björklund [Sun, 30 May 2021 18:18:58 +0000 (20:18 +0200)] 
Enable minitrace tracing and stop it from crashing (#852)

Need to make sure to pass the -DMTR_ENABLED also when compiling
the library and not only in the ccache internal config.h file.

When setting a standard (like C99), also need to define features.
The "strdup" function requires macro: _POSIX_C_SOURCE >= 200809L

4 years agoAdd support for clang's --config option (#850)
Tom Stellard [Sun, 23 May 2021 12:28:15 +0000 (08:28 -0400)] 
Add support for clang's --config option (#850)

This is more or less equivalent to gcc's --specs option except that the
contents of the file have different syntaxes.

4 years agoUpgrade to zstd 1.5.0
Joel Rosdahl [Fri, 14 May 2021 18:11:23 +0000 (20:11 +0200)] 
Upgrade to zstd 1.5.0

4 years agoFix typo in NEWS
Joel Rosdahl [Sun, 9 May 2021 18:49:42 +0000 (20:49 +0200)] 
Fix typo in NEWS

4 years agoFix typo in NEWS
Joel Rosdahl [Sun, 9 May 2021 18:48:38 +0000 (20:48 +0200)] 
Fix typo in NEWS

4 years agoUpdate NEWS v4.3
Joel Rosdahl [Sun, 9 May 2021 18:39:46 +0000 (20:39 +0200)] 
Update NEWS

4 years agoRe-add clang-format off/on for formatting bug
Joel Rosdahl [Sun, 9 May 2021 18:39:15 +0000 (20:39 +0200)] 
Re-add clang-format off/on for formatting bug

4 years agoImprove checksumming of downloaded clang-format binary
Joel Rosdahl [Sun, 9 May 2021 18:35:06 +0000 (20:35 +0200)] 
Improve checksumming of downloaded clang-format binary

4 years agoUpdate authors
Joel Rosdahl [Sun, 9 May 2021 13:15:28 +0000 (15:15 +0200)] 
Update authors

4 years agoUpdate .mailmap
Joel Rosdahl [Sun, 9 May 2021 13:15:15 +0000 (15:15 +0200)] 
Update .mailmap

4 years agoFix documentation of ivfsoverlay sloppiness
Joel Rosdahl [Sun, 9 May 2021 11:59:17 +0000 (13:59 +0200)] 
Fix documentation of ivfsoverlay sloppiness

4 years agoQuote CMake variables expansions in `CIBuildType.cmake`
Joel Rosdahl [Sun, 9 May 2021 10:49:09 +0000 (12:49 +0200)] 
Quote CMake variables expansions in `CIBuildType.cmake`

This avoids CMake errors when `${CMAKE_C_FLAGS_CI}` or
`${CMAKE_CXX_FLAGS_CI}` expands to the empty string.

Fixes #846.

4 years agoTweak comment
Joel Rosdahl [Sat, 8 May 2021 17:14:13 +0000 (19:14 +0200)] 
Tweak comment

4 years agoRevert "ci: Fix build on Ubuntu 16.04"
Joel Rosdahl [Sat, 8 May 2021 15:42:04 +0000 (17:42 +0200)] 
Revert "ci: Fix build on Ubuntu 16.04"

This reverts commit aa7fd27609bea5ec78fd85afaec297d028119ee0.

GitLab has apparently reverted its changes to the Ubuntu 16.04
environment again.

4 years agoInclude object path in input hash for -fprofile-arcs (--coverage)
Joel Rosdahl [Sat, 8 May 2021 14:47:22 +0000 (16:47 +0200)] 
Include object path in input hash for -fprofile-arcs (--coverage)

The object file contains a .gcda path based on the object file path.

Fixes #845.

4 years agoImprove comment
Joel Rosdahl [Sat, 8 May 2021 14:46:56 +0000 (16:46 +0200)] 
Improve comment

4 years agosource formatting: Don’t bin pack constructor initializer lists
Joel Rosdahl [Mon, 3 May 2021 17:08:56 +0000 (19:08 +0200)] 
source formatting: Don’t bin pack constructor initializer lists

4 years agoSupport `-specs file.specs` and `--specs file.specs` (#843)
Josh Triplett [Mon, 3 May 2021 17:00:19 +0000 (10:00 -0700)] 
Support `-specs file.specs` and `--specs file.specs` (#843)

* Support `-specs file.specs` and `--specs file.specs`

ccache currently supports specs files supplied via `-specs=file.specs`
and `--specs=file.specs`, but using a space instead of an `=` will cause
ccache to error out on the subsequent .specs file with
"unsupported source language".

Add support for `-specs file.specs` and `--specs file.specs`.

4 years agoCMake: make build of documentation optional (#842)
Petr Štetiar [Mon, 3 May 2021 16:44:53 +0000 (18:44 +0200)] 
CMake: make build of documentation optional (#842)

So we don't need to support corner cases as for example one fixed in
commit f6202db308e3 ("doc/MANUAL.adoc: Don't use non-ASCII quotes
(#761)") when the documentation is actually not needed at all as ccache
is used as a build tool only.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years agoFix detection of pthread features (#840)
Olle Liljenzin [Wed, 28 Apr 2021 18:22:53 +0000 (20:22 +0200)] 
Fix detection of pthread features (#840)

Add the -pthread flag to the compiler when building the test
program. Otherwise the compiler will build with wrong defines.

Fixes failing unit tests in Ubuntu 18.04.

4 years agoIgnore -ivfsoverlay parameter (#839)
Yoshimasa Niwa [Wed, 28 Apr 2021 18:20:35 +0000 (11:20 -0700)] 
Ignore -ivfsoverlay parameter (#839)

Co-authored-by: Peter Steinberger <steipete@gmail.com>
4 years agoci: Fix build on Ubuntu 16.04
Joel Rosdahl [Tue, 27 Apr 2021 20:04:58 +0000 (22:04 +0200)] 
ci: Fix build on Ubuntu 16.04

For some reason libzstd1-dev now has broken dependencies in GitLab’s
Ubuntu 16.04 environment. Fix this by installing libzstd-dev instead.

See also 59202ffbe57cc81679c02abafd2222819e4bde41.

4 years agoFix AsciiDoc markup in NEWS
Joel Rosdahl [Wed, 21 Apr 2021 19:18:38 +0000 (21:18 +0200)] 
Fix AsciiDoc markup in NEWS

4 years agoCanonicalize header path earlier to improve performance (#838)
binli71 [Sat, 17 Apr 2021 09:11:58 +0000 (05:11 -0400)] 
Canonicalize header path earlier to improve performance (#838)

The ctx.included_files.find(path) check was done before removing the "./" prefix
from the path, leading to decreased performance for such headers since the check
would always fail for such paths.

5 years agoImprove statistics for “-P -E”
Joel Rosdahl [Tue, 13 Apr 2021 06:45:09 +0000 (08:45 +0200)] 
Improve statistics for “-P -E”

“-P” is currently considered too hard, so when it’s used in conjunction
with “-E” the “unsupported compiler option” statistics counter is
increased since “-P” is found before “-E” on the command line.

Improve this by not passing “-P” to the preprocessor so that’s it’s in
effect supported. “-P -E” will then instead bail out on “-E”, increasing
“called for preprocessing” instead.

Closes #812.

5 years agoDisable split-dwarf code paths when outputting to /dev/null
Joel Rosdahl [Mon, 5 Apr 2021 17:12:10 +0000 (19:12 +0200)] 
Disable split-dwarf code paths when outputting to /dev/null

This avoids an attempt to delete /dev/null.dwo, which is harmless but
apparently flagged by the sandboxing feature of Gentoo’s build system.

Fixes #833.

5 years agoUse Clang-Format executable from muttleyxd/clang-tools-static-binaries
Joel Rosdahl [Mon, 5 Apr 2021 11:19:19 +0000 (13:19 +0200)] 
Use Clang-Format executable from muttleyxd/clang-tools-static-binaries

misc/format-files now executes misc/clang-format, which works like this:

1. If environment variable CLANG_FORMAT is set, execute $CLANG_FORMAT.
2. Otherwise, if <ccache-top-dir>/misc/.clang-format-exe exists, execute
   that program.
3. Otherwise, download a statically linked clang-format executable,
   verify its integrity, place it in
   <ccache-top-dir>/misc/.clang-format-exe and execute it.

This makes it possible for us to lock Clang-Format to version 10 and
remove most “// clang-format off/on” comments.

5 years agoMerge pull request #832 from nickhutchinson/win-stat-pending-delete
Joel Rosdahl [Mon, 5 Apr 2021 08:43:19 +0000 (10:43 +0200)] 
Merge pull request #832 from nickhutchinson/win-stat-pending-delete

5 years agoStat: treat pending deletes as missing files on Windows 832/head
Nicholas Hutchinson [Sun, 4 Apr 2021 15:44:43 +0000 (16:44 +0100)] 
Stat: treat pending deletes as missing files on Windows

Win32 functions like `CreateFile` return `ERROR_ACCESS_DENIED` when a
file is in the process of being deleted, which gets mapped to an errno
of `EACCES`. For the purposes of `Stat::stat` and `Stat::lstat`, it's
more useful to treat this as a missing file and mapping this to an errno
of `ENOENT`.

5 years agoFix clang-tidy job
Nicholas Hutchinson [Sun, 4 Apr 2021 16:01:19 +0000 (17:01 +0100)] 
Fix clang-tidy job

Explicitly specify versions of clang, clang++ and clang-tidy so we don't
run with mismatched versions.

GitHub seems to have recently bumped the version of clang installed in
its Ubuntu 18.04 runners to version 9, and aliased it to
`/usr/bin/clang` / `/usr/bin/clang++`. But running `apt-get install
clang-tidy` would install an older version of clang-tidy from LLVM _6.0_
at `/usr/bin/clang-tidy`.

See: https://github.com/actions/virtual-environments/blob/main/images/linux/Ubuntu1804-README.md

5 years agoPrepare for v4.2.1 v4.2.1
Joel Rosdahl [Sat, 27 Mar 2021 18:41:08 +0000 (19:41 +0100)] 
Prepare for v4.2.1

5 years agoUpdate authors
Joel Rosdahl [Sat, 27 Mar 2021 18:30:13 +0000 (19:30 +0100)] 
Update authors

5 years agoSimplify linker probing
Joel Rosdahl [Sat, 27 Mar 2021 17:30:54 +0000 (18:30 +0100)] 
Simplify linker probing

5 years agoFix probing of faster linker when cross compiling
Joel Rosdahl [Sat, 27 Mar 2021 15:10:31 +0000 (16:10 +0100)] 
Fix probing of faster linker when cross compiling

5 years agoUpdate NEWS
Joel Rosdahl [Sat, 27 Mar 2021 15:02:42 +0000 (16:02 +0100)] 
Update NEWS

5 years agoProbe for working faster linker
Joel Rosdahl [Sat, 27 Mar 2021 13:28:13 +0000 (14:28 +0100)] 
Probe for working faster linker

As noted by Nicholas Hutchinson in #794, the availability of a linker
program is not enough to conclude that it works for some older compilers
and platforms like macOS and Windows.

Improve this by probing if it works to pass “-fuse-ld=$LINKER”.

5 years agoFix fast linker selection
Joel Rosdahl [Mon, 22 Mar 2021 17:57:16 +0000 (18:57 +0100)] 
Fix fast linker selection

This partially reverts commit 6b552a3247e285dd5a4b1c21b3afc3f38ce68161.

As noted in #788, the fix in 6b552a32 doesn’t work. However, I can’t
reproduce any problems with the original solution so let’s revert back
to it.

Fixes #794.

5 years agoClean up slightly after ea433578
Joel Rosdahl [Sat, 20 Mar 2021 19:07:43 +0000 (20:07 +0100)] 
Clean up slightly after ea433578

5 years agoChanged zstd url back to http (#830)
Abubakar Nur Khalil [Fri, 26 Mar 2021 07:33:01 +0000 (08:33 +0100)] 
Changed zstd url back to http (#830)

It looks like https://zstd.net isn't working anymore, however, http://zstd.net
works and simply redirects to https://facebook.github.io/zstd/ which is served
through https.

This change essentially reverts a single change from commit
a0f32f161f1b8b9c5d287ca8abe88e3fd1e940a2 where the zstd URL was changed from
http to https.

5 years agoUpdate doctest license info
Joel Rosdahl [Mon, 22 Mar 2021 17:37:28 +0000 (18:37 +0100)] 
Update doctest license info

5 years agoUpgrade to doctest 2.4.6
Joel Rosdahl [Mon, 22 Mar 2021 17:36:03 +0000 (18:36 +0100)] 
Upgrade to doctest 2.4.6

Closes #825.

5 years agodoc: Fix references to the extra_files_to_hash configuration option
Joel Rosdahl [Sun, 21 Mar 2021 20:22:47 +0000 (21:22 +0100)] 
doc: Fix references to the extra_files_to_hash configuration option

5 years agowin32: Fix handling of long command lines (#816)
Aleksander Salwa [Sat, 20 Mar 2021 18:55:54 +0000 (19:55 +0100)] 
win32: Fix handling of long command lines (#816)

What is broken: handling of "execute" with long command parameters (see win32execute).

In more details:

* parameter lpCommandLine was formatted incorrectly (it has to contain app name too)
* temporary file with parameters to the compiler was formatted incorrectly (it
  should NOT contain app name; if it contains backslashes, then these
  backslashes need to be escaped as double-backslashes)
* wrong location (directory) of temporary files in win32execute
* premature deletion of temporary files in win32execute

5 years agoImplement a better Stat::stat(), Stat::lstat() for Windows (#819)
Nicholas Hutchinson [Thu, 18 Mar 2021 20:31:04 +0000 (20:31 +0000)] 
Implement a better Stat::stat(), Stat::lstat() for Windows (#819)

`stat()` as implemented in msvcrt.dll (used by mingw-w64) has a number
of flaws:
- `st_ino` is always 0
- other file attributes are queried from the parent directory instead of
  the file itself, and so can be incorrect/stale, e.g. if a file is
  modified via another hard link.

The implementation in the UCRT is slightly better -- it prefers to query
attributes from the file itself if possible, but it still doesn't
populate `st_ino` and can silently fall back to querying from the parent
directory and giving stale results.

I don't believe the msvcrt.dll source is available (you have to infer
its behaviour from e.g. Process Monitor) but the ucrtbase.dll source
code is available in the Windows 10 SDK.

Write an implementation of `stat`/`lstat` that sidesteps these issues by
using Win32 APIs to query file information. A few implementation notes:

- We do not fall back to querying the parent directory (as the UCRT
  `stat()` implementation and [Python's `stat()`][1] do) if we can't get
  a handle to the actual file. If we don't have `FILE_READ_ATTRIBUTES`
  permissions, we fail with `EACCES` instead of returning
  incomplete/stale results fetched from the parent directory.
- Windows-specific `Stat::file_attributes()` / `Stat::reparse_tag()`
  added to provide the Win32 file attributes and file reparse tag.
- `lstat()` sets the `S_IFLNK` bit in `st_mode` for symlinks. On
  Windows, there are other symlink-like things ("name surrogate reparse
  points") such as directory junctions and mountpoints. To identify
  these, the caller can check the reparse tag to identify a directory
  junction/mountpoint.
- We use Python's mapping of Win32 error codes to C errno.

[1]: https://github.com/python/cpython/blob/6086ae7fd4aeb4089282189673f9bd0cc33abf9b/Modules/posixmodule.c#L1884

5 years agoBail out on too hard Clang option -gen-cdb-fragment-path
Joel Rosdahl [Thu, 18 Mar 2021 19:29:24 +0000 (20:29 +0100)] 
Bail out on too hard Clang option -gen-cdb-fragment-path

5 years agoOnly reject -f(no-)color-diagnostics for known GCC compiler
Joel Rosdahl [Sat, 13 Mar 2021 12:26:03 +0000 (13:26 +0100)] 
Only reject -f(no-)color-diagnostics for known GCC compiler

61ce8c44 made it so that ccache rejects -f(no-)color-diagnostics early
for non-Clang compilers. This was needed to avoid false cache hits for
the GCC case, but it had the side effect of rejecting
-fcolor-diagnostics for unknown compilers as well, such as for a
compiler named c++ that in reality is clang++ (which actually accepts
-f(no-)color-diagnostics).

Fix this by simply doing the special case for GCC instead of non-Clang.
This is OK since the speculative handling of color diagnostics options
is only done for GCC and Clang, not for other compiler types.

Fixes #806.

5 years agoClean up slightly after #814
Joel Rosdahl [Sun, 7 Mar 2021 13:15:28 +0000 (14:15 +0100)] 
Clean up slightly after #814

5 years agoUpgrade to doctest 2.4.5
Joel Rosdahl [Sat, 6 Mar 2021 18:16:28 +0000 (19:16 +0100)] 
Upgrade to doctest 2.4.5

5 years agoUpgrade to zstd 1.4.9
Joel Rosdahl [Sat, 6 Mar 2021 18:11:26 +0000 (19:11 +0100)] 
Upgrade to zstd 1.4.9

5 years agotest: Print line number of failing assert (#814)
Thomas Otto [Sun, 7 Mar 2021 13:14:39 +0000 (14:14 +0100)] 
test: Print line number of failing assert (#814)

5 years agobuild: Don't enable ccache when building with MSVC (#813)
Nicholas Hutchinson [Sun, 7 Mar 2021 13:09:47 +0000 (13:09 +0000)] 
build: Don't enable ccache when building with MSVC (#813)

5 years agoFix "Debug option" test (#807)
pawelkrysiak [Sat, 6 Mar 2021 18:10:34 +0000 (19:10 +0100)] 
Fix "Debug option" test (#807)

5 years agodoc: Fix formatting of debug_dir documentation
Joel Rosdahl [Sat, 6 Mar 2021 18:06:50 +0000 (19:06 +0100)] 
doc: Fix formatting of debug_dir documentation

5 years agoEnforce cpp2 mode on macOS if -g is given
Joel Rosdahl [Fri, 5 Mar 2021 19:37:51 +0000 (20:37 +0100)] 
Enforce cpp2 mode on macOS if -g is given

Newer Clang versions on macOS apparently produce different debug
information when compiling preprocessed code.

As mentioned in issue #807.

5 years agoci: Fix build on Ubuntu 18.04
Joel Rosdahl [Fri, 5 Mar 2021 06:13:53 +0000 (07:13 +0100)] 
ci: Fix build on Ubuntu 18.04

For some reason libzstd1-dev now has broken dependencies in GitLab’s
Ubuntu 18.04 environment. Fix this by installing libzstd-dev instead.

5 years agodoc: Fix formatting of debug_dir documentation
Joel Rosdahl [Thu, 4 Mar 2021 20:52:35 +0000 (21:52 +0100)] 
doc: Fix formatting of debug_dir documentation

5 years agoWrite debug log file in most argument processing error scenarios
Joel Rosdahl [Thu, 4 Mar 2021 20:34:07 +0000 (21:34 +0100)] 
Write debug log file in most argument processing error scenarios

When the debug mode is enabled, ccache writes the log to
<objectfile>.ccache-log, but that can only be done if the object file
location has been determined. If an unsupported compiler option is
detected, ccache exits early and may not yet have determined the output
object filename.

Fix this by parsing all compiler options, then determining the object
file location and only then return an error from the process_args
function with. This will in practice make the debug mode work for most
invocations. There are still edge cases where it won’t work or will be
potentially confusing, for instance these:

    ccache gcc -dumpspecs
    ccache gcc -c nonexistent.c
    ccache gcc -c foo.c bar.c

Naturally, no debug log file will be written in the first case. In the
second case no debug log file will be written either since ccache
doesn’t consider a nonexistent file to be an input file. In the third
case the debug log file will be written foo.o.ccache-log but not
bar.o.ccache-log.

As mentioned in issue #806.

5 years agoFix Util::read_file truncating files if size_hint is an underestimate (#808)
Nicholas Hutchinson [Wed, 24 Feb 2021 19:32:20 +0000 (19:32 +0000)] 
Fix Util::read_file truncating files if size_hint is an underestimate (#808)

If the size_hint passed to read_file was an underestimate, or the
platform's `stat()` implementation gives an inaccurate file size (e.g.
MinGW) then `Util::read_file()` would only issue a single `read()` call
instead of reading the entire file.

Fixes #803.

5 years agoSupport building ccache with xlclang++ on AIX 7.2 (#805)
Jon Petrissans [Wed, 24 Feb 2021 19:13:19 +0000 (21:13 +0200)] 
Support building ccache with xlclang++ on AIX 7.2 (#805)

- Update of config.h.in to build with xlclang++ on AIX 7.2
- Little fixes in code chunks never built on usual platforms

5 years agoHandle -frecord-gcc-switches correctly
Joel Rosdahl [Tue, 23 Feb 2021 20:11:58 +0000 (21:11 +0100)] 
Handle -frecord-gcc-switches correctly

-frecord-gcc-switches records the full command line in the object file,
so include the original command line in the hash as suggested by
Lawrence Chan.

Fixes #804.

5 years agodoc: Fix markup of compiler type “other”
Joel Rosdahl [Mon, 22 Feb 2021 17:53:16 +0000 (18:53 +0100)] 
doc: Fix markup of compiler type “other”

5 years agoSupport -fcolor-diagnostics passed to cc1 with -Xclang (#802)
Evangelos Foutras [Tue, 23 Feb 2021 19:41:15 +0000 (21:41 +0200)] 
Support -fcolor-diagnostics passed to cc1 with -Xclang (#802)

Before this change `clang++ -Xclang -fcolor-diagnostics -c foo.cc`
would result in diagnostics without color if stderr was not a TTY.

Fixes #801.

5 years agoStdAtomic.cmake: Probe atomic increment as well (#800)
Sergei Trofimovich [Wed, 17 Feb 2021 19:49:06 +0000 (19:49 +0000)] 
StdAtomic.cmake: Probe atomic increment as well (#800)

On sparc there are 8-byte atomic loads and stores available in ISA
but not atomic increments. As a result linking fails as:

```
ld: src/libccache_lib.a(InodeCache.cpp.o):
    undefined reference to symbol '__atomic_fetch_add_8@@LIBATOMIC_1.0'
ld: sparc-unknown-linux-gnu/8.2.0/libatomic.so.1:
    error adding symbols: DSO missing from command line
```

The fix is to add increment into libatomic test.
tested on `sparc-unknown-linux-gnu` target.

Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
5 years agoTweak passing of magic bytes to please GitHub CodeQL
Joel Rosdahl [Wed, 17 Feb 2021 19:27:50 +0000 (20:27 +0100)] 
Tweak passing of magic bytes to please GitHub CodeQL

5 years agoConvert trivial switch statement to if statement
Joel Rosdahl [Sun, 14 Feb 2021 19:34:14 +0000 (20:34 +0100)] 
Convert trivial switch statement to if statement

5 years agoOnly dup2 stderr into $UNCACHED_ERR_FD for preprocessor/compiler
Joel Rosdahl [Sun, 7 Feb 2021 12:32:26 +0000 (13:32 +0100)] 
Only dup2 stderr into $UNCACHED_ERR_FD for preprocessor/compiler

Ccache dup2s the stderr FD and publishes the resulting FD number in
$UNCACHED_ERR_FD for usage by e.g. distcc. This is done any executed
child process.

As noted by Sam Varshavchik on the ccache mailing list, this leads to an
unfortunate and complex problem in combination with GNU Make, LTO
linking and the Linux PTY driver:

    https://www.mail-archive.com/ccache@lists.samba.org/msg01516.html

Since UNCACHED_ERR_FD is only relevant when running the preprocessor or
compiler, let’s only dup2 stderr when executing those, i.e. not when
falling back to just running the wrapped command such as the linker.

5 years agoUse existing CMake “message()” level
Joel Rosdahl [Tue, 2 Feb 2021 07:59:49 +0000 (08:59 +0100)] 
Use existing CMake “message()” level

5 years agoAdd missing word in news item
Joel Rosdahl [Tue, 2 Feb 2021 06:28:35 +0000 (07:28 +0100)] 
Add missing word in news item

5 years agoPrepare for v4.2 v4.2
Joel Rosdahl [Tue, 2 Feb 2021 06:14:37 +0000 (07:14 +0100)] 
Prepare for v4.2

5 years agoUpdate news
Joel Rosdahl [Tue, 2 Feb 2021 06:14:25 +0000 (07:14 +0100)] 
Update news

5 years agoUse full path to env program
Joel Rosdahl [Mon, 1 Feb 2021 21:00:25 +0000 (22:00 +0100)] 
Use full path to env program

Minor improvement of 68d8481c.

5 years agoUpdate NEWS
Joel Rosdahl [Sat, 30 Jan 2021 18:58:15 +0000 (19:58 +0100)] 
Update NEWS

5 years agoImprove handling of SOURCE_DATE_EPOCH
Joel Rosdahl [Sat, 30 Jan 2021 18:35:54 +0000 (19:35 +0100)] 
Improve handling of SOURCE_DATE_EPOCH

PR #755 (be1ed774) made it so that the value of SOURCE_DATE_EPOCH is
ignored if time_macros sloppiness is set. A downside of this is
naturally that the user has to set sloppiness if SOURCE_DATE_EPOCH is
set in the environment.

Insight: SOURCE_DATE_EPOCH actually only ever changes the result if the
source code contains __DATE__. __TIME__ is not an issue since ccache
disables the direct mode if __TIME__is present and the preprocessor mode
will then see the actual expansion regardless of any SOURCE_DATE_EPOCH
value. Finally, the __TIMESTAMP__ case is not applicable at all since
it’s not affected by SOURCE_DATE_EPOCH.

Therefore, make sure to only hash SOURCE_DATE_EPOCH if we find __DATE__.
The user then does not have to set sloppiness to get direct mode hits
for files that don’t contain __DATE__.

5 years agoSort test suites
Joel Rosdahl [Sat, 30 Jan 2021 18:45:34 +0000 (19:45 +0100)] 
Sort test suites

5 years agoImprove comments in UseCcache.cmake
Joel Rosdahl [Sat, 30 Jan 2021 18:22:27 +0000 (19:22 +0100)] 
Improve comments in UseCcache.cmake

5 years agoImprove speed of compiler launcher command in UseCcache.cmake
Joel Rosdahl [Sat, 30 Jan 2021 18:17:33 +0000 (19:17 +0100)] 
Improve speed of compiler launcher command in UseCcache.cmake

I noticed that the overhead of “cmake -E env” is around 9 ms on my
system. This means that ccache direct mode hits on average have become
twice as slow when building ccache itself on my system.

Improve this by using the standard “env” program if available. Its
overhead is around 1 ms.

5 years agoUse snake case for CMake variable names
Joel Rosdahl [Sat, 30 Jan 2021 18:15:08 +0000 (19:15 +0100)] 
Use snake case for CMake variable names

5 years agoImprove emoji for questions/discussions in GitHub issue type list
Joel Rosdahl [Sat, 30 Jan 2021 13:36:46 +0000 (14:36 +0100)] 
Improve emoji for questions/discussions in GitHub issue type list

5 years agoUpdate authors
Joel Rosdahl [Sat, 30 Jan 2021 12:52:30 +0000 (13:52 +0100)] 
Update authors

5 years agoAdd Ka Ho Ng to .mailmap
Joel Rosdahl [Sat, 30 Jan 2021 12:51:24 +0000 (13:51 +0100)] 
Add Ka Ho Ng to .mailmap

5 years agoDisable inode cache on OSes without pthread_mutexattr_setpshared() (#791)
Stuart Henderson [Mon, 25 Jan 2021 18:41:54 +0000 (18:41 +0000)] 
Disable inode cache on OSes without pthread_mutexattr_setpshared() (#791)

The inode cache requires pthread_mutexattr_setpshared() and build fails on OSes
with sys/mman.h that do not have this function.

5 years agoCI: Skip homebrew update/cleanup on macOS (#790)
Nicholas Hutchinson [Mon, 25 Jan 2021 18:37:54 +0000 (18:37 +0000)] 
CI: Skip homebrew update/cleanup on macOS (#790)

The auto cleanup step that runs after `brew install` can can often add a
few minutes to each macOS CI run.

5 years agotests: Improve COFF object file comparison (#789)
Nicholas Hutchinson [Mon, 25 Jan 2021 18:37:07 +0000 (18:37 +0000)] 
tests: Improve COFF object file comparison (#789)

Make `is_equal_object_files` more lenient when comparing COFF object
files.

COFF object files contain the original source file name, which was
breaking the cpp1 test. They often contain a timestamp used by the
incremental linker, unless this is explicitly disabled via `/Brepro`
(MSVC) or `-mno-incremental-linker-compatible` (clang).

5 years agoFix fast linker selection for old GCC versions (#788)
Alexander Lanin [Mon, 25 Jan 2021 06:51:10 +0000 (07:51 +0100)] 
Fix fast linker selection for old GCC versions (#788)

5 years agoBlake3 build (#781)
Erik Flodin [Tue, 19 Jan 2021 20:33:25 +0000 (21:33 +0100)] 
Blake3 build (#781)

* Build the blake3 asm files to determine if they are supported

Building the files doesn't take long and gives a better result than just
checking that the assembler accepts a flag.

See also #768.

* Remove no longer used cmake function

* Update BLAKE3 to 3a8204f5f (0.3.7 + minor fixes) and include all MSVC asm files

* Try to improve blake3 on MSVC by using asm version

5 years agoTest suite fixes and improvements for Windows (#780)
Nicholas Hutchinson [Tue, 19 Jan 2021 20:27:00 +0000 (20:27 +0000)] 
Test suite fixes and improvements for Windows (#780)

* Tests: properly handle compiler arguments from CC environment variable

* Tests: don't pass test names directly to printf

In some cases test names would be interpreted as invalid arguments to
`printf` instead of a string to be printed, and this resulted in
confusing output on test failure.

* Tests: enable symlink support on Windows

git-bash's `ln -s` defaults to making a copy instead of making a symlink
for compatibility, but it is possible to ask for native Windows symlink
support instead.

Creating symlinks on Windows requires suitable permissions, or that
"Developer Mode" is enabled. (This is true for the Github Actions
Windows runners.)

* Tests: performance fixes for Windows

On Windows, git-bash's emulation of fork/exec is exteremely slow -- on
my machine it's typically around 30ms to spawn /usr/bin/true from a bash
script compared to 2ms on my macOS machine.

This is really noticeable when running ccache tests. This patch fixes
some of the hot code (i.e. code invoked for every test case) to avoid
spawning external commands or creating as many subshells.

* Tests: get more tests passing on Windows

- account for \r\n line endings in --version test
- skip tests that can never succeed on Windows

5 years agoRefer people to discussions for support
Joel Rosdahl [Tue, 19 Jan 2021 18:54:54 +0000 (19:54 +0100)] 
Refer people to discussions for support

5 years agoAdd emojis to issue types
Joel Rosdahl [Tue, 19 Jan 2021 18:53:22 +0000 (19:53 +0100)] 
Add emojis to issue types

5 years agorefactor: Drop out parameter from get_level_1_files (#779)
Alexander Lanin [Tue, 19 Jan 2021 18:18:52 +0000 (19:18 +0100)] 
refactor: Drop out parameter from get_level_1_files (#779)