Re: [ccache] Ccache and cross compilers

2012-07-19 Thread Joel Rosdahl
On 9 July 2012 19:06, DATACOM - Samuel Lucas samuellu...@datacom.ind.br wrote:
 [...]
 I'm wondering if it's safe to use a single ccache directory for both
 architectures or I must use separated directories for each architecture. The
 compiler's mtime, size and content are the same for both.

 Does anyone knows if ccache uses also the compiler name for the hash? Does
 it follow symbolic links for that?

Yes, ccache includes the compiler name in the hash (this is also
mentioned in the manual:
http://ccache.samba.org/manual.html#_common_hashed_information), so it
should be safe to use the same ccache directory for both
architectures. Symlinks are not followed.

-- Joel
___
ccache mailing list
ccache@lists.samba.org
https://lists.samba.org/mailman/listinfo/ccache


Re: [ccache] ccache problem with CCACHE_BASEDIR

2012-07-19 Thread Eric Blau

On 2012-06-11 07:54, Eric Blau wrote:

On 2012-06-10 16:09, Joel Rosdahl wrote:
 My suggestion is that get_relative_path essentially should stay the
 same and continue to assume that the paths are well-formed and
 canonical. make_relative_path (the only caller of get_relative_path)
 should canonicalize current_working_dir and path by calling
 realpath(3). Does this sound reasonble?

Thanks for looking at this, Joel. I modified the code to do essentially
this and it is working great now. I'll send a patch to you and the list
shortly.

Hi Joel,

Sorry for the slow response, but I have a patch attached for this issue. 
Please let me know if you have any comments.


Thanks,
Eric
diff -uNr ccache-3.1.7/util.c ccache-3.1.7.patched/util.c
--- ccache-3.1.7/util.c 2012-01-08 09:40:55.0 -0500
+++ ccache-3.1.7.patched/util.c 2012-07-19 12:41:37.0 -0400
@@ -993,11 +993,15 @@
int i;
const char *p;
char *result;
+   char *cpath;
 
if (!*to || *to != '/') {
return x_strdup(to);
}
 
+   cpath = x_realpath(from);
+   from = cpath;
+
result = x_strdup();
common_prefix_len = common_dir_prefix_length(from, to);
for (p = from + common_prefix_len; *p; p++) {
@@ -1021,6 +1025,7 @@
free(result);
result = x_strdup(.);
}
+   free(cpath);
return result;
 }
 
___
ccache mailing list
ccache@lists.samba.org
https://lists.samba.org/mailman/listinfo/ccache