mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-13 04:39:22 +02:00
* 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:
parent
90d564e6a5
commit
f94ba86bb9
@ -238,14 +238,17 @@ end;
|
|||||||
function ModulesLinkToLibc:boolean;
|
function ModulesLinkToLibc:boolean;
|
||||||
var
|
var
|
||||||
hp: tmodule;
|
hp: tmodule;
|
||||||
|
i: tlinkcontaineritem;
|
||||||
begin
|
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);
|
hp:=tmodule(loaded_units.first);
|
||||||
while assigned(hp) do
|
while assigned(hp) do
|
||||||
begin
|
begin
|
||||||
{ Syntax "external 'c' name 'foo'" adds 'libc.so' to
|
result:=Assigned(hp.ImportLibraryList.find(target_info.sharedClibprefix+'c'+target_info.sharedClibext));
|
||||||
linkothersharedlibs, while "$linklib c" adds just 'c'.
|
if result then break;
|
||||||
Therefore we must search for both names, this deserves a better fix. }
|
|
||||||
result:=hp.linkothersharedlibs.find(target_info.sharedClibprefix+'c'+target_info.sharedClibext);
|
result:=hp.linkothersharedlibs.find(target_info.sharedClibprefix+'c'+target_info.sharedClibext);
|
||||||
if result then break;
|
if result then break;
|
||||||
result:=hp.linkothersharedlibs.find('c');
|
result:=hp.linkothersharedlibs.find('c');
|
||||||
|
Loading…
Reference in New Issue
Block a user