File ocaml-byterun-do-not-alias-function-arguments-to-sigprocma.patch of Package ocaml

From b35e3d48bc392f764e1edc99ce6a1b1a68358ed4 Mon Sep 17 00:00:00 2001
From: Anil Madhavapeddy <anil@recoil.org>
Date: Wed, 2 May 2018 09:44:10 +0100
Subject: byterun: do not alias function arguments to sigprocmask

Recent gcc versions (e.g. as found in Fedora 28) check that
restrict-qualified parameters do not alias each other in
function calls. One such example that triggers a compile
error is sigprocmask in the bytecode runtime.

The error this changeset fixes is:

```
signals.c: In function 'caml_execute_signal':
signals.c:152:33: error: passing argument 3 to restrict-qualified parameter aliases with argument 2 [-Werror=restrict]
   sigprocmask(SIG_BLOCK, &sigs, &sigs);
```

(cherry picked from commit ebcc2f8594138a5ba6b020083fc42d57a914433f)
---
 Changes           | 2 ++
 byterun/signals.c | 8 ++++----
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/byterun/signals.c b/byterun/signals.c
index 6f1811f26..3dc36e494 100644
--- a/byterun/signals.c
+++ b/byterun/signals.c
@@ -144,12 +144,12 @@ void caml_execute_signal(int signal_number, int in_signal_handler)
   void* saved_spacetime_trie_node_ptr;
 #endif
 #ifdef POSIX_SIGNALS
-  sigset_t sigs;
+  sigset_t nsigs, sigs;
   /* Block the signal before executing the handler, and record in sigs
      the original signal mask */
-  sigemptyset(&sigs);
-  sigaddset(&sigs, signal_number);
-  sigprocmask(SIG_BLOCK, &sigs, &sigs);
+  sigemptyset(&nsigs);
+  sigaddset(&nsigs, signal_number);
+  sigprocmask(SIG_BLOCK, &nsigs, &sigs);
 #endif
 #if defined(NATIVE_CODE) && defined(WITH_SPACETIME)
   /* We record the signal handler's execution separately, in the same
openSUSE Build Service is sponsored by