mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-12-04 13:47:23 +01:00
* Factored a common linker script building block into separate method.
git-svn-id: trunk@21730 -
This commit is contained in:
parent
fdbe35aadf
commit
346fbef445
@ -116,6 +116,7 @@ interface
|
||||
property ImportLibraryList:TFPHashObjectList read FImportLibraryList;
|
||||
procedure DefaultLinkScript;virtual;abstract;
|
||||
procedure ConcatGenericSections(secnames:string);
|
||||
procedure ScriptAddSourceStatements(AddSharedAsStatic:boolean);virtual;
|
||||
public
|
||||
IsSharedLibrary : boolean;
|
||||
UseStabs : boolean;
|
||||
@ -897,6 +898,35 @@ Implementation
|
||||
end;
|
||||
|
||||
|
||||
procedure TInternalLinker.ScriptAddSourceStatements(AddSharedAsStatic:boolean);
|
||||
var
|
||||
s,s2: TCmdStr;
|
||||
begin
|
||||
while not ObjectFiles.Empty do
|
||||
begin
|
||||
s:=ObjectFiles.GetFirst;
|
||||
if s<>'' then
|
||||
LinkScript.Concat('READOBJECT '+MaybeQuoted(s));
|
||||
end;
|
||||
while not StaticLibFiles.Empty do
|
||||
begin
|
||||
s:=StaticLibFiles.GetFirst;
|
||||
if s<>'' then
|
||||
LinkScript.Concat('READSTATICLIBRARY '+MaybeQuoted(s));
|
||||
end;
|
||||
if not AddSharedAsStatic then
|
||||
exit;
|
||||
while not SharedLibFiles.Empty do
|
||||
begin
|
||||
S:=SharedLibFiles.GetFirst;
|
||||
if FindLibraryFile(s,target_info.staticClibprefix,target_info.staticClibext,s2) then
|
||||
LinkScript.Concat('READSTATICLIBRARY '+MaybeQuoted(s2))
|
||||
else
|
||||
Comment(V_Error,'Import library not found for '+S);
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
procedure TInternalLinker.Load_ReadObject(const para:TCmdStr);
|
||||
var
|
||||
objdata : TObjData;
|
||||
|
||||
@ -939,31 +939,10 @@ implementation
|
||||
|
||||
|
||||
procedure TInternalLinkerWin.DefaultLinkScript;
|
||||
var
|
||||
s,s2 : TCmdStr;
|
||||
begin
|
||||
ScriptAddSourceStatements(true);
|
||||
with LinkScript do
|
||||
begin
|
||||
while not ObjectFiles.Empty do
|
||||
begin
|
||||
s:=ObjectFiles.GetFirst;
|
||||
if s<>'' then
|
||||
Concat('READOBJECT '+MaybeQuoted(s));
|
||||
end;
|
||||
while not StaticLibFiles.Empty do
|
||||
begin
|
||||
s:=StaticLibFiles.GetFirst;
|
||||
if s<>'' then
|
||||
Concat('READSTATICLIBRARY '+MaybeQuoted(s));
|
||||
end;
|
||||
While not SharedLibFiles.Empty do
|
||||
begin
|
||||
S:=SharedLibFiles.GetFirst;
|
||||
if FindLibraryFile(s,target_info.staticClibprefix,target_info.staticClibext,s2) then
|
||||
Concat('READSTATICLIBRARY '+MaybeQuoted(s2))
|
||||
else
|
||||
Comment(V_Error,'Import library not found for '+S);
|
||||
end;
|
||||
if IsSharedLibrary then
|
||||
Concat('ISSHAREDLIBRARY');
|
||||
ConcatEntryName;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user