Change how stack grows on HPPA.
authorJohn David Anglin <dave.anglin@bell.net>
Fri, 4 Oct 2024 23:12:57 +0000 (01:12 +0200)
committerPatrick Franz <deltaone@debian.org>
Fri, 4 Oct 2024 23:12:57 +0000 (01:12 +0200)
Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1042018
Reviewed-by: Lisandro Damián Nicanor Pérez Meyer <lisandro@debian.org>
Last-Update: 2023-07-28

On HPPA stack grows upwards. This patch introduces this change for
this 3rd party code.

Gbp-Pq: Name forkfd_grow_stack_upwards_on_hppa.patch

src/3rdparty/forkfd/forkfd_linux.c

index 4dacc1919d49a5ccdc0e19ba823cc9b10baf2eea..40b02657f382449142032f1a896c384008139f83 100644 (file)
@@ -169,7 +169,12 @@ int system_vforkfd(int flags, pid_t *ppid, int (*childFn)(void *), void *token,
     }
     *system = 1;
 
+#if defined(__hppa__)
+    /* Stack grows up */
+    pid = clone(childFn, childStack, cloneflags, token, &pidfd, NULL, NULL);
+#else
     pid = clone(childFn, childStack + sizeof(childStack), cloneflags, token, &pidfd, NULL, NULL);
+#endif
     if (pid < 0)
         return pid;
     if (ppid)