From: Anders F Björklund Date: Tue, 12 Jun 2018 21:11:44 +0000 (+0200) Subject: Compiler "cc" might still be the same as "clang" X-Git-Tag: v3.5~49 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7c8597121bee2e885e7cd740a18aeecd73504bb0;p=thirdparty%2Fccache.git Compiler "cc" might still be the same as "clang" It migt also be "gcc", but try to play it safe. --- diff --git a/src/ccache.c b/src/ccache.c index 1f1faa0c5..5cff0b77c 100644 --- a/src/ccache.c +++ b/src/ccache.c @@ -1711,7 +1711,7 @@ calculate_object_hash(struct args *args, struct mdfour *hash, int direct_mode) // clang will emit warnings for unused linker flags, so we shouldn't skip // those arguments. - int is_clang = guessed_compiler == GUESSED_CLANG; + int is_clang = (guessed_compiler == GUESSED_CLANG || guessed_compiler == GUESSED_UNKNOWN); // First the arguments. for (int i = 1; i < args->argc; i++) { @@ -1970,7 +1970,7 @@ from_cache(enum fromcache_call_mode mode, bool put_object_in_manifest) // // file 'foo.h' has been modified since the precompiled header 'foo.pch' // was built - if (guessed_compiler == GUESSED_CLANG + if ((guessed_compiler == GUESSED_CLANG || guessed_compiler == GUESSED_UNKNOWN) && output_is_precompiled_header && mode == FROMCACHE_CPP_MODE) { cc_log("Not considering cached precompiled header in preprocessor mode"); diff --git a/src/manifest.c b/src/manifest.c index 02df21958..1eeccdf9a 100644 --- a/src/manifest.c +++ b/src/manifest.c @@ -383,7 +383,7 @@ verify_object(struct conf *conf, struct manifest *mf, struct object *obj, // Clang stores the mtime of the included files in the precompiled header, // and will error out if that header is later used without rebuilding. - if (guessed_compiler == GUESSED_CLANG + if ((guessed_compiler == GUESSED_CLANG || guessed_compiler == GUESSED_UNKNOWN) && output_is_precompiled_header && fi->mtime != st->mtime) { cc_log("Precompiled header includes %s, which has a new mtime", path);