summaryrefslogtreecommitdiff
path: root/compiler/systems/t_freertos.pas
diff options
context:
space:
mode:
authornickysn <nickysn@3ad0048d-3df7-0310-abae-a5850022a9f2>2021-04-27 23:11:09 +0000
committernickysn <nickysn@3ad0048d-3df7-0310-abae-a5850022a9f2>2021-04-27 23:11:09 +0000
commita491c935588745154b576226b73833bac78fcb6e (patch)
tree973289073fb5d21573a6be2b5cfeba9abd2a9472 /compiler/systems/t_freertos.pas
parent38b5e0606069cc5985e995e1da5b6855db67f507 (diff)
parentae5b0de491a91321675f73eae5db628d068f4e05 (diff)
downloadfpc-unicodekvm.tar.gz
* synchronized with trunkunicodekvm
git-svn-id: https://svn.freepascal.org/svn/fpc/branches/unicodekvm@49282 3ad0048d-3df7-0310-abae-a5850022a9f2
Diffstat (limited to 'compiler/systems/t_freertos.pas')
-rw-r--r--compiler/systems/t_freertos.pas19
1 files changed, 17 insertions, 2 deletions
diff --git a/compiler/systems/t_freertos.pas b/compiler/systems/t_freertos.pas
index 027d29f15c..2c815cfbed 100644
--- a/compiler/systems/t_freertos.pas
+++ b/compiler/systems/t_freertos.pas
@@ -955,6 +955,8 @@ var
t: Text;
hp: TCmdStrListItem;
filepath: TCmdStr;
+ i,j: integer;
+ lib: AnsiString;
{$endif XTENSA}
begin
{$ifdef XTENSA}
@@ -1139,6 +1141,20 @@ begin
if ioresult<>0 then
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);
while assigned(hp) do
begin
@@ -1256,8 +1272,7 @@ begin
Replace(cmdstr,'$GCSECTIONS',GCSectionsStr);
Replace(cmdstr,'$DYNLINK',DynLinkStr);
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 }
if success and not(cs_link_nolink in current_settings.globalswitches) then