svn commit: r408673 - in head/devel/ccache: . files
Bryan Drewery
bdrewery at FreeBSD.org
Thu Feb 11 01:33:08 UTC 2016
Author: bdrewery
Date: Thu Feb 11 01:33:06 2016
New Revision: 408673
URL: https://svnweb.freebsd.org/changeset/ports/408673
Log:
- Don't cache -fcolor-diagnostics.
Unlike gmake, which ccache is primarily targetted at, our make does not
give a TTY to stderr. Thus make -j does not use -fcolor-diagnostics by
default. If you run with make -j, then run make again ccache will
add in -fcolor-diagnostics and find only cache misses. Skip processing of
-fcolor-diagnostics (and gcc equivalents) to avoid this problem and fix
cache hits when flip-flopping between TTY/colors. Fixing our make is
possible but this change also allows the user to decide to add
-fcolor-diagnostics and still use their existing uncolored cache.
Modified:
head/devel/ccache/Makefile
head/devel/ccache/files/patch-ccache.c
Modified: head/devel/ccache/Makefile
==============================================================================
--- head/devel/ccache/Makefile Thu Feb 11 01:29:36 2016 (r408672)
+++ head/devel/ccache/Makefile Thu Feb 11 01:33:06 2016 (r408673)
@@ -3,7 +3,7 @@
PORTNAME= ccache
PORTVERSION= 3.2.4
-PORTREVISION= 1
+PORTREVISION= 2
CATEGORIES= devel
MASTER_SITES= http://www.samba.org/ftp/ccache/ \
LOCAL/bdrewery
Modified: head/devel/ccache/files/patch-ccache.c
==============================================================================
--- head/devel/ccache/files/patch-ccache.c Thu Feb 11 01:29:36 2016 (r408672)
+++ head/devel/ccache/files/patch-ccache.c Thu Feb 11 01:33:06 2016 (r408673)
@@ -1,4 +1,8 @@
-Determine whether cc(1) is clang or gcc at compile-time.
+- Determine whether cc(1) is clang or gcc at compile-time.
+- Don't hash -fcolor-diagnostics; make will auto use it while make -j will not.
+ There's no reason to not use the cache in either of these cases if it is
+ already available.
+-bdrewery
--- ccache.c.orig 2015-10-08 19:14:23 UTC
+++ ccache.c
@@ -26,3 +30,33 @@ Determine whether cc(1) is clang or gcc
free(name);
return is;
}
+@@ -1463,6 +1473,7 @@ calculate_common_hash(struct args *args,
+ free(p);
+ }
+
++#if 0
+ /* Possibly hash GCC_COLORS (for color diagnostics). */
+ if (compiler_is_gcc(args)) {
+ const char *gcc_colors = getenv("GCC_COLORS");
+@@ -1471,6 +1482,7 @@ calculate_common_hash(struct args *args,
+ hash_string(hash, gcc_colors);
+ }
+ }
++#endif
+ }
+
+ /*
+@@ -1509,6 +1521,13 @@ calculate_object_hash(struct args *args,
+ continue;
+ }
+
++ /* Colors do not affect compilation. */
++ if (str_startswith(args->argv[i], "-fcolor-diagnostics") ||
++ str_eq(args->argv[i], "-fdiagnostics-color") ||
++ str_eq(args->argv[i], "-fdiagnostics-color=always")) {
++ continue;
++ }
++
+ /* The -fdebug-prefix-map option may be used in combination with
+ * CCACHE_BASEDIR to reuse results across different directories. Skip it
+ * from hashing. */
More information about the svn-ports-all
mailing list