Joel Rosdahl [Sun, 31 Mar 2019 18:06:05 +0000 (20:06 +0200)]
Ignore unknown keys in configuration files
This way legacy ccache versions can still work with modern ccache
configuration keys in the configuration files. The downside is of course
that errors like typos no longer will be corrected.
Pavol Sakac [Sun, 24 Mar 2019 12:56:24 +0000 (13:56 +0100)]
depend mode: Support multiple versions of dependencies (#363)
Depend mode fix for a case with unchaged common hash (unchanged source file and
other parameters that affect the hash), but with changes in the header file[s]
the source file depends on. This allows for multiple versions of the object
file and dependency file to exist for one common hash. Added unit tests in
test/suites/depend_different_headers.bash to test this behavior.
Joel Rosdahl [Thu, 21 Mar 2019 21:04:22 +0000 (22:04 +0100)]
Fix deletion of tmp_stderr in depend mode
If the compiler produced stderr, a temporary file leaks if depend mode
is enabled. Also, if the compiler does not produce stderr and depend
mode is enable, an unnecessary unlink is attempted.
Fix this by restructuring logic related to deletion of the temporary
file.
dianders [Thu, 21 Mar 2019 19:46:34 +0000 (12:46 -0700)]
Allow treating "/dev/null" as an input file (#365)
One of the slow things for incremental Linux kernel builds is that
during the single-threaded parsing stage of the Makefile the kernel
calls into the C compiler to test which options the compiler supports.
A lot. Specifically there are snippets like this all over the
Makefile:
$(call cc-option,-Oz,-Os)
...which translates into a call to the C compiler:
${CC} ... -Oz -c -x c /dev/null -o .178435.tmp
One of the contributing factors to the overall slowness is that the
input file for this test is "/dev/null". This trips a check in ccache
because "/dev/null" "isn't a plain file".
As far as I understand it it should be totally fine to cache the
result of compiling "/dev/null". It's basically just compiling an
empty file.
On my setup this improves the parsing stage of the kernel Makefile
from 3.25 seconds to 2.0 seconds (so saves 1.25 seconds for each of
build, install, and modules_install for 3.75 seconds total).
Joel Rosdahl [Thu, 24 Jan 2019 20:35:52 +0000 (21:35 +0100)]
Avoid reading outside memory buffer for large debug log messages
When the debug mode is enabled, the vlog function formats a log message
in a stack-allocated buffer using vsnprintf and assumes that the
returned value represents the number of written bytes. This is an
incorrect assumption if the message is larger than the buffer
size (minus one) since the return value tells how many bytes *would*
have been written.
Robert Yang [Tue, 22 Jan 2019 09:04:00 +0000 (17:04 +0800)]
dev.mk.in: Fix file name too long error
The all_cppflags changes path to filename which causes file name too long
error when the path is longer than NAME_MAX (usually 255). Strip srcdir
to fix the problem.
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Joel Rosdahl [Sat, 5 Jan 2019 09:56:13 +0000 (10:56 +0100)]
Genererate confitem number fields in confitems.gperf
When merging diverging confitems.gperf changes it is always a hassle to
regenerate the config number sequence fields by hand, and they also
trigger merge conflicts. Those numbers are now instead generated
automatically.
Joel Rosdahl [Fri, 4 Jan 2019 08:54:29 +0000 (09:54 +0100)]
Don’t store pregenerated config lookup tables in the repo
We have had a requirement on gperf for the build-from-repo case for a
while now, so there is no real point in keeping generated gperf lookup
table code in the repository.
Joel Rosdahl [Thu, 3 Jan 2019 13:33:52 +0000 (14:33 +0100)]
Merge pull request #301 from afbjorklund/depend_mode
Add depend mode (avoid the preprocessor).
When using run_second_cpp (which is the default now), ccache executes
the preprocessor just to determine the object hash, and will do so for
every cache miss. While compiling, the same work is done again.
When executing a massively parallel build using ccache and distcc,
the system controlling the build can get a fairly high load because of
all these ccache-only preprocessor executions.
This is based on the work of Geert Kloosterman with remaining items addressed.
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.