Browse Source

* pthread on -CURRENT related fixes.

marco 21 years ago
parent
commit
9a83a21c64
3 changed files with 28 additions and 15 deletions
  1. 6 2
      compiler/globtype.pas
  2. 6 1
      compiler/options.pas
  3. 16 12
      compiler/systems/t_bsd.pas

+ 6 - 2
compiler/globtype.pas

@@ -80,7 +80,8 @@ interface
          cs_asm_regalloc,cs_asm_tempalloc,cs_asm_nodes,
          { linking }
          cs_link_extern,cs_link_static,cs_link_smart,cs_link_shared,cs_link_deffile,
-         cs_link_strip,cs_link_staticflag,cs_link_on_target,cs_link_internal,cs_link_map
+	 cs_link_strip,cs_link_staticflag,cs_link_on_target,cs_link_internal,
+	 cs_link_map,cs_link_pthread
        );
        tglobalswitches = set of tglobalswitch;
 
@@ -234,7 +235,10 @@ implementation
 end.
 {
   $Log$
-  Revision 1.48  2003-12-23 23:22:35  peter
+  Revision 1.49  2004-02-15 16:34:18  marco
+   * pthread on -CURRENT related fixes.
+
+  Revision 1.48  2003/12/23 23:22:35  peter
     * register calling is now default for i386
 
   Revision 1.47  2003/12/14 20:51:17  daniel

+ 6 - 1
compiler/options.pas

@@ -1099,6 +1099,8 @@ begin
                       include(initglobalswitches,cs_link_internal);
                     'm' :
                       include(initglobalswitches,cs_link_map);
+		    'f' :
+		      include(initglobalswitches,cs_link_pthread);
                     's' :
                       include(initglobalswitches,cs_link_strip);
                     'c' : Cshared:=TRUE;
@@ -1996,7 +1998,10 @@ finalization
 end.
 {
   $Log$
-  Revision 1.123  2004-02-03 00:42:08  florian
+  Revision 1.124  2004-02-15 16:34:18  marco
+   * pthread on -CURRENT related fixes.
+
+  Revision 1.123  2004/02/03 00:42:08  florian
     + FPC_PREFETCH defined
 
   Revision 1.122  2004/01/24 18:12:40  florian

+ 16 - 12
compiler/systems/t_bsd.pas

@@ -74,8 +74,6 @@ implementation
 
     tlinkerbsd=class(texternallinker)
     private
-      Glibc2,
-      Glibc21,
       LdSupportsNoResponseFile : boolean;
       LibrarySuffix : Char;
       Function  WriteResponseFile(isdll:boolean) : Boolean;
@@ -460,6 +458,7 @@ Var
   prtobj       : string[80];
   HPath        : TStringListItem;
   s,s1,s2      : string;
+  linkpthread,
   linkdynamic,
   linklibc     : boolean;
   Fl1,Fl2      : Boolean;
@@ -471,21 +470,22 @@ begin
     begin
       linkdynamic:=not(SharedLibFiles.empty);
       linklibc:=(SharedLibFiles.Find('c')<>nil);
+      linkpthread:=(SharedLibFiles.Find('pthread')<>nil);
+      if (target_info.system =system_i386_freebsd) and linkpthread Then
+        Begin
+          if not (cs_link_pthread in aktglobalswitches) Then
+	    begin
+	      {delete pthreads from list, in this case it is in libc_r}
+	      SharedLibFiles.Remove(SharedLibFiles.Find('pthread').str);
+	      LibrarySuffix:='r'; 	
+	    end;
+        End;
       prtobj:='prt0';
       cprtobj:='cprt0';
       gprtobj:='gprt0';
-      if glibc21 then
-       begin
-         cprtobj:='cprt21';
-         gprtobj:='gprt21';
-       end;
       if cs_profile in aktmoduleswitches then
        begin
          prtobj:=gprtobj;
-    {
-         if not glibc2 then
-          AddSharedLibrary('gmon');
-    }
          AddSharedLibrary('c');
          LibrarySuffix:='p';
          linklibc:=true;
@@ -506,6 +506,7 @@ begin
         prtobj:='/usr/lib/gcrt1.o';
     end;
 
+
   { Open link.res file }
   LinkRes:=TLinkRes.Create(outputexedir+Info.ResName);
 
@@ -759,7 +760,10 @@ initialization
 end.
 {
   $Log$
-  Revision 1.8  2004-01-21 20:53:51  marco
+  Revision 1.9  2004-02-15 16:34:18  marco
+   * pthread on -CURRENT related fixes.
+
+  Revision 1.8  2004/01/21 20:53:51  marco
    * Copy and pasted some structures from Net- to OpenBSD (3.4+ ELF!)
 
   Revision 1.7  2004/01/05 08:13:30  jonas