|
@@ -557,11 +557,12 @@ function TLinkerBSD.MakeExecutable:boolean;
|
|
|
var
|
|
|
binstr,
|
|
|
cmdstr : TCmdStr;
|
|
|
- success : boolean;
|
|
|
+ linkscript: TAsmScript;
|
|
|
DynLinkStr : string[60];
|
|
|
GCSectionsStr,
|
|
|
StaticStr,
|
|
|
StripStr : string[40];
|
|
|
+ success : boolean;
|
|
|
begin
|
|
|
if not(cs_link_nolink in current_settings.globalswitches) then
|
|
|
Message1(exec_i_linking,current_module.exefilename^);
|
|
@@ -618,11 +619,30 @@ begin
|
|
|
Replace(cmdstr,'$STRIP',StripStr);
|
|
|
Replace(cmdstr,'$GCSECTIONS',GCSectionsStr);
|
|
|
Replace(cmdstr,'$DYNLINK',DynLinkStr);
|
|
|
- success:=DoExec(FindUtil(utilsprefix+BinStr),CmdStr,true,LdSupportsNoResponseFile);
|
|
|
+ BinStr:=FindUtil(utilsprefix+BinStr);
|
|
|
+
|
|
|
+ if (LdSupportsNoResponseFile) and
|
|
|
+ not(cs_link_nolink in current_settings.globalswitches) then
|
|
|
+ begin
|
|
|
+ { we have to use a script to use the IFS hack }
|
|
|
+ linkscript:=TAsmScriptUnix.create(outputexedir+'ppaslink');
|
|
|
+ linkscript.AddLinkCommand(BinStr,CmdStr,'');
|
|
|
+ linkscript.WriteToDisk;
|
|
|
+ BinStr:=linkscript.fn;
|
|
|
+ if not path_absolute(BinStr) then
|
|
|
+ BinStr:='./'+BinStr;
|
|
|
+ CmdStr:='';
|
|
|
+ end;
|
|
|
+
|
|
|
+ success:=DoExec(BinStr,CmdStr,true,LdSupportsNoResponseFile);
|
|
|
|
|
|
{ Remove ReponseFile }
|
|
|
if (success) and not(cs_link_nolink in current_settings.globalswitches) then
|
|
|
- DeleteFile(outputexedir+Info.ResName);
|
|
|
+ begin
|
|
|
+ DeleteFile(outputexedir+Info.ResName);
|
|
|
+ DeleteFile(linkscript.fn);
|
|
|
+ linkscript.free
|
|
|
+ end;
|
|
|
|
|
|
MakeExecutable:=success; { otherwise a recursive call to link method }
|
|
|
end;
|
|
@@ -633,6 +653,7 @@ var
|
|
|
InitStr,
|
|
|
FiniStr,
|
|
|
SoNameStr : string[80];
|
|
|
+ linkscript: TAsmScript;
|
|
|
binstr,
|
|
|
cmdstr : TCmdStr;
|
|
|
success : boolean;
|
|
@@ -660,8 +681,22 @@ begin
|
|
|
Replace(cmdstr,'$INIT',InitStr);
|
|
|
Replace(cmdstr,'$FINI',FiniStr);
|
|
|
Replace(cmdstr,'$SONAME',SoNameStr);
|
|
|
+ BinStr:=FindUtil(utilsprefix+BinStr);
|
|
|
+
|
|
|
+ if (LdSupportsNoResponseFile) and
|
|
|
+ not(cs_link_nolink in current_settings.globalswitches) then
|
|
|
+ begin
|
|
|
+ { we have to use a script to use the IFS hack }
|
|
|
+ linkscript:=TAsmScriptUnix.create(outputexedir+'ppaslink');
|
|
|
+ linkscript.AddLinkCommand(BinStr,CmdStr,'');
|
|
|
+ linkscript.WriteToDisk;
|
|
|
+ BinStr:=linkscript.fn;
|
|
|
+ if not path_absolute(BinStr) then
|
|
|
+ BinStr:='./'+BinStr;
|
|
|
+ CmdStr:='';
|
|
|
+ end;
|
|
|
|
|
|
- success:=DoExec(FindUtil(utilsprefix+binstr),cmdstr,true,LdSupportsNoResponseFile);
|
|
|
+ success:=DoExec(BinStr,cmdstr,true,LdSupportsNoResponseFile);
|
|
|
|
|
|
{ Strip the library ? }
|
|
|
if success and (cs_link_strip in current_settings.globalswitches) then
|
|
@@ -673,7 +708,11 @@ begin
|
|
|
|
|
|
{ Remove ReponseFile }
|
|
|
if (success) and not(cs_link_nolink in current_settings.globalswitches) then
|
|
|
- DeleteFile(outputexedir+Info.ResName);
|
|
|
+ begin
|
|
|
+ DeleteFile(outputexedir+Info.ResName);
|
|
|
+// DeleteFile(linkscript.fn);
|
|
|
+ linkscript.free
|
|
|
+ end;
|
|
|
|
|
|
MakeSharedLibrary:=success; { otherwise a recursive call to link method }
|
|
|
end;
|