[ccache] [PATCH] Some patches for Xcode support

Joel Rosdahl joel at rosdahl.net
Sun May 16 09:40:00 MDT 2010


On 2010-05-12 15:52, Bernhard Bauer wrote:
> attached are some patches needed to make compiling under Mac OS X with
> Xcode/distcc work.

Thanks!

> 0001-Add-Objective-C-to-the-mapping-from-source-files-to-.patch

Sure. Applied.

> 0002-Add-fpreprocessed-option-for-compiling-preprocessed-.patch

Is this needed because GCC doesn't add -fpreprocessed implicitly like it
does for .i/.ii/.mi files?

The patch looks OK, except that it seems that -fpreprocessed was added
in GCC 3.0, so GCC 2.95 wouldn't be supported anymore if we add the flag
unconditionally. I don't know if anyone still uses GCC 2.95, but maybe
we could do it like this instead:

--- a/ccache.c
+++ b/ccache.c
@@ -497,6 +497,14 @@ static void to_cache(ARGS *args)
 	putenv("DEPENDENCIES_OUTPUT");

 	if (compile_preprocessed_source_code) {
+		char *p = strrchr(i_tmpfile, '.');
+		if (p && strcmp(p, ".mii") == 0) {
+			/*
+			 * GCC doesn't add -fpreprocessed implicitly for .mii
+			 * files, so we have to add it ourselves.
+			 */
+			args_add(args, "-fpreprocessed");
+		}
 		args_add(args, i_tmpfile);
 	} else {
 		args_add(args, input_file);

What do you think?

> 0003-Fix-a-bug-where-a-compiler-invocation-with-distcc-di.patch

I'm don't think that's a good idea, since the executable flag can be set
on source code files as well, either by mistake or because the file
system (for instance vfat) may display all files as executable.

Maybe you set CCACHE_PREFIX to distcc instead? See
<http://ccache.samba.org/manual-3.0pre1.html#_using_ccache_with_distcc>.

-- Joel


More information about the ccache mailing list