summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormarco <marco@3ad0048d-3df7-0310-abae-a5850022a9f2>2006-06-30 20:14:01 +0000
committermarco <marco@3ad0048d-3df7-0310-abae-a5850022a9f2>2006-06-30 20:14:01 +0000
commit5ee0e2daf47661c39248a0b13e544a2e2bb7bb69 (patch)
tree30fb9610b90d9ebbdc79ce3c7a71844c1b962169
parente044d860d62349a7ad846c3d5c424a303139d97e (diff)
downloadfpc-5ee0e2daf47661c39248a0b13e544a2e2bb7bb69.tar.gz
* link reordering
git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@4016 3ad0048d-3df7-0310-abae-a5850022a9f2
-rw-r--r--compiler/systems/t_bsd.pas12
1 files changed, 9 insertions, 3 deletions
diff --git a/compiler/systems/t_bsd.pas b/compiler/systems/t_bsd.pas
index 6ccf84b29f..7e7c411617 100644
--- a/compiler/systems/t_bsd.pas
+++ b/compiler/systems/t_bsd.pas
@@ -315,7 +315,12 @@ Begin
if (cs_link_pthread in aktglobalswitches) Then // convert libpthread to libc_r.
LinkLibraryAliases.add('pthread','c_r');
end;
- end;
+ end
+else
+ begin
+ LinkLibraryOrder.add('gcc','',15);
+ LinkLibraryOrder.add('c','',50);
+ end;
End;
Function TLinkerBSD.WriteResponseFile(isdll:boolean) : Boolean;
@@ -366,14 +371,13 @@ begin
if linklibc then
prtobj:=cprtobj;
end;
- if reorder Then
- ExpandAndApplyOrder(SharedLibFiles);
// after this point addition of shared libs not allowed.
end
else
begin
{ for darwin: always link dynamically against libc }
linklibc := true;
+ reorder:=reorderentries;
if not(isdll) then
if not(cs_profile in aktmoduleswitches) then
begin
@@ -388,6 +392,8 @@ begin
prtobj:='';
end;
+ if reorder Then
+ ExpandAndApplyOrder(SharedLibFiles);
{ Open link.res file }
LinkRes:=TLinkRes.Create(outputexedir+Info.ResName);