Bug #3937 fails to compile with both gcc 3.3.3/icc8
Submitted: 30 May 2004 21:44 Modified: 24 Aug 2004 18:17
Reporter: Kaj J. Niemi Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Compiling Severity:S2 (Serious)
Version:4.1.2 OS:Linux (FC2/Rawhide)
Assigned to: Bugs System CPU Architecture:Any

[30 May 2004 21:44] Kaj J. Niemi
Description:

% rpm -q intel-icc8
intel-icc8-8.0-44

... 

Making all in client
make[2]: Entering directory `/home/kajtzu/rpm/BUILD/mysql-4.1.2-alpha/client'
source='mysql.cc' object='mysql.o' libtool=no \
depfile='.deps/mysql.Po' tmpdepfile='.deps/mysql.TPo' \
depmode=gcc /bin/sh ../depcomp \
icc -DUNDEF_THREADS_HACK -I. -I. -I.. -I../include     -O3 -DDBUG_OFF -O2 -g -pipe -march=i386 -mcpu=i686 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOUR CE -fno-rtti -fno-exceptions   -fno-implicit-templates -fno-exceptions -fno-rtti  -c -o mysql.o mysql.cc
icc: Command line warning: overriding '-O3' with '-O2'
icc: Command line warning: ignoring option '-p'; no argument required
icc: Command line warning: ignoring unknown option '-fno-implicit-templates'
sql_string.h(20): warning #161: unrecognized #pragma
  #pragma interface                     /* gcc class implementation */
          ^
 
mysql.cc(307): error: identifier "HIST_ENTRY" is undefined
  extern "C" HIST_ENTRY *history_get(int num);
             ^
 
mysql.cc(1269): error: identifier "HIST_ENTRY" is undefined
    HIST_ENTRY *oldhist = history_get(history_length);
    ^
 
mysql.cc(1269): error: identifier "oldhist" is undefined
    HIST_ENTRY *oldhist = history_get(history_length);
                ^
 
compilation aborted for mysql.cc (code 2)
make[2]: *** [mysql.o] Error 2
make[2]: Leaving directory `/home/kajtzu/rpm/BUILD/mysql-4.1.2-alpha/client'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/kajtzu/rpm/BUILD/mysql-4.1.2-alpha'
make: *** [all] Error 2
error: Bad exit status from /var/tmp/rpm-tmp.60872 (%build)

How to repeat:
Build as normal with ICC as compiler.
[30 May 2004 22:01] Kaj J. Niemi
Hmm. It actually fails to build with gcc 3.3.3-7 too at the same point.

make[2]: Entering directory `/home/kajtzu/rpm/BUILD/mysql-4.1.2-alpha/client'
if g++ -DUNDEF_THREADS_HACK -I. -I. -I.. -I../include     -O3 -DDBUG_OFF -O2 -g -pipe -march=i386 -mcpu=i686 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -fno-rtti -fno-exceptions  -fno-implicit-templates -fno-exceptions -fno-rtti -MT mysql.o -MD -MP -MF ".deps/mysql.Tpo" -c -o mysql.o mysql.cc; \
then mv -f ".deps/mysql.Tpo" ".deps/mysql.Po"; else rm -f ".deps/mysql.Tpo"; exit 1; fi
mysql.cc:307: error: syntax error before `*' token
mysql.cc: In function `int not_in_history(const char*)':
mysql.cc:1269: error: `HIST_ENTRY' undeclared (first use this function)
mysql.cc:1269: error: (Each undeclared identifier is reported only once for
   each function it appears in.)
mysql.cc:1269: error: `oldhist' undeclared (first use this function)
mysql.cc:1269: error: `history_get' undeclared (first use this function)
make[2]: *** [mysql.o] Error 1
make[2]: Leaving directory `/home/kajtzu/rpm/BUILD/mysql-4.1.2-alpha/client'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/kajtzu/rpm/BUILD/mysql-4.1.2-alpha'
make: *** [all] Error 2
error: Bad exit status from /var/tmp/rpm-tmp.30367 (%build)
[30 May 2004 22:04] Kaj J. Niemi
Seems to apply to both gcc and icc.
[31 May 2004 20:18] Sergei Golubchik
Victor, it's the same issue you're already working on...
[3 Jun 2004 0:53] M. Mellor
FreeBSD ports collections contains a patch for this issues :

--- client/mysql.cc.orig        Wed Jun  2 09:11:24 2004
+++ client/mysql.cc     Wed Jun  2 09:13:19 2004
@@ -294,7 +294,7 @@
  HIST_ENTRY is defined for libedit, but not for the real readline
  Need to redefine it for real readline to find it
 */
-#if !defined(USE_LIBEDIT_INTERFACE)
+#if !defined(HIST_ENTRY)
 typedef struct _hist_entry {
   const char      *line;
   const char      *data;
[3 Jun 2004 8:39] Kaj J. Niemi
The patch from FreeBSD collections fixes it on Linux, too. I was using libreadline 4.3 (4.3-10.1)
[17 Jun 2004 19:06] Victor Vagin
bk commit - 4.1 tree (vva:1.1920) BUG#3937

ChangeSet
  1.1920 04/06/18 00:53:42 vva@eagle.mysql.r18.ru +63 -0
  1. upgraded to libedit-2.6.7
  2. fixed several compatibility problems
  3. added tests mysql_tty and mysql_tty and infrastructure for them to test 
     libedit/readlines features
  4. fixed bug #3937 "fails to compile with both gcc 3.3.3/icc8"
[4 Aug 2004 23:46] Robert Seaborn
Errors also apply to version 5.0.1 .
[19 Aug 2004 10:52] Lenz Grimmer
Has that patch been pushed yet? Or is it still waiting for review?
[24 Aug 2004 18:17] Victor Vagin
Thank you for your bug report. This issue has been committed to our
source repository of that product and will be incorporated into the
next release.

If necessary, you can access the source repository and build the latest
available version, including the bugfix, yourself. More information 
about accessing the source trees is available at
    http://www.mysql.com/doc/en/Installing_source_tree.html

Additional info:

The fix will be in the mysql-4.1.4