]> sourceware.org Git - glibc.git/commitdiff
posix_spawn: fix stack setup on ia64 [BZ #21275] gentoo/2.25
authorMike Frysinger <vapier@gentoo.org>
Mon, 20 Mar 2017 08:47:56 +0000 (04:47 -0400)
committerMike Frysinger <vapier@gentoo.org>
Mon, 20 Mar 2017 14:57:14 +0000 (10:57 -0400)
The ia64-specific clone2 call expects the base of the stack mapping and
the stack size as sep arguments, not an initial stack value as on other
stack-grows-down architectures.  Reuse the stack-grows-up macro so we
pass in the right stack base.

Reported-by: Matt Turner <mattst88@gentoo.org>
(cherry picked from commit ddc3fb333469c2997798742dc0509dc1e3201d91)
(cherry picked from commit 27ab0d9518746dfb59ed2ba59daefc981dc10e38)

sysdeps/unix/sysv/linux/spawni.c

index 2daf0c5ef040032aac015dee9f86028c3d2a58ee..c96aac889d4b8e6b18003546ac2168ad0283cddf 100644 (file)
 #define SPAWN_ERROR    127
 
 #ifdef __ia64__
-# define CLONE(__fn, __stack, __stacksize, __flags, __args) \
-  __clone2 (__fn, __stack, __stacksize, __flags, __args, 0, 0, 0)
+# define CLONE(__fn, __stackbase, __stacksize, __flags, __args) \
+  __clone2 (__fn, __stackbase, __stacksize, __flags, __args, 0, 0, 0)
 #else
 # define CLONE(__fn, __stack, __stacksize, __flags, __args) \
   __clone (__fn, __stack, __flags, __args)
 #endif
 
-#if _STACK_GROWS_DOWN
-# define STACK(__stack, __stack_size) (__stack + __stack_size)
-#elif _STACK_GROWS_UP
+/* Since ia64 wants the stackbase w/clone2, re-use the grows-up macro.  */
+#if _STACK_GROWS_UP || defined (__ia64__)
 # define STACK(__stack, __stack_size) (__stack)
+#elif _STACK_GROWS_DOWN
+# define STACK(__stack, __stack_size) (__stack + __stack_size)
 #endif
 
 
This page took 0.044297 seconds and 5 git commands to generate.