jonnyyu [Mon, 10 Dec 2018 19:49:22 +0000 (03:49 +0800)]
Skip '-index-store-path' when building with Xcode (#333)
In Xcode 9 or later, Xcode calls clang with this
new '-index-store-path' option.
The Xcode usually sets IndexStore directory under
a unique build location. This might break the manifest,
especially when cache is shared among multple machines.
jonnyyu [Sun, 9 Dec 2018 18:15:58 +0000 (02:15 +0800)]
Handle several levels of nonexistent directories in make_relative_path (#334)
Currently, ccache supports calculating relative path
for 1 level non-exist path. That is to say,
if the given path does not exist, however if its
parent directory exists, then ccache can calculate
the relative path correctly.
Unfortunately this doesn't fit the needs.
Xcode build system always adds these paths into header search path:
xxxxx/DerivedResources/x86-64
xxxxx/DerivedResources
these paths are build outputs for build rules.
For projects which doesn't use build rule to generate files
these directories do not exist.
So this change refine the logic of make_relative_path
to recursively go up find the nearest existing directory
and use the remaining path as path_suffix.
Joel Galenson [Sun, 2 Dec 2018 19:27:21 +0000 (11:27 -0800)]
Support multiple -fsanitize-blacklist arguments (#330)
This modifies the code to support multiple -fsanitize-blacklist
arguments, which prevents ccache from incorrectly using a cached
result when one of the blacklist files has changed.
Joel Rosdahl [Wed, 24 Oct 2018 20:10:41 +0000 (22:10 +0200)]
Use double for limit_multiple
This allows for removing the -Wno-double-promotion and
-Wno-float-conversion options which are not available for the clang
version currently used for “make analyze”.
Joel Rosdahl [Sat, 20 Oct 2018 20:42:55 +0000 (22:42 +0200)]
Refactor conf item lookup code
- Extracted parse/format/verify functions into a separate confitems.c
file.
- The *_lookup.c files are now compilation units of their own instead of
being included inside conf.c. This feels cleaner, and also relieves
cppcheck from having to check dirty, autogenerated code.
Joel Rosdahl [Sun, 7 Oct 2018 19:06:08 +0000 (21:06 +0200)]
Fix bugs in debug mode logging
Need to dump log buffer as the last exit function to not lose any logs.
Also, made sure to print the final result log line even if the log mode
isn’t enabled.
Joel Rosdahl [Sun, 7 Oct 2018 18:40:55 +0000 (20:40 +0200)]
Refactor debug mode code
Knowledge of the debug mode snuck into the mdfour struct and code, which
did not feel good.
* Introduced a new “struct hash”, which is used by the hash_* functions
instead of “struct mdfour”. “struct hash” contains the mdfour state
and also debug file handles that can be set via a new
hash_enable_debug function.
* Removed “identifier” from the mdfour struct and code.
* Introduced hash.h and all documented hash_* functions.
* Introduced unify.h.
* Removed some global state from util.c.
* afbjorklund/everything:
Make configure work with older clang versions
Add option for enabling more compiler warnings
Add configure support for detecting clang
Avoid bad function cast by using temporary
Proper use of const qualifier char* strings
Removed locally shadowed global variables
Don't use undefined macros, use ifdef instead
Add noreturn to functions that don't return
Add missing extern prototypes, or make static
Don't use reserved id macros in the headers
Only compile getopt_long.c when needed
Address issues found by lgtm.com alerts
Joel Rosdahl [Tue, 2 Oct 2018 18:15:32 +0000 (20:15 +0200)]
Improve debug log filenames
The “<objectfile>.ccache-hashX” files are also input data, so I think
that calling the “human-readable” version “<objectfile>.ccache-input” a
bit unpedagogical. Changes:
Joel Rosdahl [Sat, 29 Sep 2018 19:48:41 +0000 (21:48 +0200)]
Merge remote-tracking branch 'afbjorklund/hash_debug' into pr/279
* afbjorklund/hash_debug:
Register debug_end as an exit function instead
Avoid using strcat and small realloc
Rename helper functions, as suggested in review
Save debug file streams, instead of reopening
Add section markers, to the text file
Rename hash_debug, add matching end function
Improve documentation with example file names
Output log to debug, even without a logfile
Avoid global md variable in mdfour file
Add --hash-file command, for convenience
Add functionality to debug the hashing
Add feature to also log into a memory buffer
Add config for debug option ($CCACHE_DEBUG)
Add util to return the command as a string