mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-20 05:04:05 +02:00
* Xtensa-freeRTOS: fix linking against libc
git-svn-id: trunk@46782 -
This commit is contained in:
parent
8ef6372340
commit
aea85fcd66
@ -96,10 +96,10 @@ begin
|
||||
prtobj:='';
|
||||
{$else}
|
||||
prtobj:='prt0';
|
||||
{$endif}
|
||||
cprtobj:='cprt0';
|
||||
if linklibc then
|
||||
prtobj:=cprtobj;
|
||||
{$endif}
|
||||
|
||||
{ Open link.res file }
|
||||
LinkRes:=TLinkRes.Create(outputexedir+Info.ResName,true);
|
||||
@ -132,6 +132,9 @@ begin
|
||||
LinkRes.AddFileName(s);
|
||||
end;
|
||||
|
||||
{ xtensa FreeRTOS links always against libc, the runtime needs it }
|
||||
if not(target_info.system in [system_xtensa_freertos]) then
|
||||
begin
|
||||
{ try to add crti and crtbegin if linking to C }
|
||||
if linklibc then
|
||||
begin
|
||||
@ -140,6 +143,7 @@ begin
|
||||
if librarysearchpath.FindFile('crti.o',false,s) then
|
||||
LinkRes.AddFileName(s);
|
||||
end;
|
||||
end;
|
||||
|
||||
while not ObjectFiles.Empty do
|
||||
begin
|
||||
@ -165,8 +169,9 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
LinkRes.Add(')');
|
||||
|
||||
{ xtensa FreeRTOS links always against libc, the runtime needs it }
|
||||
if not(target_info.system in [system_xtensa_freertos]) then
|
||||
begin
|
||||
{ Write sharedlibraries like -l<lib>, also add the needed dynamic linker
|
||||
here to be sure that it gets linked this is needed for glibc2 systems (PFV) }
|
||||
linklibc:=false;
|
||||
@ -192,7 +197,13 @@ begin
|
||||
LinkRes.Add('-lc');
|
||||
LinkRes.Add('-lgcc');
|
||||
end;
|
||||
end;
|
||||
|
||||
LinkRes.Add(')');
|
||||
|
||||
{ xtensa FreeRTOS links always against libc }
|
||||
if not(target_info.system in [system_xtensa_freertos]) then
|
||||
begin
|
||||
{ objects which must be at the end }
|
||||
if linklibc then
|
||||
begin
|
||||
@ -208,6 +219,7 @@ begin
|
||||
LinkRes.Add(')');
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
{$ifdef ARM}
|
||||
with embedded_controllers[current_settings.controllertype] do
|
||||
|
Loading…
Reference in New Issue
Block a user