mirror of
https://github.com/reactos/ccache.git
synced 2025-05-13 09:06:17 +00:00
Correctly update "called for link" when linking a single object file
This fixes bug #7529.
This commit is contained in:
parent
11ec900409
commit
b8982f4b88
24
ccache.c
24
ccache.c
@ -1678,6 +1678,18 @@ static void process_args(int argc, char **argv, ARGS **preprocessor_args,
|
||||
failed();
|
||||
}
|
||||
|
||||
if (!found_c_opt) {
|
||||
cc_log("No -c option found");
|
||||
/* I find that having a separate statistic for autoconf tests is useful,
|
||||
as they are the dominant form of "called for link" in many cases */
|
||||
if (strstr(input_file, "conftest.")) {
|
||||
stats_update(STATS_CONFTEST);
|
||||
} else {
|
||||
stats_update(STATS_LINK);
|
||||
}
|
||||
failed();
|
||||
}
|
||||
|
||||
if (explicit_language && strcmp(explicit_language, "none") == 0) {
|
||||
explicit_language = NULL;
|
||||
}
|
||||
@ -1705,18 +1717,6 @@ static void process_args(int argc, char **argv, ARGS **preprocessor_args,
|
||||
i_extension = extension_for_language(p_language) + 1;
|
||||
}
|
||||
|
||||
if (!found_c_opt) {
|
||||
cc_log("No -c option found");
|
||||
/* I find that having a separate statistic for autoconf tests is useful,
|
||||
as they are the dominant form of "called for link" in many cases */
|
||||
if (strstr(input_file, "conftest.")) {
|
||||
stats_update(STATS_CONFTEST);
|
||||
} else {
|
||||
stats_update(STATS_LINK);
|
||||
}
|
||||
failed();
|
||||
}
|
||||
|
||||
/* don't try to second guess the compilers heuristics for stdout handling */
|
||||
if (output_obj && strcmp(output_obj, "-") == 0) {
|
||||
stats_update(STATS_OUTSTDOUT);
|
||||
|
4
test.sh
4
test.sh
@ -169,6 +169,10 @@ base_tests() {
|
||||
$CCACHE_COMPILE test1.c -o test 2> /dev/null
|
||||
checkstat 'called for link' 1
|
||||
|
||||
testname="linkobj"
|
||||
$CCACHE_COMPILE foo.o -o test 2> /dev/null
|
||||
checkstat 'called for link' 2
|
||||
|
||||
testname="multiple"
|
||||
$CCACHE_COMPILE -c test1.c test2.c
|
||||
checkstat 'multiple source files' 1
|
||||
|
Loading…
x
Reference in New Issue
Block a user