Bug 8964 - Object files not recompiling
Summary: Object files not recompiling
Status: CLOSED FIXED
Alias: None
Product: ccache
Classification: Unclassified
Component: ccache (show other bugs)
Version: unspecified
Hardware: All All
: P5 normal
Target Milestone: 3.1.8
Assignee: Joel Rosdahl
QA Contact: Joel Rosdahl
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-05-30 22:11 UTC by David Aguilar
Modified: 2012-08-11 13:26 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Aguilar 2012-05-30 22:11:24 UTC
Red Hat EL6.1

$ g++ --version
g++ (GCC) 4.4.5 20110214 (Red Hat 4.4.5-6)

$ ccache --version
ccache version 3.1.6

--- >8 --- >8 ---
/* test.cpp */

#include <string>
#include <stdio.h>

void foo()
{
    std::string path;
    path.erase( path.find_last_not_of("/\\")+1 );
    printf("   // bigfoo 1\n");
}

--- >8 --- >8 ---

$ ccache g++ -c test.cpp
$ strings -a test.o | grep //
   // bigfoo 1


Now, modify test.cpp to say "mytest" instead of "bigfoo"

$ ccache g++ -c test.cpp
$ strings -a test.o | grep //
   // bigfoo 1

It should say "mytest" but it says "bigfoo" instead.  The object file is not re-generated.


I also tried ccache 3.1.7 from fedora http://koji.fedoraproject.org/koji/buildinfo?buildID=282043 but the bug remained.


I also tested this on OS X SnowLeopard but the bug did not exhibit itself there:

$ g++ --version
i686-apple-darwin10g++-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5666) (dot 3)


Could it be related to the compiler?
Comment 1 Joel Rosdahl 2012-05-31 21:05:30 UTC
Thanks for the report! It's a ccache bug which should be fixed in commit 554a368a506365e05be0a9c1f7d09bf7e5ebd745, which will be included in ccache 3.1.8.
Comment 2 Joel Rosdahl 2012-08-11 13:26:28 UTC
Fix included in v3.1.8.