marco 22 лет назад
Родитель
Сommit
0d72eee09e
2 измененных файлов с 28 добавлено и 6 удалено
  1. 17 4
      compiler/systems/t_bsd.pas
  2. 11 2
      compiler/systems/t_linux.pas

+ 17 - 4
compiler/systems/t_bsd.pas

@@ -58,6 +58,7 @@ implementation
       Glibc2,
       Glibc21,
       LdSupportsNoResponseFile : boolean;
+      LibrarySuffix : Char;
       Function  WriteResponseFile(isdll:boolean) : Boolean;
     public
       constructor Create;override;
@@ -205,8 +206,7 @@ procedure TLinkerBSD.SetDefaultInfo;
   This will also detect which libc version will be used
 }
 begin
-  Glibc2:=false;
-  Glibc21:=false;
+  LibrarySuffix:=' ';
 {$ifdef NETBSD}
 {$ifdef M68K}
   LdSupportsNoResponseFile:=true;
@@ -279,9 +279,12 @@ begin
   if cs_profile in aktmoduleswitches then
    begin
      prtobj:=gprtobj;
+{
      if not glibc2 then
       AddSharedLibrary('gmon');
+}
      AddSharedLibrary('c');
+     LibrarySuffix:='p';
      linklibc:=true;
    end
   else
@@ -374,7 +377,12 @@ begin
       end;
      { be sure that libc is the last lib }
      if linklibc then
-      LinkRes.Add('-lc');
+       Begin
+         If LibrarySuffix=' ' Then
+          LinkRes.Add('-lc')
+         else
+          LinkRes.Add('-lc_'+LibrarySuffix)
+       end;
      { when we have -static for the linker the we also need libgcc }
      if (cs_link_staticflag in aktglobalswitches) then
       LinkRes.Add('-lgcc');
@@ -437,6 +445,8 @@ begin
      ((Info.DynamicLinker<>'') and (not SharedLibFiles.Empty)) then
    DynLinkStr:='-dynamic-linker='+Info.DynamicLinker;
 
+  if CShared Then
+   DynLinKStr:=DynLinkStr+' --shared';
 { Write used files and libraries }
   WriteResponseFile(false);
 
@@ -530,7 +540,10 @@ initialization
 end.
 {
   $Log$
-  Revision 1.4  2003-10-11 19:32:04  marco
+  Revision 1.5  2003-10-30 18:35:30  marco
+   * librarysuffix + profiling
+
+  Revision 1.4  2003/10/11 19:32:04  marco
    * -Xd
 
   Revision 1.3  2003/10/03 14:16:48  marco

+ 11 - 2
compiler/systems/t_linux.pas

@@ -435,7 +435,13 @@ begin
    StripStr:='-s';
   If (cs_profile in aktmoduleswitches) or
      ((Info.DynamicLinker<>'') and (not SharedLibFiles.Empty)) then
-   DynLinkStr:='-dynamic-linker='+Info.DynamicLinker;
+   begin
+     DynLinkStr:='-dynamic-linker='+Info.DynamicLinker;
+     if cshared Then
+       DynLinkStr:='--shared ' + DynLinkStr;
+     if rlinkpath<>'' Then
+       DynLinkStr:='--rpath-link '+rlinkpath + ' '+ DynLinkStr;
+   End;
 
 { Write used files and libraries }
   WriteResponseFile(false);
@@ -556,7 +562,10 @@ end.
 
 {
   $Log$
-  Revision 1.11  2003-10-11 19:32:04  marco
+  Revision 1.12  2003-10-30 18:35:30  marco
+   * librarysuffix + profiling
+
+  Revision 1.11  2003/10/11 19:32:04  marco
    * -Xd
 
   Revision 1.10  2003/10/03 14:16:48  marco