* ModulesLinkToLibc: another fix. We also have to look in ImportLibraryList because items contained there aren't yet merged into linkothersharedlibs when this function is called.

git-svn-id: trunk@22831 -
This commit is contained in:
sergei 2012-10-23 14:51:35 +00:00
parent 90d564e6a5
commit f94ba86bb9

View File

@ -238,14 +238,17 @@ end;
function ModulesLinkToLibc:boolean;
var
hp: tmodule;
i: tlinkcontaineritem;
begin
result:=false;
{ This is called very early, ImportLibraryList is not yet merged into linkothersharedlibs.
The former contains library names qualified with prefix and suffix (coming from
"external 'c' name 'foo' declarations), the latter contains raw names (from "$linklib c"
directives). }
hp:=tmodule(loaded_units.first);
while assigned(hp) do
begin
{ Syntax "external 'c' name 'foo'" adds 'libc.so' to
linkothersharedlibs, while "$linklib c" adds just 'c'.
Therefore we must search for both names, this deserves a better fix. }
result:=Assigned(hp.ImportLibraryList.find(target_info.sharedClibprefix+'c'+target_info.sharedClibext));
if result then break;
result:=hp.linkothersharedlibs.find(target_info.sharedClibprefix+'c'+target_info.sharedClibext);
if result then break;
result:=hp.linkothersharedlibs.find('c');