mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-14 00:59:08 +02:00
* patch by Christo Crause to fix #38789: writing of linker commands should not depent in -s
git-svn-id: trunk@49267 -
This commit is contained in:
parent
4391075617
commit
1b22962140
@ -955,6 +955,8 @@ var
|
|||||||
t: Text;
|
t: Text;
|
||||||
hp: TCmdStrListItem;
|
hp: TCmdStrListItem;
|
||||||
filepath: TCmdStr;
|
filepath: TCmdStr;
|
||||||
|
i,j: integer;
|
||||||
|
lib: AnsiString;
|
||||||
{$endif XTENSA}
|
{$endif XTENSA}
|
||||||
begin
|
begin
|
||||||
{$ifdef XTENSA}
|
{$ifdef XTENSA}
|
||||||
@ -1139,6 +1141,20 @@ begin
|
|||||||
if ioresult<>0 then
|
if ioresult<>0 then
|
||||||
exit;
|
exit;
|
||||||
|
|
||||||
|
{ extract libraries from linker options and add to static libraries list }
|
||||||
|
Info.ExtraOptions:=trim(Info.ExtraOptions);
|
||||||
|
i := pos('-l', Info.ExtraOptions);
|
||||||
|
while i > 0 do
|
||||||
|
begin
|
||||||
|
j:=pos(' ',Info.ExtraOptions);
|
||||||
|
if j=0 then
|
||||||
|
j:=length(Info.ExtraOptions)+1;
|
||||||
|
lib:=copy(Info.ExtraOptions,i+2,j-i-2);
|
||||||
|
AddStaticCLibrary(lib);
|
||||||
|
delete(Info.ExtraOptions,i,j);
|
||||||
|
trim(Info.ExtraOptions);
|
||||||
|
i := pos('-l', Info.ExtraOptions);
|
||||||
|
end;
|
||||||
hp:=TCmdStrListItem(StaticLibFiles.First);
|
hp:=TCmdStrListItem(StaticLibFiles.First);
|
||||||
while assigned(hp) do
|
while assigned(hp) do
|
||||||
begin
|
begin
|
||||||
@ -1256,8 +1272,7 @@ begin
|
|||||||
Replace(cmdstr,'$GCSECTIONS',GCSectionsStr);
|
Replace(cmdstr,'$GCSECTIONS',GCSectionsStr);
|
||||||
Replace(cmdstr,'$DYNLINK',DynLinkStr);
|
Replace(cmdstr,'$DYNLINK',DynLinkStr);
|
||||||
end;
|
end;
|
||||||
if success and not(cs_link_nolink in current_settings.globalswitches) then
|
success:=DoExec(FindUtil(utilsprefix+BinStr),cmdstr,true,false);
|
||||||
success:=DoExec(FindUtil(utilsprefix+BinStr),cmdstr,true,false);
|
|
||||||
|
|
||||||
{ Remove ReponseFile }
|
{ Remove ReponseFile }
|
||||||
if success and not(cs_link_nolink in current_settings.globalswitches) then
|
if success and not(cs_link_nolink in current_settings.globalswitches) then
|
||||||
|
Loading…
Reference in New Issue
Block a user