The Samba-Bugzilla – Attachment 10879 Details for
Bug 11171
Enhance --ccache-skip (don't hash the option)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
proposed patch
ccache_skip.diff (text/plain), 3.53 KB, created by
Mark Starovoytov
on 2015-03-18 14:48:54 UTC
(
hide
)
Description:
proposed patch
Filename:
MIME Type:
Creator:
Mark Starovoytov
Created:
2015-03-18 14:48:54 UTC
Size:
3.53 KB
patch
obsolete
>diff -urN ccache-3.2.1/ccache.c ccache-3.2.1_skip_clean/ccache.c >--- ccache-3.2.1/ccache.c 2014-12-10 22:40:54.000000000 +0300 >+++ ccache-3.2.1_skip_clean/ccache.c 2015-03-18 16:25:42.109296788 +0300 >@@ -1618,7 +1618,7 @@ > */ > bool > cc_process_args(struct args *args, struct args **preprocessor_args, >- struct args **compiler_args) >+ struct args **compiler_args, struct args **hashable_args) > { > int i; > bool found_c_opt = false; >@@ -1635,7 +1635,7 @@ > bool dependency_filename_specified = false; > /* is the dependency makefile target name specified with -MT or -MQ? */ > bool dependency_target_specified = false; >- struct args *expanded_args, *stripped_args, *dep_args, *cpp_args; >+ struct args *expanded_args, *stripped_args, *dep_args, *cpp_args, *nonhash_args; > int argc; > char **argv; > bool result = true; >@@ -1645,6 +1645,7 @@ > stripped_args = args_init(0, NULL); > dep_args = args_init(0, NULL); > cpp_args = args_init(0, NULL); >+ nonhash_args = args_init(0, NULL); > > argc = expanded_args->argc; > argv = expanded_args->argv; >@@ -1660,7 +1661,7 @@ > result = false; > goto out; > } >- args_add(stripped_args, argv[i]); >+ args_add(nonhash_args, argv[i]); > continue; > } > >@@ -2388,11 +2389,18 @@ > *preprocessor_args = args_copy(stripped_args); > args_extend(*preprocessor_args, cpp_args); > >+ *hashable_args = args_copy(*preprocessor_args); >+ >+ /* Append args which we don't want to be hashed */ >+ args_extend(*compiler_args, nonhash_args); >+ args_extend(*preprocessor_args, nonhash_args); >+ > out: > args_free(expanded_args); > args_free(stripped_args); > args_free(dep_args); > args_free(cpp_args); >+ args_free(nonhash_args); > return result; > } > >@@ -2587,6 +2595,9 @@ > struct mdfour direct_hash; > struct mdfour cpp_hash; > >+ /* Arguments (except marked with --ccache-skip) to add to hash */ >+ struct args *hash_args; >+ > /* Arguments (except -E) to send to the preprocessor. */ > struct args *preprocessor_args; > >@@ -2628,7 +2639,7 @@ > conf->direct_mode = false; > } > >- if (!cc_process_args(orig_args, &preprocessor_args, &compiler_args)) { >+ if (!cc_process_args(orig_args, &preprocessor_args, &compiler_args, &hash_args)) { > failed(); > } > >@@ -2642,13 +2653,13 @@ > cc_log("Object file: %s", output_obj); > > hash_start(&common_hash); >- calculate_common_hash(preprocessor_args, &common_hash); >+ calculate_common_hash(hash_args, &common_hash); > > /* try to find the hash using the manifest */ > direct_hash = common_hash; > if (conf->direct_mode) { > cc_log("Trying direct lookup"); >- object_hash = calculate_object_hash(preprocessor_args, &direct_hash, 1); >+ object_hash = calculate_object_hash(hash_args, &direct_hash, 1); > if (object_hash) { > update_cached_result_globals(object_hash); > >@@ -2682,7 +2693,7 @@ > * included_files. > */ > cpp_hash = common_hash; >- object_hash = calculate_object_hash(preprocessor_args, &cpp_hash, 0); >+ object_hash = calculate_object_hash(hash_args, &cpp_hash, 0); > if (!object_hash) { > fatal("internal error: object hash from cpp returned NULL"); > } >diff -urN ccache-3.2.1/ccache.h ccache-3.2.1_skip_clean/ccache.h >--- ccache-3.2.1/ccache.h 2014-12-10 22:40:54.000000000 +0300 >+++ ccache-3.2.1_skip_clean/ccache.h 2015-03-18 15:40:12.329285949 +0300 >@@ -224,7 +224,7 @@ > > extern time_t time_of_compilation; > bool cc_process_args(struct args *args, struct args **preprocessor_args, >- struct args **compiler_args); >+ struct args **compiler_args, struct args **hashable_args); > void cc_reset(void); > bool is_precompiled_header(const char *path); >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 11171
:
10879
|
10883
|
10895