diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2014-06-26 13:27:11 -0700 |
---|---|---|
committer | hjk <hjk121@nokiamail.com> | 2014-07-01 13:31:23 +0200 |
commit | 7beca6e20f232adb8bb79aa55b3eba900dc8b8de (patch) | |
tree | 0b04b92df1bde443c5afd33e4314beb963307847 | |
parent | 685655c4a5606a2448331c890b9bdf0047db957c (diff) |
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>
-rw-r--r-- | src/tools/rcc/main.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/tools/rcc/main.cpp b/src/tools/rcc/main.cpp index 99833101d2..5ded9a9b78 100644 --- a/src/tools/rcc/main.cpp +++ b/src/tools/rcc/main.cpp @@ -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 |