]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Handle all Intel “-xCODE” compiler options correctly
authorJoel Rosdahl <joel@rosdahl.net>
Wed, 20 May 2020 19:26:35 +0000 (21:26 +0200)
committerJoel Rosdahl <joel@rosdahl.net>
Wed, 20 May 2020 19:26:35 +0000 (21:26 +0200)
“CODE” in the Intel compiler’s “-xCODE” option for specifying processor
features seems to always start with an uppercase letter, and since GCC’s
language specifications always are lowercase we can just treat uppercase
codes as an ordinary compiler argument.

src/argprocessing.cpp

index c95d76831ff808d511c87cc2a8b7edd8277d6131..a5cf12e07c9dd86099be6c97890a3175c727ccd4 100644 (file)
@@ -360,9 +360,11 @@ process_arg(Context& ctx,
     return nullopt;
   }
 
-  if (args[i] == "-xHost") {
-    // -xHost is an ordinary Intel compiler option, not a language
-    // specification.
+  if (args[i].length() >= 3 && Util::starts_with(args[i], "-x")
+      && !islower(args[i][2])) {
+    // -xCODE (where CODE can be e.g. Host or CORE-AVX2, always starting with an
+    // uppercase letter) is an ordinary Intel compiler option, not a language
+    // specification. (GCC's "-x" language argument is always lowercase.)
     state.common_args.push_back(args[i]);
     return nullopt;
   }