From 42f125eb5215d3bcc2b0833a2e681670abcbf714 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Anders=20F=20Bj=C3=B6rklund?= Date: Tue, 3 Jul 2018 18:54:34 +0200 Subject: [PATCH] Add handling of separate -target parameter Otherwise you will get an error in the log: "x86_64-pc-linux-gnu is not a regular file, not considering as input file" The argument seems to be specific to clang. --- src/ccache.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/ccache.c b/src/ccache.c index 848eecbb9..909a74191 100644 --- a/src/ccache.c +++ b/src/ccache.c @@ -2511,6 +2511,19 @@ cc_process_args(struct args *args, struct args **preprocessor_args, free(relpath); continue; } + // Alternate form of specifying target without = + if (str_eq(argv[i], "-target")) { + if (i == argc-1) { + cc_log("Missing argument to %s", argv[i]); + stats_update(STATS_ARGS); + result = false; + goto out; + } + args_add(stripped_args, argv[i]); + args_add(stripped_args, argv[i+1]); + i++; + continue; + } if (str_startswith(argv[i], "-Wp,")) { if (str_eq(argv[i], "-Wp,-P") || strstr(argv[i], ",-P,") -- 2.47.2