]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Allow at most one -arch compiler option
authorJoel Rosdahl <joel@rosdahl.net>
Wed, 12 May 2010 06:36:25 +0000 (08:36 +0200)
committerJoel Rosdahl <joel@rosdahl.net>
Wed, 12 May 2010 06:36:25 +0000 (08:36 +0200)
NEWS.txt
ccache.c

index 52f2d0f7eb4da1f5e7b352c5c0b0d15267119e8c..4fbb56aefbeadef4d1e5a52b365c9dd6b2db4e22 100644 (file)
--- a/NEWS.txt
+++ b/NEWS.txt
@@ -129,10 +129,12 @@ Bug fixes
       hash collisions. For instance, the compiler options `-X -Y` and `-X-Y`
       previously contributed equally to the hash sum.
 
-    - Bail out on too hard compiler options `--coverage`, `-arch`,
-      `-fprofile-arcs`, `-fprofile-generate`, `-fprofile-use`,
-      `-ftest-coverage` and `-save-temps`. Also bail out on `@file` style
-      options.
+    - Bail out on too hard compiler options `--coverage`, `-fprofile-arcs`,
+      `-fprofile-generate`, `-fprofile-use`, `-ftest-coverage` and
+      `-save-temps`. Also bail out on `@file` style options.
+
+    - Errors when using multiple `-arch` compiler options are now noted as
+      ``unsupported compiler option''.
 
     - `-MD`/`-MMD` options without `-MT`/`-MF` are now handled correctly.
 
index 3c6c9449d53c0bac4d3991737e4eca298680b378..482d48d9f23391dde0648b72fe35fd2e1533cf26 100644 (file)
--- a/ccache.c
+++ b/ccache.c
@@ -1214,6 +1214,7 @@ static void process_args(int argc, char **argv, ARGS **preprocessor_args,
        int i;
        int found_c_opt = 0;
        int found_S_opt = 0;
+       int found_arch_opt = 0;
        struct stat st;
        /* is the dependency makefile name overridden with -MF? */
        int dependency_filename_specified = 0;
@@ -1238,7 +1239,6 @@ static void process_args(int argc, char **argv, ARGS **preprocessor_args,
                    strcmp(argv[i], "--coverage") == 0 ||
                    strcmp(argv[i], "-M") == 0 ||
                    strcmp(argv[i], "-MM") == 0 ||
-                   strcmp(argv[i], "-arch") == 0 ||
                    strcmp(argv[i], "-fbranch-probabilities") == 0 ||
                    strcmp(argv[i], "-fprofile-arcs") == 0 ||
                    strcmp(argv[i], "-fprofile-generate") == 0 ||
@@ -1261,6 +1261,18 @@ static void process_args(int argc, char **argv, ARGS **preprocessor_args,
                        }
                }
 
+               /* Multiple -arch options are too hard. */
+               if (strcmp(argv[i], "-arch") == 0) {
+                       if (found_arch_opt) {
+                               cc_log("More than one -arch compiler option"
+                                      " is unsupported");
+                               stats_update(STATS_UNSUPPORTED);
+                               failed();
+                       } else {
+                               found_arch_opt = 1;
+                       }
+               }
+
                /* we must have -c */
                if (strcmp(argv[i], "-c") == 0) {
                        args_add(stripped_args, argv[i]);