ports/148228: Update ccache to 3.0 release

Alex Dupre ale at FreeBSD.org
Tue Jun 29 11:10:07 UTC 2010


>Number:         148228
>Category:       ports
>Synopsis:       Update ccache to 3.0 release
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Tue Jun 29 11:10:06 UTC 2010
>Closed-Date:
>Last-Modified:
>Originator:     Alex Dupre
>Release:        FreeBSD 8.1-PRERELEASE i386
>Organization:
>Environment:
System: FreeBSD freefall.freebsd.org 8.1-PRERELEASE FreeBSD 8.1-PRERELEASE #43 r209092: Sat Jun 12 13:37:07 UTC 2010 simon at freefall.freebsd.org:/usr/src/sys/i386/compile/FREEFALL i386


	
>Description:
Update ccache to 3.0 release:
- add LICENSE
- update compilers symlinks 
- update buildworld scripts
- suggest to run ccache --clear after upgrading from 2.4
- remove bundled MD4 substitution with base one (this could be reimplemented, but does anyone care?)
	
>How-To-Repeat:
	
>Fix:

	

--- ccache.diff begins here ---
Index: Makefile
===================================================================
RCS file: /home/pcvs/ports/devel/ccache/Makefile,v
retrieving revision 1.45
diff -u -r1.45 Makefile
--- Makefile	5 Aug 2009 02:40:48 -0000	1.45
+++ Makefile	29 Jun 2010 10:50:07 -0000
@@ -6,22 +6,22 @@
 #
 
 PORTNAME=	ccache
-PORTVERSION=	2.4
-PORTREVISION=	9
+PORTVERSION=	3.0
 CATEGORIES=	devel
 MASTER_SITES=	http://samba.org/ftp/ccache/
 
 MAINTAINER=	ahze at FreeBSD.org
 COMMENT=	A tool to minimize the compile time of C/C++ programs
 
+LICENSE=	GPLv3
+LICENSE_FILE=	${WRKSRC}/COPYING
+
 GNU_CONFIGURE=	yes
 
 MAN1=		ccache.1
 PLIST_FILES=	bin/ccache
 
-PORTDOCS=	index.html \
-		ccache-man.html \
-		${HOWTO}
+PORTDOCS=	*
 
 .if !defined(WITHOUT_COMPILER_LINKS)
 HOWTO=		ccache-howto-freebsd.txt
@@ -34,9 +34,9 @@
 
 .if !defined(WITHOUT_COMPILER_LINKS)
 .if ${ARCH}=="i386"
-CCACHE_COMPILERS+=      icc icpc
+CCACHE_COMPILERS+=	icc icpc
 .endif
-GNU_COMPILERS+=		34 42 43 44 -ooo
+GNU_COMPILERS+=		34 42 43 44 45 46
 CCACHE_COMPILERS+=	cc c++ gcc g++ ${GNU_COMPILERS:S|^|gcc|} ${GNU_COMPILERS:S|^|g++|}
 .if defined(EXTRA_COMPILERS)
 CCACHE_COMPILERS+=	${EXTRA_COMPILERS}
@@ -78,9 +78,7 @@
 .endif
 .if !defined(NOPORTDOCS)
 	@${MKDIR} ${DOCSDIR}
-.for i in ${PORTDOCS:S/${HOWTO}//}
-	${INSTALL_DATA} ${WRKSRC}/web/${i} ${DOCSDIR}
-.endfor
+	${INSTALL_DATA} ${WRKSRC}/manual.html ${DOCSDIR}
 .if !defined(WITHOUT_COMPILER_LINKS)
 	${INSTALL_DATA} ${WRKDIR}/${HOWTO} ${DOCSDIR}
 .endif
Index: distinfo
===================================================================
RCS file: /home/pcvs/ports/devel/ccache/distinfo,v
retrieving revision 1.15
diff -u -r1.15 distinfo
--- distinfo	9 Nov 2005 07:09:38 -0000	1.15
+++ distinfo	29 Jun 2010 10:50:07 -0000
@@ -1,3 +1,3 @@
-MD5 (ccache-2.4.tar.gz) = 73c1ed1e767c1752dd0f548ec1e66ce7
-SHA256 (ccache-2.4.tar.gz) = 435f862ca5168c346f5aa9e242174bbf19a5abcaeecfceeac2f194558827aaa0
-SIZE (ccache-2.4.tar.gz) = 86363
+MD5 (ccache-3.0.tar.gz) = 98145b8ad69a96bf1abf9a52d550e507
+SHA256 (ccache-3.0.tar.gz) = f3dd72457fc35bc8edc3630399fb1f6117b43349e8ac6fcfad575c46add32856
+SIZE (ccache-3.0.tar.gz) = 264888
Index: files/patch-ccache.1
===================================================================
RCS file: files/patch-ccache.1
diff -N files/patch-ccache.1
--- files/patch-ccache.1	15 Nov 2005 20:03:33 -0000	1.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,19 +0,0 @@
---- ccache.1.orig	Mon Sep 13 06:38:30 2004
-+++ ccache.1	Tue Nov 15 14:59:46 2005
-@@ -234,6 +234,16 @@
- incorrect setting of this debug info rarely causes problems\&. If you
- strike problems with gdb not using the correct directory then enable
- this option\&.
-+.IP
-+.IP "\fBCCACHE_NOHASH_SIZE_MTIME\fP"
-+This tells ccache to not hash the real compiler's size and modification
-+time. Normally this is the mechanism to detect compiler upgrades.
-+There are situations however, where even though the compiler's size or
-+modification time has changed you can safely use the cached objects
-+(e.g. if as part of your build system the compiler is built as well
-+and the compiler's source has not changed; or if the compiler has only
-+changes that do not affect code generation). Use this feature only if
-+you know what you are doing.
- .IP 
- .IP "\fBCCACHE_UNIFY\fP" 
- If you set the environment variable CCACHE_UNIFY
Index: files/patch-ccache.c
===================================================================
RCS file: files/patch-ccache.c
diff -N files/patch-ccache.c
--- files/patch-ccache.c	21 Mar 2006 15:06:15 -0000	1.2
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,17 +0,0 @@
---- ccache.c.orig	2004/09/13 10:19:06	1.96
-+++ ccache.c	2005/11/24 21:54:09	1.98
-@@ -331,8 +331,12 @@
- 		hash_string(str_basename(args->argv[0]));
- 	}
- 
--	hash_int(st.st_size);
--	hash_int(st.st_mtime);
-+	if (getenv("CCACHE_HASH_COMPILER")) {
-+		hash_file(args->argv[0]);
-+	} else if (!getenv("CCACHE_NOHASH_SIZE_MTIME")) {
-+		hash_int(st.st_size);
-+		hash_int(st.st_mtime);
-+	}
- 
- 	/* possibly hash the current working directory */
- 	if (getenv("CCACHE_HASHDIR")) {
Index: files/patch-ccache.yo
===================================================================
RCS file: files/patch-ccache.yo
diff -N files/patch-ccache.yo
--- files/patch-ccache.yo	21 Mar 2006 15:06:15 -0000	1.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,14 +0,0 @@
---- ccache.yo.orig	2004/09/10 05:05:14	1.26
-+++ ccache.yo	2005/11/24 21:54:09	1.27
-@@ -203,6 +203,11 @@
- strike problems with gdb not using the correct directory then enable
- this option.
- 
-+dit(bf(CCACHE_HASH_COMPILER)) This tells ccache to hash binary of the
-+compiler instead of hashing just its size and mtime. This is very
-+slightly slower, but makes copes better with compiler upgrades during
-+a build bootstrapping process.
-+
- dit(bf(CCACHE_UNIFY)) If you set the environment variable CCACHE_UNIFY
- then ccache will use the C/C++ unifier when hashing the pre-processor
- output if -g is not used in the compile. The unifier is slower than a
Index: files/patch-md4
===================================================================
RCS file: files/patch-md4
diff -N files/patch-md4
--- files/patch-md4	5 Aug 2009 02:40:48 -0000	1.3
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,148 +0,0 @@
---- ccache.h.orig	Wed Sep  8 21:30:40 2004
-+++ ccache.h	Wed Sep  8 21:31:53 2004
-@@ -65,14 +65,14 @@
- 
- typedef unsigned uint32;
- 
--#include "mdfour.h"
-+#include <md4.h> 
- 
- void hash_start(void);
- void hash_string(const char *s);
- void hash_int(int x);
- void hash_file(const char *fname);
- char *hash_result(void);
--void hash_buffer(const char *s, int len);
-+void hash_buffer(const unsigned char *s, unsigned int len);
- 
- void cc_log(const char *format, ...);
- void fatal(const char *msg);
---- hash.c.orig	2004-09-13 12:38:30.000000000 +0200
-+++ hash.c	2009-07-21 23:37:00.000000000 +0200
-@@ -20,17 +20,22 @@
- */
- 
- #include "ccache.h"
-+#include <sys/types.h>
-+#include <sys/mman.h>
-+#include <sys/stat.h>
- 
--static struct mdfour md;
-+static MD4_CTX md;
-+static off_t   totalN;
- 
--void hash_buffer(const char *s, int len)
-+void hash_buffer(const unsigned char *s, unsigned int len)
- {
--	mdfour_update(&md, (unsigned char *)s, len);
-+       totalN += len;
-+       MD4Update(&md, s, len);
- }
- 
- void hash_start(void)
- {
--	mdfour_begin(&md);
-+	MD4Init(&md);
- }
- 
- void hash_string(const char *s)
-@@ -46,35 +51,44 @@
- /* add contents of a file to the hash */
- void hash_file(const char *fname)
- {
--	char buf[1024];
--	int fd, n;
-+       char *buf;
-+       int fd;
-+       struct stat stats;
- 
- 	fd = open(fname, O_RDONLY|O_BINARY);
- 	if (fd == -1) {
- 		cc_log("Failed to open %s\n", fname);
--		fatal("hash_file");
-+                fatal(__FUNCTION__);
- 	}
- 
--	while ((n = read(fd, buf, sizeof(buf))) > 0) {
--		hash_buffer(buf, n);
--	}
-+       if (fstat(fd, &stats) != 0) {
-+               cc_log("Failed to fstat the opened %s (descriptor %d)\n",
-+                       fname, fd);
-+               close(fd);
-+               fatal(__FUNCTION__);
-+       }
-+       if( stats.st_size == 0 )
-+	       buf = NULL;
-+       else {
-+	       buf = mmap(NULL, stats.st_size, PROT_READ, MAP_PRIVATE, fd, 0); 
-+	       if (buf == MAP_FAILED) {
-+		       cc_log("Failed to mmap %s\n", fname);
-+		       close(fd);
-+		       fatal(__FUNCTION__);
-+		}       
-+       }
-+
-+        hash_buffer(buf, stats.st_size);
- 	close(fd);
- }
- 
- /* return the hash result as a static string */
- char *hash_result(void)
- {
--	unsigned char sum[16];
- 	static char ret[53];
--	int i;
- 
--	hash_buffer(NULL, 0);
--	mdfour_result(&md, sum);
-+        MD4End(&md, ret);
- 	
--	for (i=0;i<16;i++) {
--		sprintf(&ret[i*2], "%02x", (unsigned)sum[i]);
--	}
--	sprintf(&ret[i*2], "-%u", (unsigned)md.totalN);
--
-+        snprintf(ret + 32, sizeof ret - 32, "-%lu", (unsigned long)totalN);
- 	return ret;
- }
---- unify.c.orig	Wed Sep  8 21:36:41 2004
-+++ unify.c	Wed Sep  8 21:37:20 2004
-@@ -104,13 +104,12 @@
- 			hash_buffer((char *)buf, len);
- 			len = 0;
- 		}
--		hash_buffer(NULL, 0);
- 		return;
- 	}
- 
- 	buf[len++] = c;
--	if (len == 64) {
--		hash_buffer((char *)buf, len);
-+       if (len == sizeof buf) {
-+                hash_buffer((char *)buf, sizeof buf);
- 		len = 0;
- 	}
- }
---- Makefile.in.orig	Mon Sep  6 09:04:22 2004
-+++ Makefile.in	Wed Sep  8 21:41:00 2004
-@@ -11,16 +11,16 @@
- CFLAGS=@CFLAGS@ -I.
- EXEEXT=@EXEEXT@
- 
--OBJS= ccache.o mdfour.o hash.o execute.o util.o args.o stats.o \
-+OBJS= ccache.o hash.o execute.o util.o args.o stats.o \
- 	cleanup.o snprintf.o unify.o
--HEADERS = ccache.h mdfour.h
-+HEADERS = ccache.h
- 
- all: ccache$(EXEEXT)
- 
- docs: ccache.1 web/ccache-man.html
- 
- ccache$(EXEEXT): $(OBJS) $(HEADERS)
--	$(CC) $(CFLAGS) -o $@ $(OBJS)
-+	$(CC) $(CFLAGS) -o $@ $(OBJS) -lmd
- 
- ccache.1: ccache.yo
- 	-yodl2man -o ccache.1 ccache.yo
Index: files/patch-util.c
===================================================================
RCS file: files/patch-util.c
diff -N files/patch-util.c
--- files/patch-util.c	24 Nov 2008 03:32:46 -0000	1.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,25 +0,0 @@
-$MirOS: ports/devel/ccache/patches/patch-util_c,v 1.1 2008/10/05 17:03:37 tg Exp $
-
-	Very interesting bug: tries to read “size” bytes
-	from “ptr” (of size “oldsize”) while copying to
-	“p2” (of size “size”), instead of “oldsize” bytes;
-	with mmap malloc, jemalloc, and possibly omalloc,
-	the additional RAM needed is not always in core…
-
---- util.c.orig	Mon Sep 13 10:38:08 2004
-+++ util.c	Sun Oct  5 16:58:39 2008
-@@ -187,13 +187,9 @@ void *x_realloc(void *ptr, size_t size)
- {
- 	void *p2;
- 	if (!ptr) return x_malloc(size);
--	p2 = malloc(size);
-+	p2 = realloc(ptr, size);
- 	if (!p2) {
- 		fatal("out of memory in x_realloc");
--	}
--	if (ptr) {
--		memcpy(p2, ptr, size);
--		free(ptr);
- 	}
- 	return p2;
- }
Index: files/pkg-message.in
===================================================================
RCS file: /home/pcvs/ports/devel/ccache/files/pkg-message.in,v
retrieving revision 1.4
diff -u -r1.4 pkg-message.in
--- files/pkg-message.in	11 Dec 2004 22:26:51 -0000	1.4
+++ files/pkg-message.in	29 Jun 2010 10:50:07 -0000
@@ -3,3 +3,6 @@
 Please read %%DOCSDIR%%/%%HOWTO%% for 
 information on using ccache with FreeBSD ports and src.
 
+If you are upgrading from 2.4 release you might clear
+the old cache directory with "ccache --clear".
+
Index: files/world-c++.in
===================================================================
RCS file: /home/pcvs/ports/devel/ccache/files/world-c++.in,v
retrieving revision 1.1
diff -u -r1.1 world-c++.in
--- files/world-c++.in	21 Mar 2006 15:06:15 -0000	1.1
+++ files/world-c++.in	29 Jun 2010 10:50:07 -0000
@@ -1,4 +1,4 @@
 #!/bin/sh
 unset CCACHE_PATH
-export CCACHE_HASH_COMPILER
+export CCACHE_COMPILERCHECK=content
 exec %%PREFIX%%/%%CCLINKDIR%%/c++ "$@"
Index: files/world-cc.in
===================================================================
RCS file: /home/pcvs/ports/devel/ccache/files/world-cc.in,v
retrieving revision 1.1
diff -u -r1.1 world-cc.in
--- files/world-cc.in	21 Mar 2006 15:06:15 -0000	1.1
+++ files/world-cc.in	29 Jun 2010 10:50:07 -0000
@@ -1,4 +1,4 @@
 #!/bin/sh
 unset CCACHE_PATH
-export CCACHE_HASH_COMPILER
+export CCACHE_COMPILERCHECK=content
 exec %%PREFIX%%/%%CCLINKDIR%%/cc "$@"
--- ccache.diff ends here ---


>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list