From: Joel Rosdahl Date: Thu, 24 Jun 2010 18:59:34 +0000 (+0200) Subject: Correctly update "called for link" when linking a single object file X-Git-Tag: v3.0.1~3 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b8982f4b885dcb769720f90339238a1a2c083d1a;p=thirdparty%2Fccache.git Correctly update "called for link" when linking a single object file This fixes bug #7529. --- diff --git a/ccache.c b/ccache.c index 58bfdd5c3..945cf1b0e 100644 --- a/ccache.c +++ b/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); diff --git a/test.sh b/test.sh index 5ea5cbf52..305174b14 100755 --- a/test.sh +++ b/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