Add wposuffix to keep different logs for each pass when passes is > 1

git-svn-id: trunk@48800 -
(cherry picked from commit 63a3c25493)
This commit is contained in:
pierre 2021-02-24 10:36:45 +00:00 committed by Pierre Muller
parent bef4d583da
commit c595135723

View File

@ -839,7 +839,7 @@ end;
function RunCompiler(const ExtraPara: string):boolean; function RunCompiler(const ExtraPara: string):boolean;
var var
args,LocalExtraArgs, args,LocalExtraArgs,
wpoargs : string; wpoargs,wposuffix : string;
passnr, passnr,
passes : longint; passes : longint;
execres : boolean; execres : boolean;
@ -880,6 +880,7 @@ begin
if Config.NeedOptions<>'' then if Config.NeedOptions<>'' then
AppendOptions(Config.NeedOptions,args); AppendOptions(Config.NeedOptions,args);
wpoargs:=''; wpoargs:='';
wposuffix:='';
if (Config.WpoPasses=0) or if (Config.WpoPasses=0) or
(Config.WpoParas='') then (Config.WpoParas='') then
passes:=1 passes:=1
@ -891,6 +892,7 @@ begin
begin begin
if (passes>1) then if (passes>1) then
begin begin
wposuffix:='_'+tostr(passnr);
wpoargs:=' -OW'+config.wpoparas+' -FW'+TestOutputFileName('',PPFile[current],'wp'+tostr(passnr)); wpoargs:=' -OW'+config.wpoparas+' -FW'+TestOutputFileName('',PPFile[current],'wp'+tostr(passnr));
if (passnr>1) then if (passnr>1) then
wpoargs:=wpoargs+' -Ow'+config.wpoparas+' -Fw'+TestOutputFileName('',PPFile[current],'wp'+tostr(passnr-1)); wpoargs:=wpoargs+' -Ow'+config.wpoparas+' -Fw'+TestOutputFileName('',PPFile[current],'wp'+tostr(passnr-1));
@ -899,12 +901,12 @@ begin
{ also get the output from as and ld that writes to stderr sometimes } { also get the output from as and ld that writes to stderr sometimes }
StartTicks:=GetMicroSTicks; StartTicks:=GetMicroSTicks;
{$ifndef macos} {$ifndef macos}
execres:=ExecuteRedir(CompilerBin,args+wpoargs,'',CompilerLogFile,'stdout'); execres:=ExecuteRedir(CompilerBin,args+wpoargs,'',CompilerLogFile+wposuffix,'stdout');
{$else macos} {$else macos}
{Due to that Toolserver is not reentrant, we have to asm and link via script.} {Due to that Toolserver is not reentrant, we have to asm and link via script.}
execres:=ExecuteRedir(CompilerBin,'-s '+args+wpoargs,'',CompilerLogFile,'stdout'); execres:=ExecuteRedir(CompilerBin,'-s '+args+wpoargs,'',CompilerLogFile+wposuffix,'stdout');
if execres then if execres then
execres:=ExecuteRedir(TestOutputDir + ':ppas','','',CompilerLogFile,'stdout'); execres:=ExecuteRedir(TestOutputDir + ':ppas','','',CompilerLogFile+wpo_suffix,'stdout');
{$endif macos} {$endif macos}
EndTicks:=GetMicroSTicks; EndTicks:=GetMicroSTicks;
Verbose(V_Debug,'Exitcode '+ToStr(ExecuteResult)); Verbose(V_Debug,'Exitcode '+ToStr(ExecuteResult));
@ -913,6 +915,8 @@ begin
Verbose(V_Normal,'Compilation took '+ToStr(EndTicks-StartTicks)+' us'); Verbose(V_Normal,'Compilation took '+ToStr(EndTicks-StartTicks)+' us');
end; end;
if passes > 1 then
CopyFile(CompilerLogFile+wposuffix,CompilerLogFile,true);
{ Error during execution? } { Error during execution? }
if (not execres) and (ExecuteResult=0) then if (not execres) and (ExecuteResult=0) then
begin begin