diff options
author | Joerg Bruehe <joerg@mysql.com> | 2009-07-30 16:12:26 +0200 |
---|---|---|
committer | Joerg Bruehe <joerg@mysql.com> | 2009-07-30 16:12:26 +0200 |
commit | 60021617bdc377b58d03f42f7366362ac02eeb7d (patch) | |
tree | 6478b47c0e56349b05af4780fe7cfc376c98a0d9 | |
parent | 26f88fa1d7aa485eed10be7df9e93794d059eabc (diff) | |
download | mariadb-git-60021617bdc377b58d03f42f7366362ac02eeb7d.tar.gz |
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).
-rw-r--r-- | config/ac-macros/misc.m4 | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/config/ac-macros/misc.m4 b/config/ac-macros/misc.m4 index aef1eeaf935..9e575862848 100644 --- a/config/ac-macros/misc.m4 +++ b/config/ac-macros/misc.m4 @@ -583,6 +583,10 @@ fi AC_DEFUN([MYSQL_STACK_DIRECTION], [AC_CACHE_CHECK(stack direction for C alloca, ac_cv_c_stack_direction, [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 () { static char *addr = 0; |