summaryrefslogtreecommitdiff
path: root/ccache.c
diff options
context:
space:
mode:
Diffstat (limited to 'ccache.c')
-rw-r--r--ccache.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/ccache.c b/ccache.c
index 099380b6..19df1950 100644
--- a/ccache.c
+++ b/ccache.c
@@ -1639,19 +1639,24 @@ calculate_object_hash(struct args *args, struct mdfour *hash, int direct_mode)
hash_int(hash, MANIFEST_VERSION);
}
+ // clang will emit warnings for unused linker flags, so we shouldn't
+ // skip those arguments
+ int is_clang = compiler_is_clang(args);
+
// First the arguments.
for (int i = 1; i < args->argc; i++) {
// -L doesn't affect compilation.
- if (i < args->argc-1 && str_eq(args->argv[i], "-L")) {
+ if (i < args->argc-1 && str_eq(args->argv[i], "-L") && !is_clang) {
i++;
continue;
}
- if (str_startswith(args->argv[i], "-L")) {
+ if (str_startswith(args->argv[i], "-L") && !is_clang) {
continue;
}
// -Wl,... doesn't affect compilation.
- if (str_startswith(args->argv[i], "-Wl,")) {
+ if (str_startswith(args->argv[i], "-Wl,") && !is_clang) {
+ // ...but it affects warnings with clang
continue;
}