Bug #26157 sql_yacc.cc GCC 3.4.6 causes compile err "sorry, unimplemented: inlining failed"
Submitted: 7 Feb 2007 18:34 Modified: 12 May 2007 16:04
Reporter: John Gilbert Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Server: Compiling Severity:S2 (Serious)
Version:5.0.33 OS:Linux (Slackware Linux 10.2)
Assigned to: CPU Architecture:Any

[7 Feb 2007 18:34] John Gilbert
Description:
Compiling 5.0.33 with GCC 3.4.6 on Slackware 10.2 results in a compile error. Builds of previous versions up to 5.0.27 work fine.

Here's the error with some build info.

if gcc -DMYSQL_SERVER
-DDEFAULT_MYSQL_HOME="\"/usr\""
-DDATADIR="\"/var/lib/mysql\""
-DSHAREDIR="\"/usr/share
/mysql\"" -DHAVE_CONFIG_H -I. -I. -I.. -I../innobase/include -I../innobase/include -I../include -I../include
-I../regex -I.     -DDBUG_OFF -m32 -O3 -march=athlon64 -mfpmath=sse,387
-msse3 -felide-constructors -fno-exce
ptions -fno-rtti   -fno-implicit-templates -fno-exceptions -fno-rtti
-MT sql_base.o -MD -MP -MF ".deps/sql_ba se.Tpo" -c -o sql_base.o sql_base.cc; \^M
        then mv -f ".deps/sql_base.Tpo" ".deps/sql_base.Po"; else rm -f ".deps/sql_base.Tpo"; exit 1; fi^M if gcc -DMYSQL_SERVER -DDEFAULT_MYSQL_HOME="\"/usr\""
-DDATADIR="\"/var/lib/mysql\""
-DSHAREDIR="\"/usr/share
/mysql\"" -DHAVE_CONFIG_H -I. -I. -I.. -I../innobase/include -I../innobase/include -I../include -I../include
-I../regex -I.     -DDBUG_OFF -m32 -O3 -march=athlon64 -mfpmath=sse,387
-msse3 -felide-constructors -fno-exce
ptions -fno-rtti   -fno-implicit-templates -fno-exceptions -fno-rtti
-MT table.o -MD -MP -MF ".deps/table.Tpo " -c -o table.o table.cc; \^M
        then mv -f ".deps/table.Tpo" ".deps/table.Po"; else rm -f ".deps/table.Tpo"; exit 1; fi^M
sp_pcontext.h: In member function `sp_label_t* sp_pcontext::last_label()':^M
sp_pcontext.h:283: sorry, unimplemented: inlining failed in call to
'sp_label_t* sp_pcontext::last_label()':
recursive inlining^M
sql_yacc.cc:287: sorry, unimplemented: called from here^M
make[4]: *** [sql_yacc.o] Error 1

--

How to repeat:
See above.

Suggested fix:
Add a few lines in the code to not inline this macro if using GCC <= 3.4.6.
[8 Feb 2007 7:28] Valeriy Kravchuk
Thank you for a problem report. Please, send/upload (as private file, if you want) your build script. I need to know exact ./configure command line and values of CFLAGS and CXXFLAGS used (I can guess the values from your report, but anyway).
[9 Mar 2007 0:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
[9 Apr 2007 23:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
[12 Apr 2007 16:04] Valeriy Kravchuk
Please, try to repeat with a newer version, 5.0.37, and, in case of the same problem, send the infromation requested earlier.
[12 May 2007 23:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
[23 Jan 2008 21:34] Kris Karas
Encountered same "bug" today compiling 5.0.51a on Slackware 11.

Compared the output of 'configure' between a working compile on a different machine and one with this "bug".  The failing configure differs only in claiming to not support atomic operations.

Looking at 'config.log' to see why atomic operations mysteriously disappeared, there were errors reported by gcc about header files included from /usr/include/asm/.  The actual bug?  SysAdmin error!  :-)  The /usr/include/asm directory (er, symlink to asm-i386) was pointing to header files for a 2.6 kernel, whereas /usr/include/linux was pointing to headers for a 2.4 kernel.

So this "bug" can, I think, be chocked up to missing or incorrect linux kernel header files.