* TInternalLinker.Load_ReadStaticLibrary: exit if error has occurred while opening a static library or dynamic object, continuing can cause other errors/crashes in this case.

* t_linux.pas: use sysrootpath when specifying dynamic interpreter (for cross-linking).

git-svn-id: trunk@25277 -
This commit is contained in:
sergei 2013-08-18 09:14:16 +00:00
parent 088c06d308
commit eec8129738
2 changed files with 6 additions and 4 deletions

View File

@ -1033,6 +1033,8 @@ Implementation
exit; exit;
Comment(V_Tried,'Opening library '+para); Comment(V_Tried,'Opening library '+para);
objreader:=TArObjectreader.create(para,true); objreader:=TArObjectreader.create(para,true);
if ErrorCount>0 then
exit;
if objreader.isarchive then if objreader.isarchive then
TFPObjectList(FGroupStack.Last).Add(TStaticLibrary.Create(para,objreader,CObjInput)) TFPObjectList(FGroupStack.Last).Add(TStaticLibrary.Create(para,objreader,CObjInput))
else else

View File

@ -502,8 +502,8 @@ begin
end end
else else
begin begin
linklibc:=true; linklibc:=true;
end; end;
end; end;
Add(')'); Add(')');
end end
@ -662,7 +662,7 @@ begin
_end. Align after .bss to ensure correct alignment even if the _end. Align after .bss to ensure correct alignment even if the
.bss section disappears because there are no input sections.} .bss section disappears because there are no input sections.}
add(' . = ALIGN(32 / 8);'); add(' . = ALIGN(32 / 8);');
add(' }'); add('}');
add(' . = ALIGN(32 / 8);'); add(' . = ALIGN(32 / 8);');
add(' PROVIDE (_end = .);'); add(' PROVIDE (_end = .);');
add(' PROVIDE (end = .);'); add(' PROVIDE (end = .);');
@ -1276,7 +1276,7 @@ begin
{ See tw9089*.pp: if more than one pure-Pascal shared libs are loaded, { See tw9089*.pp: if more than one pure-Pascal shared libs are loaded,
and none have rtld in their DT_NEEDED, then rtld cannot finalize correctly. } and none have rtld in their DT_NEEDED, then rtld cannot finalize correctly. }
if IsSharedLibrary then if IsSharedLibrary then
LinkScript.Concat('READSTATICLIBRARY '+maybequoted(dynlinker)); LinkScript.Concat('READSTATICLIBRARY '+maybequoted(sysrootpath+dynlinker));
linkToSharedLibs:=(not SharedLibFiles.Empty); linkToSharedLibs:=(not SharedLibFiles.Empty);