diff options
author | Joel Rosdahl <joel@rosdahl.net> | 2016-09-28 22:17:16 +0200 |
---|---|---|
committer | Joel Rosdahl <joel@rosdahl.net> | 2016-09-28 22:17:16 +0200 |
commit | 3ba2ca78f9bad5b432b3ebe7095bd8bffbdf8a30 (patch) | |
tree | 7648335d9c0a14dc0068697f39f86a74c554ef54 | |
parent | de911861b060faa990f3005baf70afe5eb9662a1 (diff) | |
download | ccache-3ba2ca78f9bad5b432b3ebe7095bd8bffbdf8a30.tar.gz |
Disable direct mode for "-Wp," with multiple preprocessor options
This fixes a regression in ccache 3.2.8/3.3.1 (commit 026ba6b9): ccache
could get confused when using the compiler option -Wp, to pass multiple
options to the preprocessor, resulting in missing dependency files from
direct mode cache hits.
Closes #133.
-rw-r--r-- | NEWS.txt | 10 | ||||
-rw-r--r-- | ccache.c | 12 |
2 files changed, 19 insertions, 3 deletions
@@ -1,6 +1,16 @@ ccache news =========== +Unreleased 3.2.9 +---------------- + +Bug fixes +~~~~~~~~~ + +- Fixed a regression in ccache 3.2.8: ccache could get confused when using the + compiler option `-Wp,` to pass multiple options to the preprocessor, + resulting in missing dependency files from direct mode cache hits. + ccache 3.2.8 ------------ @@ -2249,9 +2249,15 @@ cc_process_args(struct args *args, struct args **preprocessor_args, output_dep = make_relative_path(x_strdup(argv[i] + 9)); args_add(dep_args, argv[i]); continue; - } else if (str_startswith(argv[i], "-Wp,-M")) { - /* -MF, -MP, -MQ, -MT, etc. TODO: Make argument to MF/MQ/MT - * relative. */ + } else if (str_eq(argv[i], "-Wp,-MP") + || (strlen(argv[i]) > 8 + && str_startswith(argv[i], "-Wp,-M") + && argv[i][7] == ',' + && (argv[i][6] == 'F' + || argv[i][6] == 'Q' + || argv[i][6] == 'T') + && !strchr(argv[i] + 8, ','))) { + /* TODO: Make argument to MF/MQ/MT relative. */ args_add(dep_args, argv[i]); continue; } else if (conf->direct_mode) { |