]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Allow multiple identical -arch arguments.
authorRolf Bjarne Kvinge <rolf@xamarin.com>
Fri, 18 Dec 2015 11:04:03 +0000 (12:04 +0100)
committerJoel Rosdahl <joel@rosdahl.net>
Sat, 19 Dec 2015 16:11:38 +0000 (17:11 +0100)
ccache.c

index 7f3dd7d04fbb82bc202b0cb0de392f1e8c49382c..26b911fc8b57397f88a2cf6a5ce7de8ccbebe919 100644 (file)
--- 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];
                        }
                }