Browse Source

* link reordering

git-svn-id: trunk@4016 -
marco 19 years ago
parent
commit
2aadf05093
1 changed files with 9 additions and 3 deletions
  1. 9 3
      compiler/systems/t_bsd.pas

+ 9 - 3
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);