Remove the rcc output file if we failed to write it

This happens if the second pass failed to find the signature data in the
compiled output, which can happen if the compiler is not *actually*
compiling anything (LTO / LTCG mode).

If we left the unmodified file in the output, make would continue
running next time it was invoked, resulting in bad data.

Change-Id: I97f23a89a1ca1f8b8c449b0744de3f0c78daa706
Reviewed-by: hjk <hjk121@nokiamail.com>
bb10
Thiago Macieira 2014-06-26 13:27:11 -07:00 committed by hjk
parent 685655c4a5
commit 7beca6e20f
1 changed files with 7 additions and 1 deletions

View File

@ -283,7 +283,13 @@ int runRcc(int argc, char *argv[])
return 1;
}
}
return library.output(out, temp, errorDevice) ? 0 : 1;
bool success = library.output(out, temp, errorDevice);
if (!success) {
// erase the output file if we failed
out.remove();
return 1;
}
return 0;
}
Q_CORE_EXPORT extern QBasicAtomicInt qt_qhash_seed; // from qhash.cpp