]> git.ipfire.org Git - thirdparty/ccache.git/log
thirdparty/ccache.git
5 years agoC++-ify get_path_in_cache(), add ConfigTester 483/head
Thomas Otto [Mon, 25 Nov 2019 18:40:09 +0000 (19:40 +0100)] 
C++-ify get_path_in_cache(), add ConfigTester

Then use ConfigTester to test get_path_in_cache()

5 years agoUse change_extension() and remove_extension()
Thomas Otto [Wed, 30 Oct 2019 15:39:37 +0000 (16:39 +0100)] 
Use change_extension() and remove_extension()

Also remove obsolete legacy remove_extension() function.

5 years agoAdd and test change_extension()
Thomas Otto [Wed, 30 Oct 2019 15:38:28 +0000 (16:38 +0100)] 
Add and test change_extension()

New function, not ported from legacy_util. Added because remove_extension()
followed by format("%s.new_ext", name) is used quite frequently.

5 years agoAdd and test remove_extension()
Thomas Otto [Wed, 30 Oct 2019 10:26:23 +0000 (11:26 +0100)] 
Add and test remove_extension()

Works as a replacement for the legacy util function.

5 years agoAdd and test get_extension()
Thomas Otto [Wed, 30 Oct 2019 10:21:00 +0000 (11:21 +0100)] 
Add and test get_extension()

Works as a replacement for the legacy util function.

5 years agoRemove obsolete x_basename
Thomas Otto [Wed, 30 Oct 2019 09:34:08 +0000 (10:34 +0100)] 
Remove obsolete x_basename

5 years agoAdd and test and use get_truncated_base_name()
Thomas Otto [Tue, 19 Nov 2019 17:34:26 +0000 (18:34 +0100)] 
Add and test and use get_truncated_base_name()

5 years agoUse base_name() instead of x_basename()
Thomas Otto [Wed, 30 Oct 2019 09:13:43 +0000 (10:13 +0100)] 
Use base_name() instead of x_basename()

5 years agoAdd hash functions for string and string_view
Thomas Otto [Wed, 30 Oct 2019 09:09:14 +0000 (10:09 +0100)] 
Add hash functions for string and string_view

5 years agoWindows define and include restructuring (#492)
Thomas Otto [Sun, 24 Nov 2019 21:27:26 +0000 (22:27 +0100)] 
Windows define and include restructuring (#492)

Set the _WIN32_WINNT macro only once in the generated config.h.

Include <windows.h> only once in system.hpp, unless these includes
are in third party libs - however third party includes themselves
should always be behind internal includes. Therefore also make
system.hpp the first include everywhere.

5 years agoAdd handling of __TIMESTAMP__ macro (#488)
Erik Johansson [Sun, 17 Nov 2019 20:31:49 +0000 (21:31 +0100)] 
Add handling of __TIMESTAMP__ macro (#488)

__TIMESTAMP__ is expanded by the pre-processor to asctime() of the source
file's modification time. Handle __TIMESTAMP__ similar to __DATE__ and include
asctime(modification time) in the hash when __TIMESTAMP__ is detected in the
source code.

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

(cherry picked from commit 1a4929bfd73e63ebd1b369ee116f9c57f1931824)

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

(cherry picked from commit 85f1e368b0e1a1633a2aeebd840601cd39b808c2)

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.

(cherry picked from commit 404eedde2b8c7a048ea1f68a8e70e49c5ea74df2)

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.

(cherry picked from commit 75520370b8f0c5afb8141b9808de69302d085d21)

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.

5 years agoAllow -fmodules in direct depend mode (#482)
Luboš Luňák [Thu, 14 Nov 2019 19:17:22 +0000 (20:17 +0100)] 
Allow -fmodules in direct depend mode (#482)

Clang creates the internal on-disk representation of modules
in the background on demand as necessary. This means that ccache does
not need to cache that, all that it needs to cache is the actual
compilation result and the dependencies. Which in the case of modules
includes also the module.modulemap files, and Clang outputs such
dependencies correctly only in the depend mode, in the preprocessed
output there is no way to find out the module dependencies.

Therefore support -fmodules in direct depend mode by more or less
ignoring it. Tested with source build of LLVM/Clang configured
with -DLLVM_ENABLE_MODULES=On (and the build actually occassionally
fails because of module problems, but that happens regardless of ccache).

See also pull request #130 (and this reuses the tests from there).

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

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

5 years agoUpdate libzstd to 1.4.4
Joel Rosdahl [Tue, 5 Nov 2019 19:55:04 +0000 (20:55 +0100)] 
Update libzstd to 1.4.4

5 years agoMove tests of FormatNonstdStringView to a separate file
Joel Rosdahl [Fri, 1 Nov 2019 21:01:52 +0000 (22:01 +0100)] 
Move tests of FormatNonstdStringView to a separate file

The general idea is that unittest/test_X.cpp contains tests for
src/X.[hc]pp.

5 years agostats: Fix statistics update with full filesystem
Joel Rosdahl [Fri, 1 Nov 2019 20:30:20 +0000 (21:30 +0100)] 
stats: Fix statistics update with full filesystem

This is an improved version of the corresponding 3.x series fix in
1a432329.

5 years agoAtomicFile: Cope with write error (e.g. due to full disk) when closing
Joel Rosdahl [Fri, 1 Nov 2019 20:24:55 +0000 (21:24 +0100)] 
AtomicFile: Cope with write error (e.g. due to full disk) when closing

5 years agoFix and test interaction between fmt and nonstd::string_view (#481)
Thomas Otto [Fri, 1 Nov 2019 20:58:21 +0000 (21:58 +0100)] 
Fix and test interaction between fmt and nonstd::string_view (#481)

Empty string_views could not be handled and formatting
did not stop until the first \0 was encountered.

5 years agoTweak grammar
Joel Rosdahl [Wed, 23 Oct 2019 19:02:03 +0000 (21:02 +0200)] 
Tweak grammar

5 years agoMention the AVX2 algorithm in NEWS
Joel Rosdahl [Wed, 23 Oct 2019 18:58:09 +0000 (20:58 +0200)] 
Mention the AVX2 algorithm in NEWS

5 years agoAdd AVX2 variant of check_for_temporal_macros (#476)
Erik Johansson [Wed, 23 Oct 2019 18:52:49 +0000 (20:52 +0200)] 
Add AVX2 variant of check_for_temporal_macros (#476)

By using AVX (Advanced Vector Extensions) the search for __DATE__ and __TIME__
in the input source becomes much faster. On my machine, ccache spends ~4.9e6
cycles in check_for_temporal_macros when compiling src/ccache.cpp. With USE_AVX
set that figure goes down to ~6.7e5.

Compiling all of ccache with -mavx2 makes the unittest crash with "Illegal
instruction: 4" when run on travis (Mac OS X). My guess is that -mavx2 makes
clang generate code that uses instructions that doesn't work on the CPUs used
on the build server (see [0]).

Instead compile only check_for_temporal_macros_avx2 with -mavx2 as we can
control when that function is called (i.e. only do it when the cpu supports
it).

[0] - https://stackoverflow.com/questions/48333342/os-x-illegal-instruction-4-in-travis-ci

5 years agoFix FormatNonstdStringView.hpp name in non_third_party_headers
Joel Rosdahl [Wed, 23 Oct 2019 18:35:10 +0000 (20:35 +0200)] 
Fix FormatNonstdStringView.hpp name in non_third_party_headers

5 years agoPrepare for v3.7.5
Joel Rosdahl [Tue, 22 Oct 2019 18:48:58 +0000 (20:48 +0200)] 
Prepare for v3.7.5

(cherry picked from commit 5d9a289f594c22361c18baf41a8a9aa5bd6a1026)

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

(cherry picked from commit e83a77c95f0853f53d4cffbd7df61dfdbd84b9d1)

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

(cherry picked from commit c38b0fd2441a809086fc3067968c2bcc7d2305d5)

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

(cherry picked from commit 736237aeb21eceaf7a80f13d59ad47c35d76b8bb)

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.

(cherry picked from commit e1fc59223518c53ab227d224a36fe2eeead127eb)

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.

(cherry picked from commit c74dbfe5d43fc23733bd44839b9bd119da94ba26)

5 years agoImprove functions related to (l)stat-ing
Joel Rosdahl [Sat, 19 Oct 2019 10:43:39 +0000 (12:43 +0200)] 
Improve functions related to (l)stat-ing

Introduced a Stat class that represents a “struct stat”. The class
replaces the utility functions x_lstat, x_stat, file_size_on_disk and
is_symlink, and it provides an easier to use interface than the macros
associated with stat structs.

5 years agoRemove obsolete traverse function
Joel Rosdahl [Sat, 19 Oct 2019 10:43:20 +0000 (12:43 +0200)] 
Remove obsolete traverse function

5 years agoRemove obsolete x_calloc function
Joel Rosdahl [Sat, 19 Oct 2019 10:39:35 +0000 (12:39 +0200)] 
Remove obsolete x_calloc function

5 years agoMake ccache buildable with Clang 9
Joel Rosdahl [Fri, 18 Oct 2019 17:28:33 +0000 (19:28 +0200)] 
Make ccache buildable with Clang 9

5 years agoMake remember_include_file free from gotos
Joel Rosdahl [Wed, 16 Oct 2019 18:51:50 +0000 (20:51 +0200)] 
Make remember_include_file free from gotos

5 years agoAdd Thomas Otto (totph) to .mailmap
Joel Rosdahl [Tue, 15 Oct 2019 19:20:14 +0000 (21:20 +0200)] 
Add Thomas Otto (totph) to .mailmap

5 years agoTweak contribution guidelines
Joel Rosdahl [Tue, 15 Oct 2019 18:13:19 +0000 (20:13 +0200)] 
Tweak contribution guidelines

5 years agoUse nonstd::string_view where appropriate
Joel Rosdahl [Sun, 13 Oct 2019 20:34:37 +0000 (22:34 +0200)] 
Use nonstd::string_view where appropriate

5 years agoUse #include "third_party/..." consistently to include third party code
Joel Rosdahl [Sun, 13 Oct 2019 14:44:30 +0000 (16:44 +0200)] 
Use #include "third_party/..." consistently to include third party code

5 years agoRemove now superfluous size check of uncompressed files
Joel Rosdahl [Sun, 13 Oct 2019 14:28:24 +0000 (16:28 +0200)] 
Remove now superfluous size check of uncompressed files

Uncompressed cache files have a trailing checksum as well; this wasn’t
the case earlier in the format design process.

5 years agoAdd nonstd::string_view 1.3.0
Joel Rosdahl [Sun, 13 Oct 2019 14:03:14 +0000 (16:03 +0200)] 
Add nonstd::string_view 1.3.0

5 years agoAdd nonstd::optional 3.2.0
Joel Rosdahl [Sun, 13 Oct 2019 14:01:56 +0000 (16:01 +0200)] 
Add nonstd::optional 3.2.0

5 years agoUpgrade to fmt 6.0.0
Joel Rosdahl [Sun, 13 Oct 2019 13:49:51 +0000 (15:49 +0200)] 
Upgrade to fmt 6.0.0

5 years agoPretty-print embedded_file_type in log messages
Joel Rosdahl [Sat, 19 Oct 2019 08:57:24 +0000 (10:57 +0200)] 
Pretty-print embedded_file_type in log messages

5 years agoReduce casting related to FileType
Joel Rosdahl [Sat, 19 Oct 2019 08:37:08 +0000 (10:37 +0200)] 
Reduce casting related to FileType

5 years agoConvert result type string to an enum (#478)
Thomas Otto [Sat, 19 Oct 2019 08:28:57 +0000 (10:28 +0200)] 
Convert result type string to an enum (#478)

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 agotest output: only use ansi codes when run in a terminal
Thomas Otto [Thu, 17 Oct 2019 11:26:50 +0000 (13:26 +0200)] 
test output: only use ansi codes when run in a terminal

5 years agotest output: improve readability on light backgrounds
Thomas Otto [Thu, 17 Oct 2019 09:33:43 +0000 (11:33 +0200)] 
test output: improve readability on light backgrounds

`bold()` now only writes bold text, not bold and white text

5 years agoRemove left-over CacheEntryReader::CacheEntryReader doc string
Joel Rosdahl [Sun, 13 Oct 2019 14:04:30 +0000 (16:04 +0200)] 
Remove left-over CacheEntryReader::CacheEntryReader doc string

5 years agoFix comment after renaming util.cpp to legacy_util.cpp
Joel Rosdahl [Sun, 13 Oct 2019 14:28:03 +0000 (16:28 +0200)] 
Fix comment after renaming util.cpp to legacy_util.cpp

5 years agoAdd missing #pragma once to File.hpp
Joel Rosdahl [Mon, 14 Oct 2019 16:56:50 +0000 (18:56 +0200)] 
Add missing #pragma once to File.hpp

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.

(cherry picked from commit a00b59c86136488d54a83bef10bc5a0f6b37eacf)

5 years agoFix an out-of-bounds read when logging (#475)
totph [Mon, 14 Oct 2019 18:28:19 +0000 (20:28 +0200)] 
Fix an out-of-bounds read when logging (#475)

The stack variable `suffix` is not guaranteed to be zero-terminated.

5 years agoRecompress in parallel
Joel Rosdahl [Tue, 8 Oct 2019 19:58:07 +0000 (21:58 +0200)] 
Recompress in parallel

Recompression is now done by a thread pool with one thread per logical
CPU. There is also a read-ahead to let the main thread do some directory
I/O while the CPUs are busy.

5 years agoAdd -X/--recompress option
Joel Rosdahl [Sun, 6 Oct 2019 21:08:00 +0000 (23:08 +0200)] 
Add -X/--recompress option

5 years agoLet cache entry writer/reader update/verify checksums
Joel Rosdahl [Sun, 6 Oct 2019 20:21:46 +0000 (22:21 +0200)] 
Let cache entry writer/reader update/verify checksums

5 years agoMake File movable and noncopyable
Joel Rosdahl [Sun, 6 Oct 2019 19:43:39 +0000 (21:43 +0200)] 
Make File movable and noncopyable

5 years agoRename file_size to file_size_on_disk and improve its return type
Joel Rosdahl [Sun, 6 Oct 2019 14:05:20 +0000 (16:05 +0200)] 
Rename file_size to file_size_on_disk and improve its return type

5 years agoRefactor result/manifest reading/writing
Joel Rosdahl [Wed, 2 Oct 2019 12:24:19 +0000 (14:24 +0200)] 
Refactor result/manifest reading/writing

* Converted compression code into C++ interfaces and implementations.
* Extracted code for reading/writing results/manifests into
  reader/writer classes.
* C++-ified result/manifest parsing code.

5 years agoAdd unit test of AtomicFile
Joel Rosdahl [Mon, 30 Sep 2019 19:28:20 +0000 (21:28 +0200)] 
Add unit test of AtomicFile

5 years agoAdd AtomicFile::stream
Joel Rosdahl [Mon, 30 Sep 2019 19:28:12 +0000 (21:28 +0200)] 
Add AtomicFile::stream

5 years agoRename AtomicFile::close to commit
Joel Rosdahl [Mon, 30 Sep 2019 18:37:03 +0000 (20:37 +0200)] 
Rename AtomicFile::close to commit

This better conveys the semantics.

5 years agoInclude .tmp. in AtomicFile names
Joel Rosdahl [Mon, 30 Sep 2019 18:34:56 +0000 (20:34 +0200)] 
Include .tmp. in AtomicFile names

This makes it possible to use AtomicFile for files in the cache
directory without having to add a “.tmp” interfix explicitly.

5 years agoAdd Util::big_endian_to_int and Util::int_to_big_endian
Joel Rosdahl [Sun, 29 Sep 2019 13:07:55 +0000 (15:07 +0200)] 
Add Util::big_endian_to_int and Util::int_to_big_endian

5 years agoAdd Util::get_file_size
Joel Rosdahl [Sun, 29 Sep 2019 13:07:24 +0000 (15:07 +0200)] 
Add Util::get_file_size

5 years agoAdd std::make_unique implementation
Joel Rosdahl [Thu, 26 Sep 2019 17:53:41 +0000 (19:53 +0200)] 
Add std::make_unique implementation

5 years agoUse UpperCamelCase instead of snake_case for namespaces
Joel Rosdahl [Wed, 25 Sep 2019 18:33:15 +0000 (20:33 +0200)] 
Use UpperCamelCase instead of snake_case for namespaces

This makes Foo::bar work for both a namespace Foo and a class Foo.

5 years agoMake AtomicFile::Type values lower case
Joel Rosdahl [Tue, 24 Sep 2019 19:50:27 +0000 (21:50 +0200)] 
Make AtomicFile::Type values lower case

5 years agoExtract temporary file creation code into a function
Joel Rosdahl [Mon, 23 Sep 2019 20:36:37 +0000 (22:36 +0200)] 
Extract temporary file creation code into a function

Also, use cstdio instead of iostream since that will be needed in
upcoming commits to get hold on the underlying file descriptor.

5 years agoAdd and use Checksum class
Joel Rosdahl [Wed, 18 Sep 2019 19:17:47 +0000 (21:17 +0200)] 
Add and use Checksum class

The class wraps an XXH64 state.

5 years agoAdd and use CacheFile::Type and CacheFile::type
Joel Rosdahl [Sun, 8 Sep 2019 17:29:12 +0000 (19:29 +0200)] 
Add and use CacheFile::Type and CacheFile::type

5 years agoMove parse_int to util
Joel Rosdahl [Sat, 7 Sep 2019 17:55:38 +0000 (19:55 +0200)] 
Move parse_int to util

5 years agoFix test suite problems on OS X
Joel Rosdahl [Sat, 5 Oct 2019 18:21:08 +0000 (20:21 +0200)] 
Fix test suite problems on OS X

As suggested in PR #469.

Co-authored-by: Enrico Sorichetti <enricosorichetti@mac.com>
5 years agoForce regeneration of autotools stuff in autogen.sh
Joel Rosdahl [Sat, 5 Oct 2019 18:17:03 +0000 (20:17 +0200)] 
Force regeneration of autotools stuff in autogen.sh

As suggested in PR #469.

Co-authored-by: Enrico Sorichetti <enricosorichetti@mac.com>
5 years agoAdd .DS_Store to .gitignore
Joel Rosdahl [Sat, 5 Oct 2019 18:16:21 +0000 (20:16 +0200)] 
Add .DS_Store to .gitignore

As suggested in PR #469.

Co-authored-by: Enrico Sorichetti <enricosorichetti@mac.com>
5 years agoMake detection of supported Clang warning flags actually work
Joel Rosdahl [Sat, 5 Oct 2019 18:13:59 +0000 (20:13 +0200)] 
Make detection of supported Clang warning flags actually work

As suggested in PR #469.

Co-authored-by: Enrico Sorichetti <enricosorichetti@mac.com>
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.

(cherry picked from commit d5ff95277932936ed6b3dc1b674562a8682f8aef)

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.

(cherry picked from commit 19c3729d30640fc2c78242cb46136e619fdbd802)

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

(cherry picked from commit 3c0e894c58b887bc40e2be99e722bd9b68df8689)

5 years agoSimplify code
Breno Guimaraes [Sat, 21 Sep 2019 21:27:52 +0000 (17:27 -0400)] 
Simplify code

5 years agoExtract function for free+nullify pattern
Breno Guimaraes [Sat, 14 Sep 2019 00:23:37 +0000 (20:23 -0400)] 
Extract function for free+nullify pattern

5 years agoDont free/null variable twice
Breno Guimaraes [Sat, 21 Sep 2019 19:26:08 +0000 (15:26 -0400)] 
Dont free/null variable twice

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.

(cherry picked from commit 8c4ffbab96a8f4bebc27b39ad3a235a5d8baeab3)

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.

(cherry picked from commit 6be00a0070d3898fe7201f6db44a9a3c42627bf8)

5 years agoAdd configure check for Clang flags for disabling warnings
Joel Rosdahl [Sun, 15 Sep 2019 20:36:18 +0000 (22:36 +0200)] 
Add configure check for Clang flags for disabling warnings

As suggested in #466.

Also, make --enable-more-warnings actually work when building from a
release archive.

5 years agoMove dev mode configure check to the top
Joel Rosdahl [Sun, 15 Sep 2019 20:31:25 +0000 (22:31 +0200)] 
Move dev mode configure check to the top

This makes it possible to make decisions depending on dev mode futher
down in configure.

5 years agoAdd configure macro AX_CHECK_COMPILE_FLAG
Joel Rosdahl [Sun, 15 Sep 2019 20:30:54 +0000 (22:30 +0200)] 
Add configure macro AX_CHECK_COMPILE_FLAG

5 years agoRemove obsolete configure check related to snprintf replacements
Joel Rosdahl [Sun, 15 Sep 2019 20:30:34 +0000 (22:30 +0200)] 
Remove obsolete configure check related to snprintf replacements

5 years agoClarify 3.7.4 news items 467/head
Joel Rosdahl [Thu, 12 Sep 2019 20:07:01 +0000 (22:07 +0200)] 
Clarify 3.7.4 news items

-gz is apparently supported by GCC 5+ and Clang as well.

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

(cherry picked from commit fbdb291fbf0fc749ed44fc510ff023c8030359ff)

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

(cherry picked from commit d5697e4bcb04cf78245e30fbebdc4536d66c290a)

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.

(cherry picked from commit cb7a05a772ce3dcec58da16d957420f36cb97f75)

5 years agoUpdate NEWS
Joel Rosdahl [Sat, 7 Sep 2019 17:45:10 +0000 (19:45 +0200)] 
Update NEWS

5 years agoAdd missing include guard
Joel Rosdahl [Sat, 7 Sep 2019 17:41:00 +0000 (19:41 +0200)] 
Add missing include guard

5 years agoSort function definitions
Joel Rosdahl [Fri, 6 Sep 2019 18:01:28 +0000 (20:01 +0200)] 
Sort function definitions

5 years agoSet sysconfdir to /etc when dist checking
Joel Rosdahl [Thu, 5 Sep 2019 20:02:01 +0000 (22:02 +0200)] 
Set sysconfdir to /etc when dist checking

This makes the command line stable so that we can get ccache hits.