--- ccache.c.orig 2004-09-13 12:38:30.000000000 +0200 +++ ccache.c.unpatched 2010-04-30 15:45:43.000000000 +0200 @@ -363,11 +363,27 @@ x_asprintf(&path_stderr, "%s/tmp.cpp_stderr.%s", temp_dir, tmp_string()); if (!direct_i_file) { + int i = 0; + ARGS *nargs = args_init(args->argc, args->argv); + /* run cpp on the input file to obtain the .i */ - args_add(args, "-E"); - args_add(args, input_file); - status = execute(args->argv, path_stdout, path_stderr); - args_pop(args, 2); + args_add(nargs, "-E"); + args_add(nargs, input_file); + + /* remove -arch parameters */ + for(i = 0; i < nargs->argc;) + { + if(strcmp(nargs->argv[i], "-arch") == 0) + { + strcpy(nargs->argv[i++],""); + strcpy(nargs->argv[i],""); + } + else + ++i; + } + + status = execute(nargs->argv, path_stdout, path_stderr); + /*args_pop(args, 2);*/ } else { /* we are compiling a .i or .ii file - that means we can skip the cpp stage and directly form the