]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Pass -x with preprocessed language to real compiler if -x is given
authorJoel Rosdahl <joel@rosdahl.net>
Mon, 14 Jun 2010 21:33:58 +0000 (23:33 +0200)
committerJoel Rosdahl <joel@rosdahl.net>
Mon, 14 Jun 2010 21:33:58 +0000 (23:33 +0200)
Workaround for a bug in Apple's patched distcc; see
<http://www.mail-archive.com/ccache@lists.samba.org/msg00460.html>.

ccache.c

index 48e065579219a0f1856d8feaa5f43cc1ee1976a2..6eb4582fc2fdd8218ad114daa634870df2b772f8 100644 (file)
--- a/ccache.c
+++ b/ccache.c
@@ -1787,6 +1787,15 @@ static void process_args(int argc, char **argv, ARGS **preprocessor_args,
        }
        if (compile_preprocessed_source_code) {
                *compiler_args = args_copy(stripped_args);
+               if (explicit_language) {
+                       /*
+                        * Workaround for a bug in Apple's patched distcc -- it doesn't properly
+                        * reset the language specified with -x, so if -x is given, we have to
+                        * specify the preprocessed language explicitly.
+                        */
+                       args_add(*compiler_args, "-x");
+                       args_add(*compiler_args, p_language_for_language(explicit_language));
+               }
        } else {
                *compiler_args = args_copy(*preprocessor_args);
        }