Call FindUtil for ld or nlmconv utils at linking stage, not before

This commit is contained in:
Pierre Muller 2023-11-23 20:54:30 +01:00
parent 45cb7d1eff
commit 429d2cdf12
2 changed files with 12 additions and 8 deletions

View File

@ -258,12 +258,12 @@ begin
with Info do
begin
{$ifndef netware}
ExeCmd[1]:= FindUtil(utilsprefix+'ld') + ' -Ur -T $RES $STRIP -o $TMPOBJ';
ExeCmd[2]:= FindUtil(utilsprefix+'nlmconv') + ' -T$RES';
ExeCmd[1]:= 'ld -Ur -T $RES $STRIP -o $TMPOBJ';
ExeCmd[2]:= 'nlmconv -T$RES';
{$else}
{for running on netware we need absolute pathes since ld has another working directory}
ExeCmd[1]:= FindUtil(utilsprefix+'ld') + ' -Ur -T '+FExpand(outputexedir+Info.ResName)+' $STRIP -o '+Fexpand(outputexedir+tmpLinkFileName);
ExeCmd[2]:= FindUtil(utilsprefix+'nlmconv') + ' -T'+FExpand(outputexedir+'n'+Info.ResName);
ExeCmd[1]:= 'ld -Ur -T '+FExpand(outputexedir+Info.ResName)+' $STRIP -o '+Fexpand(outputexedir+tmpLinkFileName);
ExeCmd[2]:= 'nlmconv -T'+FExpand(outputexedir+'n'+Info.ResName);
{$endif}
end;
end;
@ -578,6 +578,7 @@ begin
Replace(cmdstr,'$RES',maybequoted(outputexedir+Info.ResName));
Replace(cmdstr,'$STRIP',StripStr);
Replace(cmdstr,'$TMPOBJ',maybequoted(outputexedir+tmpLinkFileName));
BinStr:=FindUtil(utilsprefix+BinStr);
Comment (v_debug,'Executing '+BinStr+' '+cmdstr);
success:=DoExec(BinStr,CmdStr,true,false);
@ -592,6 +593,7 @@ begin
NLMConvLinkFile.Free;
SplitBinCmd(Info.ExeCmd[2],binstr,cmdstr);
Replace(cmdstr,'$RES',maybequoted(outputexedir+'n'+Info.ResName));
BinStr:=FindUtil(utilsprefix+BinStr);
Comment (v_debug,'Executing '+BinStr+' '+cmdstr);
success:=DoExec(BinStr,CmdStr,true,false);
if (success) and not(cs_link_nolink in current_settings.globalswitches) then

View File

@ -260,12 +260,12 @@ begin
with Info do
begin
{$ifndef netware}
ExeCmd[1]:= FindUtil(utilsprefix+'ld') + ' -Ur -T $RES $STRIP -o $TMPOBJ';
ExeCmd[2]:= FindUtil(utilsprefix+'nlmconv') + ' -T$RES';
ExeCmd[1]:= 'ld -Ur -T $RES $STRIP -o $TMPOBJ';
ExeCmd[2]:= 'nlmconv -T$RES';
{$else}
{for running on netware we need absolute pathes since ld has another working directory}
ExeCmd[1]:= FindUtil(utilsprefix+'ld') + ' -Ur -T '+FExpand(outputexedir+Info.ResName)+' $STRIP -o '+Fexpand(outputexedir+tmpLinkFileName);
ExeCmd[2]:= FindUtil(utilsprefix+'nlmconv') + ' -T'+FExpand(outputexedir+'n'+Info.ResName);
ExeCmd[1]:= 'ld -Ur -T '+FExpand(outputexedir+Info.ResName)+' $STRIP -o '+Fexpand(outputexedir+tmpLinkFileName);
ExeCmd[2]:= 'nlmconv -T'+FExpand(outputexedir+'n'+Info.ResName);
{$endif}
end;
end;
@ -559,6 +559,7 @@ begin
Replace(cmdstr,'$RES',maybequoted(outputexedir+Info.ResName));
Replace(cmdstr,'$STRIP',StripStr);
Replace(cmdstr,'$TMPOBJ',maybequoted(outputexedir+tmpLinkFileName));
BinStr:=FindUtil(utilsprefix+BinStr);
Comment (v_debug,'Executing '+BinStr+' '+cmdstr);
success:=DoExec(BinStr,CmdStr,true,false);
@ -572,6 +573,7 @@ begin
NLMConvLinkFile.writetodisk;
NLMConvLinkFile.Free;
SplitBinCmd(Info.ExeCmd[2],binstr,cmdstr);
BinStr:=FindUtil(utilsprefix+BinStr);
Replace(cmdstr,'$RES',maybequoted(outputexedir+'n'+Info.ResName));
Comment (v_debug,'Executing '+BinStr+' '+cmdstr);
success:=DoExec(BinStr,CmdStr,true,false);