Преглед на файлове

* first shared library link path fixes
* PowerPC64/Linux signal handler now differs between different FP exceptions

git-svn-id: trunk@1452 -

tom_at_work преди 20 години
родител
ревизия
4db863d076
променени са 2 файла, в които са добавени 13 реда и са изтрити 15 реда
  1. 5 1
      compiler/systems/t_linux.pas
  2. 8 14
      rtl/linux/powerpc64/sighnd.inc

+ 5 - 1
compiler/systems/t_linux.pas

@@ -193,7 +193,11 @@ begin
 {$ifdef x86_64}
    LibrarySearchPath.AddPath('/lib64;/usr/lib64;/usr/X11R6/lib64',true);
 {$else}
+{$ifdef powerpc64}
+   LibrarySearchPath.AddPath('/lib64;/usr/lib64;/usr/X11R6/lib64',true);
+{$else powerpc64}
    LibrarySearchPath.AddPath('/lib;/usr/lib;/usr/X11R6/lib',true);
+{$endif powerpc64}
 {$endif x86_64}
 end;
 
@@ -276,7 +280,7 @@ begin
 {$endif powerpc}
 
 {$ifdef powerpc64}
-     DynamicLinker:='/lib64/ld.so.1';
+     DynamicLinker:='/lib64/ld64.so.1';
      libctype:=glibc2;
 {$endif powerpc64}
 

+ 8 - 14
rtl/linux/powerpc64/sighnd.inc

@@ -19,7 +19,7 @@
 procedure SignalToRunerror(sig : longint; SigInfo: PSigInfo; SigContext: PSigContext);cdecl;
 var
   res : word;
-  fpustate : qword;
+  fpustate : dword;
   {$IFDEF EXCDEBUG}
   p : pbyte;
   i, j : integer;
@@ -54,19 +54,18 @@ begin
     SIGFPE :
       begin
         { ugly typecast to get the FPSCR register contents }
-        fpustate := QWord(PQWord(@SigContext^.fp_regs[PT_FPSCR])^);
+        fpustate := DWord(PDWord(@SigContext^.fp_regs[PT_FPSCR])^);
         {$IFDEF EXCDEBUG}
         writeln('fpustate = ', hexstr(fpustate, sizeof(fpustate)*2));
         {$ENDIF}
-
-        { TODO: distinguishing FPU signal type does not work as it should 
+        { distinguish between the different FPU exceptions }
         if (fpustate and ppc_fpu_underflow) <> 0 then
           res := 206
         else if (fpustate and ppc_fpu_overflow) <> 0 then
           res := 205
         else if (fpustate and ppc_fpu_divbyzero) <> 0 then
           res := 200
-        else }
+        else
           res := 207;
       end;
     SIGBUS :
@@ -84,16 +83,11 @@ begin
   
   writeln('sigcontext^...regs = ', hexstr(ptrint(sigcontext^.regs), 16));
   {$ENDIF}
-  // reenable signals
+  { reenable signal }
   reenable_signal(sig);
 
-  // give runtime error at the position where the signal was raised, using the 
-  // system trampoline
-  if res<>0 then begin
-    SigContext^.gp_regs[PT_R3] := res;
-    SigContext^.gp_regs[PT_R4] := SigContext^.gp_regs[PT_NIP];
-    SigContext^.gp_regs[PT_R5] := SigContext^.gp_regs[PT_R1];
-    SigContext^.handler := ptruint(@HandleErrorAddrFrame);
-  end;
+  { handle error }
+  if res<>0 then
+    HandleErrorAddrFrame(res, Pointer(SigContext^.gp_regs[PT_NIP]), Pointer(SigContext^.gp_regs[PT_R1]));
 end;