Browse Source

sparc32 bit needs SA_SIGINFO

git-svn-id: trunk@42748 -
pierre 6 years ago
parent
commit
e8ae490128
1 changed files with 8 additions and 1 deletions
  1. 8 1
      rtl/linux/ossysc.inc

+ 8 - 1
rtl/linux/ossysc.inc

@@ -343,8 +343,15 @@ function Fpsigaction(sig: cint; new_action, old_action: psigactionrec): cint; [p
 begin
 {$if defined(cpusparc) or defined(cpusparc64)}
   { Sparc has an extra stub parameter }
+{$ifdef cpusparc}
+  { it seems that rt_sigreturn only works correctly for 32-bit if SA_SIGINFO is set }
+  if new_action <> nil then
+    new_action^.sa_flags:=new_action^.sa_flags or SA_SIGINFO;
+{$endif}
+  { the -8 stems from the fact that the adress is supposed to be a value from a sub-routine
+    call stored into register %i7 to which +8 is added upon return }
   Fpsigaction:=do_syscall(syscall_nr_rt_sigaction,TSysParam(sig),TSysParam(new_action),TSysParam(old_action),TSysParam(ptruint(@Fprt_sigreturn_stub)-8),TSysParam(8));
-{$else cpusparc}
+{$else not (defined(cpusparc) or defined(cpusparc64))}
 {$ifdef NEED_USER_TRAMPOLINE}
   if new_action <> nil then
   begin