]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Merge branch '3.2-maint'
authorJoel Rosdahl <joel@rosdahl.net>
Tue, 12 Jul 2016 19:24:55 +0000 (21:24 +0200)
committerJoel Rosdahl <joel@rosdahl.net>
Tue, 12 Jul 2016 19:24:55 +0000 (21:24 +0200)
* 3.2-maint:
  Prepare for v3.2.6
  Prepare for v3.1.12
  Disable mingw32 build on v3.1.x
  Add .travis.yml
  Mark 3.1.12 as still unreleased
  Prepare for v3.1.12
  Don't rewrite source file path if it's absolute and a symlink

1  2 
NEWS.txt
ccache.c
test.sh

diff --cc NEWS.txt
index 66b89b9d0026cf7a497aa50ab24a02f336c7d130,4b2d14421b34a36f9cc9fa5e68f91b732e577199..d5d13ae74e26b6d73f166c87edc140fe252b0b81
+++ b/NEWS.txt
@@@ -2,60 -2,9 +2,61 @@@ ccache new
  ===========
  
  
- Unreleased 3.2.6
- ----------------
 +Unreleased 3.3
 +--------------
 +
 +New features and improvements
 +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 +
 +- Added support for cuda including the -optf/--options-file option.
 +
 +- Added new sloppiness option `no_system_headers`, which tells ccache not to
 +  include system headers in manifest files.
 +
 +- Multiple identical `-arch` arguments are now handled without bailing.
 +
 +- Added new `ignore_headers_in_manifest` configuration option, which specifies
 +  headers that should be ignored in the direct mode.
 +
 +- Added new `prefix_command_cpp` (`CCACHE_PREFIX_CPP`) configuration option,
 +  which specifies one or several prefixes to add to the command line ccache
 +  uses when invoking the preprocessor.
 +
 +- The concatenated form of some long compiler options is now recognized, for
 +  example when using `-isystemPATH` instead of `-isystem PATH`.
 +
 +- If hard-linking is enabled and but fails (e.g. due to cross-device linking),
 +  ccache now falls back to copying instead of running the compiler.
 +
 +- Made the `hash_dir` option only have effect when generating debug info.
 +
 +- Added support for relocating debug info directory using `-fdebug-prefix-map`.
 +  This allows for cache hits even when `hash_dir` is used in combination with
 +  `base_dir`.
 +
 +- Added new `keep_comments_cpp` (`CCACHE_COMMENTS`) configuration option, which
 +  tells ccache not to discard the comments before hashing preprocessor output.
 +  This can be used to check documentation with *-Wdocumentation*.
 +
 +- ccache now knows how to convert absolute paths to relative paths inside
 +  dependency files when using `base_dir`.
 +
 +- Improved parsing of `-g*` options.
 +
 +- Made ccache understand `-Wp,-D*` options.
 +
 +
 +Bug fixes
 +~~~~~~~~~
 +
 +- Fixed clang test suite when running on Linux.
 +
 +- Fixed build and test for MinGW32 and Windows.
 +
 +
+ ccache 3.2.6
+ ------------
+ Release date: 2016-07-12
  
  Bug fixes
  ~~~~~~~~~
diff --cc ccache.c
index b3d3cce6ba210df2fa0637e320367436cd7de1ff,014c5a0d7886984f58d39d6639ba8ca797bc13f2..b8147b580ded8e0e827000b6da0be41d6498d5f5
+++ b/ccache.c
@@@ -2804,23 -2514,19 +2804,32 @@@ cc_process_args(struct args *args, stru
                        continue;
                }
  
-               /* Rewrite to relative to increase hit rate. */
-               input_file = make_relative_path(x_strdup(argv[i]));
+               lstat(argv[i], &st);
+               if (S_ISLNK(st.st_mode)) {
+                       /* Don't rewrite source file path if it's a symlink since
+                          make_relative_path resolves symlinks using realpath(3) and this leads
+                          to potentially choosing incorrect relative header files. See the
+                          "symlink to source file" test. */
+                       input_file = x_strdup(argv[i]);
+               } else {
+                       /* Rewrite to relative to increase hit rate. */
+                       input_file = make_relative_path(x_strdup(argv[i]));
+               }
        } /* for */
  
 +      if (debug_level > 0) {
 +              generating_debuginfo = true;
 +              args_add(stripped_args, debug_argument);
 +              if (conf->unify) {
 +                      cc_log("%s used; disabling unify mode", debug_argument);
 +                      conf->unify = false;
 +              }
 +              if (debug_level >= 3) {
 +                      cc_log("%s used; not compiling preprocessed code", debug_argument);
 +                      conf->run_second_cpp = true;
 +              }
 +      }
 +
        if (found_S_opt) {
                /* Even if -gsplit-dwarf is given, the .dwo file is not generated when -S
                 * is also given.
diff --cc test.sh
index abc14274fa614f9d5c1cf6a69cef193dbbed8d13,27895a9a5c2b07731bb20a3e5fa495f7e6a4189a..2ec4880facba2e75eb5044ac1988312e789c1f0f
+++ b/test.sh
      checkstat 'cache miss' 1
      checkfile prefix.result "a
  b"
 +
 +    rm -f prefix.result
 +    PATH=.:$PATH CCACHE_PREFIX_CPP="prefix-a prefix-b" $CCACHE $COMPILER -c file.c
 +    checkstat 'cache hit (direct)' 0
 +    checkstat 'cache hit (preprocessed)' 2
 +    checkstat 'cache miss' 1
 +    checkfile prefix.result "a
 +b"
  }
  
+ symlinks_suite() {
+     ##################################################################
+     testname="symlink to source directory"
+     mkdir dir
+     cd dir
+     mkdir -p d1/d2
+     echo '#define A "OK"' >d1/h.h
+     cat <<EOF >d1/d2/c.c
+ #include <stdio.h>
+ #include "../h.h"
+ int main() { printf("%s\n", A); }
+ EOF
+     echo '#define A "BUG"' >h.h
+     ln -s d1/d2 d3
+     CCACHE_BASEDIR=/ $CCACHE $COMPILER -c $PWD/d3/c.c
+     $COMPILER -c $PWD/d3/c.c
+     $COMPILER c.o -o c
+     result=$(./c)
+     if [ "$result" != OK ]; then
+         test_failed "Incorrect header file used"
+     fi
+     cd ..
+     rm -rf dir
+     ##################################################################
+     testname="symlink to source file"
+     mkdir dir
+     cd dir
+     mkdir d
+     echo '#define A "BUG"' >d/h.h
+     cat <<EOF >d/c.c
+ #include <stdio.h>
+ #include "h.h"
+ int main() { printf("%s\n", A); }
+ EOF
+     echo '#define A "OK"' >h.h
+     ln -s d/c.c c.c
+     CCACHE_BASEDIR=/ $CCACHE $COMPILER -c $PWD/c.c
+     $COMPILER c.o -o c
+     result=$(./c)
+     if [ "$result" != OK ]; then
+         test_failed "Incorrect header file used"
+     fi
+     cd ..
+     rm -rf dir
+ }
  ######################################################################
  # main program
  
@@@ -2716,9 -2572,9 +2769,10 @@@ compressio
  readonly
  readonly_direct
  extrafiles
 +ignoreheaders
  cleanup
  pch
+ symlinks
  upgrade
  prefix
  "