Imported Upstream version 3.1.12 upstream/3.1.12
authorJinWang An <jinwang.an@samsung.com>
Tue, 3 Aug 2021 07:16:05 +0000 (16:16 +0900)
committerJinWang An <jinwang.an@samsung.com>
Tue, 3 Aug 2021 07:16:05 +0000 (16:16 +0900)
12 files changed:
AUTHORS.html
INSTALL.html
LICENSE.html
LICENSE.txt
MANUAL.html
NEWS.html
NEWS.txt
README.html
ccache.1
ccache.c
test.sh
version.c

index 6962ad84796269576384773a97482447522cc9ac..afb5688c9736479e7bd4c25f33f905e577a8e625 100644 (file)
@@ -734,7 +734,7 @@ asciidoc.install(2);
 <body class="article">\r
 <div id="header">\r
 <h1>ccache authors</h1>\r
-<span id="revnumber">version 3.1.11</span>\r
+<span id="revnumber">version 3.1.12</span>\r
 <div id="toc">
   <div id="toctitle">Table of Contents</div>
   <noscript><p><b>JavaScript must be enabled in your browser to display the table of contents.</b></p></noscript>
@@ -915,9 +915,9 @@ Yiding Jia &lt;<a href="mailto:yiding@fb.com">yiding@fb.com</a>&gt;
 <div id="footnotes"><hr /></div>\r
 <div id="footer">\r
 <div id="footer-text">\r
-Version 3.1.11<br />\r
+Version 3.1.12<br />\r
 Last updated\r
- 2015-03-07 16:37:34 CET\r
+ 2016-07-12 21:34:27 CEST\r
 </div>\r
 </div>\r
 </body>\r
index b681d57179f3dd2f80a1f5d0b02ef7f700ed305f..30e10ade3c7294c9a93d127c144b8eefeb3d2c5a 100644 (file)
@@ -734,7 +734,7 @@ asciidoc.install(2);
 <body class="article">\r
 <div id="header">\r
 <h1>ccache installation</h1>\r
-<span id="revnumber">version 3.1.11</span>\r
+<span id="revnumber">version 3.1.12</span>\r
 <div id="toc">
   <div id="toctitle">Table of Contents</div>
   <noscript><p><b>JavaScript must be enabled in your browser to display the table of contents.</b></p></noscript>
@@ -843,9 +843,9 @@ above.</p></div>
 <div id="footnotes"><hr /></div>\r
 <div id="footer">\r
 <div id="footer-text">\r
-Version 3.1.11<br />\r
+Version 3.1.12<br />\r
 Last updated\r
- 2015-03-07 16:37:34 CET\r
+ 2016-07-12 21:34:27 CEST\r
 </div>\r
 </div>\r
 </body>\r
index 14cf6f901ca04249a285aaad85a6f87ce6081430..4aa1086d1dd931d2db0c6341a3a9febe5ab53abb 100644 (file)
@@ -734,7 +734,7 @@ asciidoc.install(2);
 <body class="article">\r
 <div id="header">\r
 <h1>ccache copyright and license</h1>\r
-<span id="revnumber">version 3.1.11</span>\r
+<span id="revnumber">version 3.1.12</span>\r
 <div id="toc">
   <div id="toctitle">Table of Contents</div>
   <noscript><p><b>JavaScript must be enabled in your browser to display the table of contents.</b></p></noscript>
@@ -776,7 +776,7 @@ copyrights on their portions of the work.</p></div>
 <div class="listingblock">\r
 <div class="content">\r
 <pre><code>  Copyright (C) 2002-2007 Andrew Tridgell\r
-  Copyright (C) 2009-2011 Joel Rosdahl</code></pre>\r
+  Copyright (C) 2009-2016 Joel Rosdahl</code></pre>\r
 </div></div>\r
 </div>\r
 </div>\r
@@ -1210,9 +1210,9 @@ following license:</p></div>
 <div id="footnotes"><hr /></div>\r
 <div id="footer">\r
 <div id="footer-text">\r
-Version 3.1.11<br />\r
+Version 3.1.12<br />\r
 Last updated\r
- 2015-03-07 16:37:34 CET\r
+ 2016-07-12 21:34:27 CEST\r
 </div>\r
 </div>\r
 </body>\r
index 7d165ceb0b669b2ad18b64b1ee6293d7f1ad7655..60bbce8bbf165e56c25408167726cd7a804a645f 100644 (file)
@@ -38,7 +38,7 @@ The copyright for ccache as a whole is as follows:
 
 -------------------------------------------------------------------------------
   Copyright (C) 2002-2007 Andrew Tridgell
-  Copyright (C) 2009-2011 Joel Rosdahl
+  Copyright (C) 2009-2016 Joel Rosdahl
 -------------------------------------------------------------------------------
 
 
index b0d173b2aa9cc3bc287247364cf0b1a3785e1680..d17a142d38e43cc03ba74010aa41265a2b2f0f00 100644 (file)
@@ -734,7 +734,7 @@ asciidoc.install(2);
 <body class="article">\r
 <div id="header">\r
 <h1>CCACHE(1)</h1>\r
-<span id="revnumber">version 3.1.11</span>\r
+<span id="revnumber">version 3.1.12</span>\r
 <div id="toc">
   <div id="toctitle">Table of Contents</div>
   <noscript><p><b>JavaScript must be enabled in your browser to display the table of contents.</b></p></noscript>
@@ -2014,9 +2014,9 @@ maintained by Joel Rosdahl. See AUTHORS.txt or AUTHORS.html and
 <div id="footnotes"><hr /></div>\r
 <div id="footer">\r
 <div id="footer-text">\r
-Version 3.1.11<br />\r
+Version 3.1.12<br />\r
 Last updated\r
- 2015-03-07 16:37:34 CET\r
+ 2016-07-12 21:34:27 CEST\r
 </div>\r
 </div>\r
 </body>\r
index 5e972f39f93957e4f123295625b08f35e77b1e05..2ba0cfda38f17275e5e93ca7c3e6575b3cd4e7fa 100644 (file)
--- a/NEWS.html
+++ b/NEWS.html
@@ -734,7 +734,7 @@ asciidoc.install(2);
 <body class="article">\r
 <div id="header">\r
 <h1>ccache news</h1>\r
-<span id="revnumber">version 3.1.11</span>\r
+<span id="revnumber">version 3.1.12</span>\r
 <div id="toc">
   <div id="toctitle">Table of Contents</div>
   <noscript><p><b>JavaScript must be enabled in your browser to display the table of contents.</b></p></noscript>
@@ -742,11 +742,29 @@ asciidoc.install(2);
 </div>\r
 <div id="content">\r
 <div class="sect1">\r
+<h2 id="_ccache_3_1_12">ccache 3.1.12</h2>\r
+<div class="sectionbody">\r
+<div class="paragraph"><p>Release date: 2016-07-12</p></div>\r
+<div class="sect2">\r
+<h3 id="_bug_fixes">Bug fixes</h3>\r
+<div class="ulist"><ul>\r
+<li>\r
+<p>\r
+Fixed a bug where (due to ccache rewriting paths) the compiler could choose\r
+  incorrect include files if <code>CCACHE_BASEDIR</code> is used and the source file path\r
+  is absolute and is a symlink.\r
+</p>\r
+</li>\r
+</ul></div>\r
+</div>\r
+</div>\r
+</div>\r
+<div class="sect1">\r
 <h2 id="_ccache_3_1_11">ccache 3.1.11</h2>\r
 <div class="sectionbody">\r
 <div class="paragraph"><p>Release date: 2015-03-07</p></div>\r
 <div class="sect2">\r
-<h3 id="_bug_fixes">Bug fixes</h3>\r
+<h3 id="_bug_fixes_2">Bug fixes</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -829,7 +847,7 @@ Stale files in the internal temporary directory (<code>&lt;ccache_dir&gt;/tmp</c
 </ul></div>\r
 </div>\r
 <div class="sect2">\r
-<h3 id="_bug_fixes_2">Bug fixes</h3>\r
+<h3 id="_bug_fixes_3">Bug fixes</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -869,7 +887,7 @@ Fixed problem with logging of current working directory.
 <div class="sectionbody">\r
 <div class="paragraph"><p>Release date: 2013-01-06</p></div>\r
 <div class="sect2">\r
-<h3 id="_bug_fixes_3">Bug fixes</h3>\r
+<h3 id="_bug_fixes_4">Bug fixes</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -940,7 +958,7 @@ Clang plugins are now hashed to catch plugin upgrades.
 </ul></div>\r
 </div>\r
 <div class="sect2">\r
-<h3 id="_bug_fixes_4">Bug fixes</h3>\r
+<h3 id="_bug_fixes_5">Bug fixes</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -988,7 +1006,7 @@ Fixed <code>static_assert</code> macro definition clash with GCC 4.7.
 <div class="sectionbody">\r
 <div class="paragraph"><p>Release date: 2012-01-08</p></div>\r
 <div class="sect2">\r
-<h3 id="_bug_fixes_5">Bug fixes</h3>\r
+<h3 id="_bug_fixes_6">Bug fixes</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -1071,7 +1089,7 @@ Rewrite argument to <code>--sysroot</code> if <code>CCACHE_BASEDIR</code> is use
 </ul></div>\r
 </div>\r
 <div class="sect2">\r
-<h3 id="_bug_fixes_6">Bug fixes</h3>\r
+<h3 id="_bug_fixes_7">Bug fixes</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -1124,7 +1142,7 @@ Improved order of statistics counters in <code>ccache -s</code> output.
 </ul></div>\r
 </div>\r
 <div class="sect2">\r
-<h3 id="_bug_fixes_7">Bug fixes</h3>\r
+<h3 id="_bug_fixes_8">Bug fixes</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -1157,7 +1175,7 @@ Systems that lack (and don&#8217;t need to be linked with) libm are now supporte
 <div class="sectionbody">\r
 <div class="paragraph"><p>Release date: 2011-01-09</p></div>\r
 <div class="sect2">\r
-<h3 id="_bug_fixes_8">Bug fixes</h3>\r
+<h3 id="_bug_fixes_9">Bug fixes</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -1190,7 +1208,7 @@ The file handle in now correctly closed on write error when trying to create
 <div class="sectionbody">\r
 <div class="paragraph"><p>Release date: 2010-11-28</p></div>\r
 <div class="sect2">\r
-<h3 id="_bug_fixes_9">Bug fixes</h3>\r
+<h3 id="_bug_fixes_10">Bug fixes</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -1217,7 +1235,7 @@ Portability fixes for HP-UX 11.00 and other esoteric systems.
 <div class="sectionbody">\r
 <div class="paragraph"><p>Release date: 2010-11-21</p></div>\r
 <div class="sect2">\r
-<h3 id="_bug_fixes_10">Bug fixes</h3>\r
+<h3 id="_bug_fixes_11">Bug fixes</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -1265,7 +1283,7 @@ The test suite now also works on systems that lack a /dev/zero.
 <div class="sectionbody">\r
 <div class="paragraph"><p>Release date: 2010-11-07</p></div>\r
 <div class="sect2">\r
-<h3 id="_bug_fixes_11">Bug fixes</h3>\r
+<h3 id="_bug_fixes_12">Bug fixes</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -1387,7 +1405,7 @@ Added <code>-install_name</code> as an option known to take an argument. (This i
 </ul></div>\r
 </div>\r
 <div class="sect2">\r
-<h3 id="_bug_fixes_12">Bug fixes</h3>\r
+<h3 id="_bug_fixes_13">Bug fixes</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -1473,7 +1491,7 @@ New <code>HACKING.txt</code> file with some notes about ccache code conventions.
 <div class="sectionbody">\r
 <div class="paragraph"><p>Release date: 2010-07-15</p></div>\r
 <div class="sect2">\r
-<h3 id="_bug_fixes_13">Bug fixes</h3>\r
+<h3 id="_bug_fixes_14">Bug fixes</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -1662,7 +1680,7 @@ The following options are no longer hashed in the preprocessor mode:
 </ul></div>\r
 </div>\r
 <div class="sect2">\r
-<h3 id="_bug_fixes_14">Bug fixes</h3>\r
+<h3 id="_bug_fixes_15">Bug fixes</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -1807,9 +1825,9 @@ Statistics counters are now correctly updated for -E option failures and
 <div id="footnotes"><hr /></div>\r
 <div id="footer">\r
 <div id="footer-text">\r
-Version 3.1.11<br />\r
+Version 3.1.12<br />\r
 Last updated\r
- 2015-03-07 16:37:34 CET\r
+ 2016-07-12 21:34:27 CEST\r
 </div>\r
 </div>\r
 </body>\r
index 849a10f1146f826365e99cb98a5274ee347d9db8..62cbaa3262aa32f0e3b134741e07ea59b4810ad3 100644 (file)
--- a/NEWS.txt
+++ b/NEWS.txt
@@ -2,6 +2,19 @@ ccache news
 ===========
 
 
+ccache 3.1.12
+-------------
+Release date: 2016-07-12
+
+
+Bug fixes
+~~~~~~~~~
+
+- Fixed a bug where (due to ccache rewriting paths) the compiler could choose
+  incorrect include files if `CCACHE_BASEDIR` is used and the source file path
+  is absolute and is a symlink.
+
+
 ccache 3.1.11
 -------------
 Release date: 2015-03-07
index 7c5d01fc264b041046e43460a534115feb7913d4..4eebda3ea67a4e57c877ad0104835fcb4dc10dfb 100644 (file)
@@ -734,7 +734,7 @@ asciidoc.install(2);
 <body class="article">\r
 <div id="header">\r
 <h1>ccache README</h1>\r
-<span id="revnumber">version 3.1.11</span>\r
+<span id="revnumber">version 3.1.12</span>\r
 <div id="toc">
   <div id="toctitle">Table of Contents</div>
   <noscript><p><b>JavaScript must be enabled in your browser to display the table of contents.</b></p></noscript>
@@ -830,9 +830,9 @@ Thiele&#8217;s &#8220;compilercache&#8221; (see <a href="http://www.erikyyy.de/c
 <div id="footnotes"><hr /></div>\r
 <div id="footer">\r
 <div id="footer-text">\r
-Version 3.1.11<br />\r
+Version 3.1.12<br />\r
 Last updated\r
- 2012-11-07 19:42:42 CET\r
+ 2016-07-12 21:34:27 CEST\r
 </div>\r
 </div>\r
 </body>\r
index 5d1f8bac4e46cc18d17e6d0d857d6c097189b9d5..b65c14ce6e185cc80ed24eb73ca04e2d23c3d7fa 100644 (file)
--- a/ccache.1
+++ b/ccache.1
@@ -2,12 +2,12 @@
 .\"     Title: ccache
 .\"    Author: [see the "Author" section]
 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\"      Date: 03/07/2015
+.\"      Date: 07/12/2016
 .\"    Manual: ccache Manual
-.\"    Source: ccache 3.1.11
+.\"    Source: ccache 3.1.12
 .\"  Language: English
 .\"
-.TH "CCACHE" "1" "03/07/2015" "ccache 3\&.1\&.11" "ccache Manual"
+.TH "CCACHE" "1" "07/12/2016" "ccache 3\&.1\&.12" "ccache Manual"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
index 1f182630d1b9f7bc26c844df0794f546963e4480..ff0eb0dfdb30c1fa30b918b2fbea64bade4d3d22 100644 (file)
--- a/ccache.c
+++ b/ccache.c
@@ -2,7 +2,7 @@
  * ccache -- a fast C/C++ compiler cache
  *
  * Copyright (C) 2002-2007 Andrew Tridgell
- * Copyright (C) 2009-2015 Joel Rosdahl
+ * Copyright (C) 2009-2016 Joel Rosdahl
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License as published by the Free
@@ -36,7 +36,7 @@ static const char VERSION_TEXT[] =
 MYNAME " version %s\n"
 "\n"
 "Copyright (C) 2002-2007 Andrew Tridgell\n"
-"Copyright (C) 2009-2015 Joel Rosdahl\n"
+"Copyright (C) 2009-2016 Joel Rosdahl\n"
 "\n"
 "This program is free software; you can redistribute it and/or modify it under\n"
 "the terms of the GNU General Public License as published by the Free Software\n"
@@ -1747,8 +1747,17 @@ cc_process_args(struct args *orig_args, struct args **preprocessor_args,
                        goto out;
                }
 
-               /* 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]));
+               }
        }
 
        if (!input_file) {
diff --git a/test.sh b/test.sh
index 5efbca4f78b6e2a8e122c1694c72101df019c96e..490e975762f7851eeac3b4048ca611034abfa589 100755 (executable)
--- a/test.sh
+++ b/test.sh
@@ -3,7 +3,7 @@
 # A simple test suite for ccache.
 #
 # Copyright (C) 2002-2007 Andrew Tridgell
-# Copyright (C) 2009-2015 Joel Rosdahl
+# Copyright (C) 2009-2016 Joel Rosdahl
 #
 # This program is free software; you can redistribute it and/or modify it under
 # the terms of the GNU General Public License as published by the Free Software
@@ -1837,6 +1837,59 @@ EOF
     checkstat 'cache miss' 2
 }
 
+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
 
@@ -1885,6 +1938,7 @@ readonly
 extrafiles
 cleanup
 pch
+symlinks
 "
 
 host_os="`uname -s`"
index c597956cd9961c8010c55b5fe0ae430fb7338a7e..3792342ff3997afa0715b32858235c4f1d92b461 100644 (file)
--- a/version.c
+++ b/version.c
@@ -1 +1 @@
-const char CCACHE_VERSION[] = "3.1.11";
+const char CCACHE_VERSION[] = "3.1.12";