Commit 60021617 authored by Joerg Bruehe's avatar Joerg Bruehe

Our autoconf function "MYSQL_STACK_DIRECTION" will not work

correctly if the compiler optimizes too clever.

This has happaned on HP-UX 11.23 (IA64) at optimization
level "+O2", causing bug#42213:
   Check for "stack overrun" doesn't work, server crashes

Fix it by adding a pragma that prevents this optimization.
As a result, it should be safe to use "+O2" on this platform
(unless there is some other, optimizer-related, bug which
is just currently masked because we use resudec optimization).
parent 26f88fa1
...@@ -583,6 +583,10 @@ fi ...@@ -583,6 +583,10 @@ fi
AC_DEFUN([MYSQL_STACK_DIRECTION], AC_DEFUN([MYSQL_STACK_DIRECTION],
[AC_CACHE_CHECK(stack direction for C alloca, ac_cv_c_stack_direction, [AC_CACHE_CHECK(stack direction for C alloca, ac_cv_c_stack_direction,
[AC_TRY_RUN([#include <stdlib.h> [AC_TRY_RUN([#include <stdlib.h>
/* Prevent compiler optimization by HP's compiler, see bug#42213 */
#if defined(__HP_cc) || defined (__HP_aCC) || defined (__hpux)
#pragma noinline
#endif
int find_stack_direction () int find_stack_direction ()
{ {
static char *addr = 0; static char *addr = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment