mariadb/config/ac-macros
Joerg Bruehe 9ff932336e 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).


config/ac-macros/misc.m4:
  Our autoconf function "MYSQL_STACK_DIRECTION" is meant to
  determine whether the stack grows towards higher or towards
  lower addresses.
  It does this by comparing the addresses of a variable
  (which is local to a recursive function) on different
  nesting levels.
  
  This approach requires that the function is really
  implemented as a recursive function, with each nested call
  allocating a new stack frame containing the local variable.
  If, however, the compiler is optimizing so clever that the
  recursive function is implemented by a loop, then this
  test will not produce correct results.
  
  This has happened on HP-UX 11.23 (IA64) when HP's compiler
  was called with optimization "+O2" (not with "+O1"),
  reported as bug#42213.
  
  Rather than starting a race with the compiler and making
  the function so complicated that this optimization does
  not happen, the idea is to prevent the optimization
  by adding a pragma. For HP, this is "#pragma noinline".
  
  If we encounter other compilers which also optimize
  too clever, we may add their pragmas here.
  
  It is a debatable issue whether such pragmas should be
  guarded by conditional compiling or not, the reviewers
  voted to do it.
  It seems HP has different compilers, "ANSI C" and "aCC",
  on the affected platform "__HP_cc" ("ANSI C") is predefined.
  To be on the safe side, the pragma will also take effect
  if HP's "aCC" compiler is used, or any other compiler on HP-UX.
2009-07-30 16:12:26 +02:00
..
alloca.m4 Fixing problem with case insitive file systems. 2004-12-04 11:00:33 -08:00
character_sets.m4 Makefile.am, Info.plist.sh: 2008-02-26 18:36:06 +01:00
check_cpu.m4 Fixing problem with case insitive file systems. 2004-12-04 11:00:33 -08:00
compiler_flag.m4 traditional grep does not have -q option 2006-06-21 20:27:52 -07:00
ha_archive.m4 Fixing problem with case insitive file systems. 2004-12-04 11:00:33 -08:00
ha_berkeley.m4 ha_innodb.m4, Makefile.am, ha_ndbcluster.m4, Makefile.shared, ha_berkeley.m4: 2006-11-27 21:15:25 +01:00
ha_blackhole.m4 Adding rules for building blackhole, also updating test case. 2005-03-25 13:43:42 -08:00
ha_example.m4 Fixing problem with case insitive file systems. 2004-12-04 11:00:33 -08:00
ha_federated.m4 Fixed a typo in the configure --help menu. 2005-09-06 23:32:00 -07:00
ha_innodb.m4 ha_innodb.m4, Makefile.am, ha_ndbcluster.m4, Makefile.shared, ha_berkeley.m4: 2006-11-27 21:15:25 +01:00
ha_ndbcluster.m4 Fix SCI Transporter 2007-05-07 15:25:24 +02:00
ha_tina.m4 Fixing problem with case insitive file systems. 2004-12-04 11:00:33 -08:00
large_file.m4 Fix for bug #31254: "Max_data_length" truncated / reported wrong 2007-10-12 14:03:51 +04:00
misc.m4 Our autoconf function "MYSQL_STACK_DIRECTION" will not work 2009-07-30 16:12:26 +02:00
openssl.m4 Makefile.am, Info.plist.sh: 2008-02-26 18:36:06 +01:00
readline.m4 Fix for Bug#3982 2005-09-14 21:47:24 -07:00
yassl.m4 Use a direct reference to the yassl and taocrypt libtool libraries to link with 2006-09-21 11:37:08 +02:00
zlib.m4 my_memmem.c: 2007-04-11 01:47:42 +02:00