mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-29 11:41:21 +03:00
posix_spawn: fix stack setup on ia64 [BZ #21275]
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>
This commit is contained in:
@ -61,17 +61,18 @@
|
||||
#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
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user