From: Rolf Bjarne Kvinge Date: Fri, 18 Dec 2015 11:04:03 +0000 (+0100) Subject: Allow multiple identical -arch arguments. X-Git-Tag: v3.3~140 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=89aa39f394e0fa4935e6cadd7184e372a37f9506;p=thirdparty%2Fccache.git Allow multiple identical -arch arguments. --- diff --git a/ccache.c b/ccache.c index 7f3dd7d04..26b911fc8 100644 --- a/ccache.c +++ b/ccache.c @@ -1915,7 +1915,7 @@ cc_process_args(struct args *args, struct args **preprocessor_args, int i; bool found_c_opt = false; bool found_S_opt = false; - bool found_arch_opt = false; + const char *found_arch = NULL; bool found_pch = false; bool found_fpch_preprocess = false; const char *explicit_language = NULL; /* As specified with -x. */ @@ -2046,13 +2046,15 @@ cc_process_args(struct args *args, struct args **preprocessor_args, /* Multiple -arch options are too hard. */ if (str_eq(argv[i], "-arch")) { - if (found_arch_opt) { - cc_log("More than one -arch compiler option is unsupported"); - stats_update(STATS_UNSUPPORTED); - result = false; - goto out; + if (found_arch) { + if (!str_eq(found_arch, argv[i+1])) { + cc_log("More than one different -arch compiler options is unsupported. Found %s and %s.", found_arch, argv[i+1]); + stats_update(STATS_UNSUPPORTED); + result = false; + goto out; + } } else { - found_arch_opt = true; + found_arch = argv[i+1]; } }