[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [MiNT] ccache 2.4 rpm



On Wed, 2010-06-09 at 17:25 -0400, Mark Duckworth wrote:
> On 6/9/10 5:13 PM, m0n0 wrote:
> > Hello, this is my first (public) RPM :)
> >
> > I expect someone already ported ccache, but I didn't found it at the
> > sparemintpage... so I had a go. I really needed something to speed up
> > Compilations... This package seems to work well :)!
> >
> > Please have a look at the spec file, and tell me how to do it better, if
> > you like to.
> >
> > There is just some annoying thing before rpm build finishes:
> >
> > warning: Could not canonicalize hostname: easymint
> >
> > I really don't get why rpm tries to do that. I did not configured networking
> > for my MiNT system.
> >
> > I also thought this could be the reason why my freetype RPM did not build...
> > But the written rpm's seem to be ok, so I expect it to be an wrong
> > assumption.
> >
> > I uploaded the packages to:
> >
> > http://freeshell.de/~monokrom/monochrom.net/atari/ports/
> >
> > and:
> > sparming.org/incoming
> >
> > Where should they be really uploaded to make them available to sparemint?
> > Or is incoming OK?
> >
> >
> >    
> Hi I noticed after I ported ccache that there are problems with it.  I 
> will try your build but basically just the mint kernel/mintlib gave some 
> pretty big problems after it was initially cached.  It seems to work 99% 
> but not quite 100.  Did you replace mmap calls with malloc?

Attached is my patch that I use on gentoo.

Alan.
<alanh@fairlite.co.uk>: unify doesn't work on MiNT

--- ccache.h
+++ ccache.h
@@ -9,7 +9,9 @@
 #include <sys/stat.h>
 #include <sys/types.h>
 #include <sys/wait.h>
+#ifndef __MINT__
 #include <sys/mman.h>
+#endif
 #include <sys/file.h>
 #include <fcntl.h>
 #include <time.h>
--- ccache.c
+++ ccache.c
@@ -63,7 +63,9 @@
 char *stats_file = NULL;
 
 /* can we safely use the unification hashing backend? */
+#ifndef __MINT__
 static int enable_unify;
+#endif
 
 /* a list of supported file extensions, and the equivalent
    extension for code that has been through the pre-processor
@@ -272,9 +274,11 @@
 
 	/* when we are doing the unifying tricks we need to include
            the input file name in the hash to get the warnings right */
+#ifndef __MINT__
 	if (enable_unify) {
 		hash_string(input_file);
 	}
+#endif
 
 	/* we have to hash the extension, as a .i file isn't treated the same
 	   by the compiler as a .ii file */
@@ -399,14 +403,18 @@
 	   Note! I have now disabled the unification code by default
 	   as it gives the wrong line numbers for warnings. Pity.
 	*/
+#ifndef __MINT__
 	if (!enable_unify) {
+#endif
 		hash_file(path_stdout);
+#ifndef __MINT__
 	} else {
 		if (unify_hash(path_stdout) != 0) {
 			stats_update(STATS_ERROR);
 			failed();
 		}
 	}
+#endif
 	hash_file(path_stderr);
 
 	i_tmpfile = path_stdout;
@@ -697,9 +705,11 @@
 		*/
 		if (strncmp(argv[i], "-g", 2) == 0) {
 			args_add(stripped_args, argv[i]);
+#ifndef __MINT__
 			if (strcmp(argv[i], "-g0") != 0) {
 				enable_unify = 0;
 			}
+#endif
 			continue;
 		}
 
@@ -853,10 +863,11 @@
 		cc_log("ccache is disabled\n");
 		failed();
 	}
-
+#ifndef __MINT__
 	if (getenv("CCACHE_UNIFY")) {
 		enable_unify = 1;
 	}
+#endif
 
 	/* process argument list, returning a new set of arguments for pre-processing */
 	process_args(orig_args->argc, orig_args->argv);
--- unify.c
+++ unify.c
@@ -30,6 +30,7 @@
   inline assembly systems).  
 */
 
+#ifndef __MINT__
 #include "ccache.h"
 
 static char *s_tokens[] = {
@@ -266,4 +267,4 @@
 
 	return 0;
 }
-
+#endif