Bug #67789 MySQL 5.1 MTR test failures if GCC Link Time Optimization (-flto) is used
Submitted: 2 Dec 2012 18:11 Modified: 12 Mar 2013 15:50
Reporter: Laurynas Biveinis (OCA) Email Updates:
Status: Won't fix Impact on me:
None 
Category:MySQL Server: Compiling Severity:S3 (Non-critical)
Version:5.1 revno 3809 OS:Linux (Ubuntu 12.10 x86_64)
Assigned to: Tor Didriksen CPU Architecture:Any

[2 Dec 2012 18:11] Laurynas Biveinis
Description:
If -flto is added to CFLAGS and CXXFLAGS, resulting MySQL fails the following MTR tests:
main.not_embedded_server main.sp_notembedded main.subselect_notembedded main.execution_constants

They all start crashing with deep stacktraces, somewhat reminding of the cases of when MySQL gets the stack direction test wrong.

How to repeat:
Add -flto to CFLAGS and CXXFLAGS, and disable embedded server or build will fail there.
[2 Dec 2012 18:12] Laurynas Biveinis
sp_notembedded:

#0  0x00007f3d494cfbc6 in ___vsprintf_chk (s=0x7f3d3c26aee1 "", flags=1, slen=18446744073709551615, format=0xa6f2c6 "%.*s%.*s%.*s", args=0x7f3d4a3680c8) at vsprintf_chk.c:77
77      vsprintf_chk.c: No such file or directory.
#0  0x00007f3d494cfbc6 in ___vsprintf_chk (s=0x7f3d3c26aee1 "", flags=1, slen=18446744073709551615, format=0xa6f2c6 "%.*s%.*s%.*s", args=0x7f3d4a3680c8) at vsprintf_chk.c:77
#1  0x00007f3d494cfb4d in ___sprintf_chk (s=<optimized out>, flags=<optimized out>, flags@entry=1, slen=<optimized out>, slen@entry=18446744073709551615, format=<optimized out>, format@entry=0xa6f2c6 "%.*
s%.*s%.*s") at sprintf_chk.c:33
#2  0x00000000005d5930 in sp_name::init_qname(THD*) (this=0x7f3d3c26ae98, thd=<optimized out>) at /usr/include/x86_64-linux-gnu/bits/stdio2.h:35
#3  0x000000000083e8b4 in MYSQLparse (yythd=yythd@entry=0xf53460) at sql_yacc.yy:2217
#4  0x0000000000842820 in parse_sql (thd=0xf53460, parser_state=0x7f3d4a3690c0, creation_ctx=0x7f3d3c01d298) at sql_parse.cc:8041
#5  0x0000000000843c85 in db_load_routine(THD*, int, sp_name*, sp_head**, unsigned long, char const*, char const*, char const*, st_sp_chistics&, char const*, long long, long long, Stored_program_creation_
ctx*) [clone .1991912] (thd=0xf53460, type=2, name=<optimized out>, sphp=0x7f3d4a36a170, sql_mode=0, params=<optimized out>, returns=0xa8dad4 "", body=0x7f3d3c01d108 "begin\nset res = res * prm;\nif prm >
 1 then\ncall bug10100p(prm - 1, res);\nend if;\nend", chistics=..., definer=0x7f3d4a36a1a0 "root@localhost", created=20121202210044, modified=20121202210044, creation_ctx=0x7f3d3c01d298) at sp.cc:837
#6  0x0000000000817a04 in sp_find_routine (thd=thd@entry=0xf53460, name=0x7f3d3c2623a8, cp=cp@entry=0xf54e10, cache_only=cache_only@entry=true, type=2) at sp.cc:1511
#7  0x000000000089d3d6 in mysql_execute_command(THD*) (thd=0xf53460) at sql_parse.cc:4481
#8  0x0000000000943a8e in sp_instr_stmt::exec_core(THD*, unsigned int*) (this=0x7f3d3c269b88, thd=<optimized out>, nextp=0x7f3d4a36b310) at sp_head.cc:2980
#9  0x00000000008203ee in sp_lex_keeper::reset_lex_and_exec_core (this=this@entry=0x7f3d3c269bc8, thd=thd@entry=0xf53460, nextp=nextp@entry=0x7f3d4a36b310, open_tables=open_tables@entry=false, instr=instr
@entry=0x7f3d3c269b88) at sp_head.cc:2801
#10 0x000000000082065e in sp_instr_stmt::execute (this=0x7f3d3c269b88, thd=0xf53460, nextp=0x7f3d4a36b310) at sp_head.cc:2923
#11 0x000000000087cd34 in sp_head::execute (this=this@entry=0x7f3d3c260410, thd=thd@entry=0xf53460) at sp_head.cc:1292
#12 0x000000000087d4d5 in sp_head::execute_procedure (this=<optimized out>, thd=<optimized out>, args=0x7f3d3c25ccd8) at sp_head.cc:2023
#13 0x000000000089d496 in mysql_execute_command(THD*) (thd=0xf53460) at sql_parse.cc:4542
#14 0x0000000000943a8e in sp_instr_stmt::exec_core(THD*, unsigned int*) (this=0x7f3d3c25d3d8, thd=<optimized out>, nextp=0x7f3d4a36c810) at sp_head.cc:2980
#15 0x00000000008203ee in sp_lex_keeper::reset_lex_and_exec_core (this=this@entry=0x7f3d3c25d418, thd=thd@entry=0xf53460, nextp=nextp@entry=0x7f3d4a36c810, open_tables=open_tables@entry=false, instr=instr
@entry=0x7f3d3c25d3d8) at sp_head.cc:2801
...
#273 0x00000000008203ee in sp_lex_keeper::reset_lex_and_exec_core (this=this@entry=0x7f3d3c01d018, thd=thd@entry=0xf53460, nextp=nextp@entry=0x7f3d4a3a4f10, open_tables=open_tables@entry=false, instr=instr@entry=0x7f3d3c01cfd8) at sp_head.cc:2801
#274 0x000000000082065e in sp_instr_stmt::execute (this=0x7f3d3c01cfd8, thd=0xf53460, nextp=0x7f3d4a3a4f10) at sp_head.cc:2923
#275 0x000000000087cd34 in sp_head::execute (this=this@entry=0x7f3d3c013f10, thd=thd@entry=0xf53460) at sp_head.cc:1292
#276 0x000000000087d4d5 in sp_head::execute_procedure (this=<optimized out>, thd=<optimized out>, args=0xf55828) at sp_head.cc:2023
#277 0x000000000089d496 in mysql_execute_command(THD*) (thd=0xf53460) at sql_parse.cc:4542
#278 0x0000000000944d67 in _Z11mysql_parseP3THDPcjPPKc.part.129 (thd=0xf53460, rawbuf=<optimized out>, length=<optimized out>, found_semicolon=0x7f3d4a3a6490) at sql_parse.cc:6129
#279 0x000000000094652c in dispatch_command(enum_server_command, THD*, char*, unsigned int) (command=<optimized out>, thd=thd@entry=0xf53460, packet=<optimized out>, packet_length=<optimized out>) at sql_parse.cc:1279
#280 0x0000000000947875 in do_command(THD*) (thd=0xf53460) at sql_parse.cc:893
#281 0x0000000000947a7a in handle_one_connection (arg=<optimized out>) at sql_connect.cc:1454
#282 0x00007f3d4a0dde9a in start_thread (arg=0x7f3d4a3a7700) at pthread_create.c:308
#283 0x00007f3d494bacbd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#284 0x0000000000000000 in ?? ()
[2 Dec 2012 18:12] Laurynas Biveinis
notembedded_server:
#0  0x00000000006d6f50 in check_stack_overrun (thd=0x1801460, buf=<optimized out>, margin=16000) at sql_parse.cc:5754
5754      if ((stack_used=used_stack(thd->thread_stack,(char*) &stack_used)) >=
#0  0x00000000006d6f50 in check_stack_overrun (thd=0x1801460, buf=<optimized out>, margin=16000) at sql_parse.cc:5754
#1  0x00000000006d6fc7 in check_enough_stack_size() [clone .518565] () at mysqld.cc:2909
#2  0x00000000005c4fa4 in p_ere.2520741 (p=p@entry=0x7fd541ba7800, stop=stop@entry=41) at regcomp.c:230
#3  0x00000000005c53ce in p_ere_exp (p=0x7fd541ba7800) at regcomp.c:291
#4  p_ere.2520741 (p=p@entry=0x7fd541ba7800, stop=stop@entry=41) at regcomp.c:235
#5  0x00000000005c53ce in p_ere_exp (p=0x7fd541ba7800) at regcomp.c:291
#6  p_ere.2520741 (p=p@entry=0x7fd541ba7800, stop=stop@entry=41) at regcomp.c:235
#7  0x00000000005c53ce in p_ere_exp (p=0x7fd541ba7800) at regcomp.c:291
...
#3430 p_ere.2520741 (p=p@entry=0x7fd541ba7800, stop=stop@entry=41) at regcomp.c:235
#3431 0x00000000005c53ce in p_ere_exp (p=0x7fd541ba7800) at regcomp.c:291
#3432 p_ere.2520741 (p=p@entry=0x7fd541ba7800, stop=stop@entry=41) at regcomp.c:235
#3433 0x00000000005c53ce in p_ere_exp (p=0x7fd541ba7800) at regcomp.c:291
#3434 p_ere.2520741 (p=p@entry=0x7fd541ba7800, stop=stop@entry=128) at regcomp.c:235
#3435 0x00000000005dc949 in my_regcomp (preg=0x7fd534000ee8, pattern=<optimized out>, cflags=7, charset=0xe39920 <my_charset_latin1>) at regcomp.c:180
#3436 0x00000000006c7ba3 in Item_func_regex::regcomp (this=0x7fd534000e38, send_error=<optimized out>) at item_cmpfunc.cc:4838
#3437 0x00000000008779b4 in Item_func_regex::fix_fields (this=0x7fd534000e38, thd=<optimized out>, ref=<optimized out>) at item_cmpfunc.cc:4887
#3438 0x00000000006977b3 in setup_fields (thd=0x1801460, ref_pointer_array=0x7fd5340027f0, fields=..., mark_used_columns=<optimized out>, sum_func_list=0x7fd534002668, allow_sum_func=<optimized out>) at sql_base.cc:7674
#3439 0x00000000006dd3e1 in JOIN::prepare(Item***, TABLE_LIST*, unsigned int, Item*, unsigned int, st_order*, st_order*, Item*, st_order*, st_select_lex*, st_select_lex_unit*) [clone .part.187.734298] (this=0x7fd534001088, rref_pointer_array=0x1803510, tables_init=<optimized out>, wild_num=<optimized out>, conds_init=<optimized out>, og_num=0, order_init=0x0, group_init=0x0, having_init=0x0, proc_param_init=0x0, select_lex_arg=0x1803338, unit_arg=0x1802f10) at sql_select.cc:520
#3440 0x00000000007fb2e7 in mysql_select (thd=thd@entry=0x1801460, rref_pointer_array=rref_pointer_array@entry=0x1803510, tables=0x0, wild_num=<optimized out>, fields=..., conds=<optimized out>, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147764736, result=result@entry=0x7fd534001068, unit=0x1802f10, select_lex=select_lex@entry=0x1803338) at sql_select.cc:2541
#3441 0x000000000080162d in handle_select (thd=0x1801460, lex=0x1802e70, result=0x7fd534001068, setup_tables_done_option=0) at sql_select.cc:269
#3442 0x000000000082304b in execute_sqlcom_select(THD*, TABLE_LIST*) [clone .622378] (thd=0x1801460, all_tables=0x0) at sql_parse.cc:5212
#3443 0x000000000089b35b in mysql_execute_command(THD*) (thd=0x1801460) at sql_parse.cc:2342
#3444 0x0000000000944d67 in _Z11mysql_parseP3THDPcjPPKc.part.129 (thd=0x1801460, rawbuf=<optimized out>, length=<optimized out>, found_semicolon=0x7fd541ba9490) at sql_parse.cc:6129
#3445 0x000000000094652c in dispatch_command(enum_server_command, THD*, char*, unsigned int) (command=<optimized out>, thd=thd@entry=0x1801460, packet=<optimized out>, packet_length=<optimized out>) at sql_parse.cc:1279
#3446 0x0000000000947875 in do_command(THD*) (thd=0x1801460) at sql_parse.cc:893
#3447 0x0000000000947a7a in handle_one_connection (arg=<optimized out>) at sql_connect.cc:1454
#3448 0x00007fd5418e0e9a in start_thread (arg=0x7fd541baa700) at pthread_create.c:308
#3449 0x00007fd540cbdcbd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#3450 0x0000000000000000 in ?? ()
[2 Dec 2012 18:12] Laurynas Biveinis
subselect_notembedded:

#0  opt_sum_query (thd=0x160c460, tables=0x7fce900610a8, all_fields=..., conds=0x0) at opt_sum.cc:239
239     {
#0  opt_sum_query (thd=0x160c460, tables=0x7fce900610a8, all_fields=..., conds=0x0) at opt_sum.cc:239
#1  0x00000000007f9bf8 in JOIN::_ZN4JOIN8optimizeEv.part.190(void) (this=0x7fce90099118) at sql_select.cc:966
#2  0x0000000000801045 in subselect_single_select_engine::_ZN30subselect_single_select_engine4execEv.part.91(void) (this=0x7fce900614e8) at item_subselect.cc:1942
#3  0x0000000000511e85 in Item_subselect::exec() (this=0x7fce900613f0) at item_subselect.cc:268
#4  0x000000000051220f in Item_singlerow_subselect::val_decimal(my_decimal*) (this=0x7fce900613f0, decimal_value=0x7fce9dc01d10) at item_subselect.cc:610
#5  0x000000000066479f in Item::save_in_field (this=0x7fce900613f0, field=0x7fce90004ef0, no_conversions=<optimized out>) at item.cc:5182
#6  0x00000000005bb05d in Item::save_in_field_no_warnings(Field*, bool) (this=<optimized out>, field=<optimized out>, no_conversions=<optimized out>) at item.cc:997
#7  0x00000000007e8494 in get_mm_leaf(RANGE_OPT_PARAM *, COND *, Field *, KEY_PART *, enum Item_func::Functype, Item *) (param=param@entry=0x7fce9dc02720, conf_func=0x0, conf_func@entry=0x7fce90061528, fi
eld=0x7fce90004ef0, key_part=key_part@entry=0x7fce900be870, type=type@entry=Item_func::GT_FUNC, value=value@entry=0x7fce900613f0) at opt_range.cc:5837
#8  0x00000000007e91bb in get_mm_parts (param=0x7fce9dc02720, cond_func=0x7fce90061528, field=0x7fce90004ef0, type=Item_func::GT_FUNC, value=0x7fce900613f0) at opt_range.cc:5623
#9  0x00000000007e99b0 in get_full_func_mm_tree (param=0x7fce9dc02720, cond_func=0x7fce90061528, field_item=0x7fce900605f8, value=0x7fce900613f0, inv=<optimized out>) at opt_range.cc:5401
#10 0x00000000007ea4b7 in SQL_SELECT::test_quick_select (this=this@entry=0x7fce900afa38, thd=thd@entry=0x160c460, keys_to_use=..., prev_tables=prev_tables@entry=0, limit=<optimized out>, force_quick_range
=force_quick_range@entry=false) at opt_range.cc:2326
#11 0x00000000004dee6a in get_quick_record_count (thd=0x160c460, select=select@entry=0x7fce900afa38, table=0x7fce90048820, keys=keys@entry=0x7fce900af698, limit=<optimized out>) at sql_select.cc:2609
#12 0x00000000007ebeb9 in make_join_statistics (join=join@entry=0x7fce900979b0, tables_arg=0x7fce900602a8, conds=0x7fce90061528, keyuse_array=keyuse_array@entry=0x7fce90098f70) at sql_select.cc:3051
#13 0x00000000007f9a71 in JOIN::_ZN4JOIN8optimizeEv.part.190(void) (this=0x7fce900979b0) at sql_select.cc:1027
#14 0x0000000000801045 in subselect_single_select_engine::_ZN30subselect_single_select_engine4execEv.part.91(void) (this=0x7fce90066ee0) at item_subselect.cc:1942
...
#229 0x00000000007f9a71 in JOIN::_ZN4JOIN8optimizeEv.part.190(void) (this=this@entry=0x7fce90072fc8) at sql_select.cc:1027
#230 0x00000000007fb220 in mysql_select (thd=thd@entry=0x160c460, rref_pointer_array=rref_pointer_array@entry=0x160e510, tables=0x7fce90001650, wild_num=<optimized out>, fields=..., conds=<optimized out>, og_num=1, order=0x0, group=0x7fce90072e48, having=0x0, proc_param=0x0, select_options=2147764736, result=result@entry=0x7fce90072fa8, unit=0x160df10, select_lex=select_lex@entry=0x160e338) at sql_select.cc:2507
#231 0x000000000080162d in handle_select (thd=0x160c460, lex=0x160de70, result=0x7fce90072fa8, setup_tables_done_option=0) at sql_select.cc:269
#232 0x000000000082304b in execute_sqlcom_select(THD*, TABLE_LIST*) [clone .622378] (thd=0x160c460, all_tables=0x7fce90001650) at sql_parse.cc:5212
#233 0x000000000089b35b in mysql_execute_command(THD*) (thd=0x160c460) at sql_parse.cc:2342
#234 0x0000000000944d67 in _Z11mysql_parseP3THDPcjPPKc.part.129 (thd=0x160c460, rawbuf=<optimized out>, length=<optimized out>, found_semicolon=0x7fce9dc3f490) at sql_parse.cc:6129
#235 0x000000000094652c in dispatch_command(enum_server_command, THD*, char*, unsigned int) (command=<optimized out>, thd=thd@entry=0x160c460, packet=<optimized out>, packet_length=<optimized out>) at sql_parse.cc:1279
#236 0x0000000000947875 in do_command(THD*) (thd=0x160c460) at sql_parse.cc:893
#237 0x0000000000947a7a in handle_one_connection (arg=<optimized out>) at sql_connect.cc:1454
#238 0x00007fce9d976e9a in start_thread (arg=0x7fce9dc40700) at pthread_create.c:308
#239 0x00007fce9cd53cbd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#240 0x0000000000000000 in ?? ()
[2 Dec 2012 18:12] Laurynas Biveinis
execution_constants:

#0  find_field_in_tables (thd=0x2935460, item=0x7fde340b2fc8, first_table=0x7fde34000a08, last_table=0x0, ref=0x7fde340b31c0, report_error=IGNORE_EXCEPT_NON_UNIQUE, check_privileges=true, register_tree_ch
ange=true) at sql_base.cc:6399
#1  0x0000000000647902 in Item_field::fix_fields(THD*, Item**) (this=0x7fde340b2fc8, thd=0x2935460, reference=0x7fde340b31c0) at item.cc:4284
#2  0x000000000054fb1f in Item_func::fix_fields(THD*, Item**) [clone .part.93.139881] (this=0x7fde340b3140, thd=0x2935460) at item_func.cc:177
#3  0x00000000006d6a59 in check_stack_overrun (buf=<synthetic pointer>, margin=32000, thd=0x2935460) at sql_parse.cc:5754
#4  Item_func::fix_fields(THD*, Item**) (this=<optimized out>, thd=0x2935460, ref=<optimized out>) at item_func.cc:166
#5  0x000000000054fb1f in Item_func::fix_fields(THD*, Item**) [clone .part.93.139881] (this=0x7fde340b3818, thd=0x2935460) at item_func.cc:177
...
#1476 0x00000000006d6b5b in Item_func_if::fix_fields(THD*, Item**) (this=0x7fde340c62b0, thd=0x2935460, ref=0x7fde340c6448) at item_cmpfunc.cc:2604
#1477 0x000000000054fb1f in Item_func::fix_fields(THD*, Item**) [clone .part.93.139881] (this=0x7fde340c6380, thd=0x2935460) at item_func.cc:177
#1478 0x00000000006d6a59 in check_stack_overrun (buf=<synthetic pointer>, margin=32000, thd=0x2935460) at sql_parse.cc:5754
#1479 Item_func::fix_fields(THD*, Item**) (this=<optimized out>, thd=0x2935460, ref=<optimized out>) at item_func.cc:166
#1480 0x00000000006d6b5b in Item_func_if::fix_fields(THD*, Item**) (this=0x7fde340c6380, thd=0x2935460, ref=0x7fde340c6468) at item_cmpfunc.cc:2604
#1481 0x0000000000697a1b in setup_fields (thd=0x2935460, fields=..., mark_used_columns=<optimized out>, allow_sum_func=<optimized out>, sum_func_list=0x0, ref_pointer_array=0x0) at sql_base.cc:7674
#1482 0x000000000081b959 in mysql_update (thd=0x2935460, table_list=0x7fde34000a08, fields=..., values=..., conds=0x7fde340b31c0, order_num=0, order=0x0, limit=18446744073709551615, handle_duplicates=DUP_
ERROR, ignore=false) at sql_update.cc:344
#1483 0x000000000089b8aa in mysql_execute_command(THD*) (thd=0x2935460) at sql_parse.cc:3189
#1484 0x0000000000944d67 in _Z11mysql_parseP3THDPcjPPKc.part.129 (thd=0x2935460, rawbuf=<optimized out>, length=<optimized out>, found_semicolon=0x7fde45703490) at sql_parse.cc:6129
#1485 0x000000000094652c in dispatch_command(enum_server_command, THD*, char*, unsigned int) (command=<optimized out>, thd=thd@entry=0x2935460, packet=<optimized out>, packet_length=<optimized out>) at sq
l_parse.cc:1279
#1486 0x0000000000947875 in do_command(THD*) (thd=0x2935460) at sql_parse.cc:893
#1487 0x0000000000947a7a in handle_one_connection (arg=<optimized out>) at sql_connect.cc:1454
#1488 0x00007fde4543ae9a in start_thread (arg=0x7fde45704700) at pthread_create.c:308
#1489 0x00007fde44817cbd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#1490 0x0000000000000000 in ?? ()
[2 Dec 2012 18:13] Laurynas Biveinis
$ gcc -v
Using built-in specs.
COLLECT_GCC=/usr/bin/gcc-4.7.real
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.7/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro 4.7.2-2ubuntu1' --with-bugurl=file:///usr/share/doc/gcc-4.7/README.Bugs --enable-languages=c,c++,go,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.7 --enable-shared --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.7 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --enable-plugin --enable-objc-gc --disable-werror --with-arch-32=i686 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.7.2 (Ubuntu/Linaro 4.7.2-2ubuntu1)
[2 Dec 2012 18:37] Laurynas Biveinis
Adjusting the title so that it's 5.1-specific (5.5+ have their own different bugs)
[5 Dec 2012 18:32] Sveta Smirnova
Thank you for the report.

I can not repeat described behavior. How do you compile MySQL? Which configure options do you use?
[5 Dec 2012 19:11] Laurynas Biveinis
Sveta -

Please see my last comment on bug 67790.

My exact 5.1 build procedure is a bit ugly. Please let me know if you want me to distill it to a single ./configure invocation.

=== modified file 'BUILD/SETUP.sh'
--- BUILD/SETUP.sh      2011-06-30 15:37:13 +0000
+++ BUILD/SETUP.sh      2012-12-02 16:13:29 +0000
@@ -184,7 +184,7 @@
 
 max_no_embedded_configs="$SSL_LIBRARY --with-plugins=max"
 max_no_ndb_configs="$SSL_LIBRARY --with-plugins=max-no-ndb --with-embedded-server"
-max_configs="$SSL_LIBRARY --with-plugins=max --with-embedded-server"
+max_configs="$SSL_LIBRARY --with-plugins=max-no-ndb --without-embedded-server"
 
 #
 # CPU and platform specific compilation flags.

=== modified file 'BUILD/compile-amd64-max'
--- BUILD/compile-amd64-max     2010-12-28 23:47:05 +0000
+++ BUILD/compile-amd64-max     2012-12-02 15:30:07 +0000
@@ -17,7 +17,7 @@
 
 path=`dirname $0`
 . "$path/SETUP.sh"
-extra_flags="$amd64_cflags $fast_cflags -g"
+extra_flags="$amd64_cflags $fast_cflags -g -flto"
 extra_configs="$amd64_configs $max_configs"
 
 . "$path/FINISH.sh"

and then BUILD/compile-amd64-max.
[26 Jan 2013 6:24] Sveta Smirnova
Thank you for the feedback.

Verified as described.
[12 Mar 2013 15:48] Tor Didriksen
Note, from 'man gcc':
Combining -flto with -g is currently experimental and expected
to produce wrong results.
[12 Mar 2013 16:09] Tor Didriksen
The actual bug here is probably:
http://bugs.mysql.com/bug.php?id=62856