Bug #5353 MySQL 4.1.4 will not compile on AIX, HP-UX and Solaris with vendor compiler
Submitted: 1 Sep 2004 19:35 Modified: 3 Sep 2004 18:25
Reporter: Frank Faubert Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Compiling Severity:S2 (Serious)
Version:4.1.4 gamma OS:IBM AIX (AIX, HP-UX, Solaris)
Assigned to: Lenz Grimmer CPU Architecture:Any

[1 Sep 2004 19:35] Frank Faubert
Description:
Using the vendor compilers gives you the following errors:

AIX:
make[3]: Entering directory `/home/frank/PORT/mysql-4.1.4-gamma/cmd-line-utils/libedit'
xlc_r -DUNDEF_THREADS_HACK -DHAVE_CONFIG_H -DNO_KILL_INTR '-D__RCSID(x)=' '-D__COPYRIGHT(x)=' '-D__RENAME(x)=' '-D_DIAGASSERT(x)=' -I. -I. -I../.. -I../../include -I./../.. -I..    -O -DDBUG_OFF -O -qmaxmem=-1 -qarch=com -qtune=auto   -c `test -f 'chared.c' || echo './'`chared.c
1506-261 (W) Suboption __RCSID(x) is not valid for option D.
1506-261 (W) Suboption __COPYRIGHT(x) is not valid for option D.
1506-261 (W) Suboption __RENAME(x) is not valid for option D.
1506-261 (W) Suboption _DIAGASSERT(x) is not valid for option D.
"chared.c", line 44.9: 1506-275 (S) Unexpected text string literal encountered.
"chared.c", line 44.1: 1506-273 (E) Missing type in declaration of __RCSID.

HP-UX:
cc -DUNDEF_THREADS_HACK -DHAVE_CONFIG_H -DNO_KILL_INTR '-D__RCSID(x)=' '-D__COPYRIGHT(x)=' '-D__RENAME(x)=' '-D_DIAGASSERT(x)=' -I. -I. -I../.. -I../../include -I./../.. -I..    -O -DDBUG_OFF -mt +z -O +DA1.0 +DS1.0 -Ae +Onolimit   -DHPUX11 -DHAVE_BROKEN_PREAD -DDONT_USE_FINITE -DHAVE_BROKEN_GETPASS -DNO_FCNTL_NONBLOCK -DDO_NOT_REMOVE_THREAD_WRAPPERS -DHAVE_BROKEN_PTHREAD_COND_TIMEDWAIT -DHAVE_BROKEN_INLINE -c `test -f 'chared.c' || echo './'`chared.c
cpp: "", line 0: warning 2003: Illegal argument to '-D' option.
cpp: "", line 0: warning 2003: Illegal argument to '-D' option.
cpp: "", line 0: warning 2003: Illegal argument to '-D' option.
cpp: "", line 0: warning 2003: Illegal argument to '-D' option.
cc: "chared.c", line 44: error 1000: Unexpected symbol: "$NetBSD: chared.c,v 1.18 2002/11/20 16:50:08 christos Exp $".
cc: "chared.c", line 44: warning 557: Missing declaration specifiers, "int" assumed.
cc: "chared.c", line 44: error 1506: Parameters allowed in function definition only.

Solaris:
cc -DUNDEF_THREADS_HACK -DHAVE_CONFIG_H -DNO_KILL_INTR '-D__RCSID(x)=' '-D__COPYRIGHT(x)=' '-D__RENAME(x)=' '-D_DIAGASSERT(x)=' -I. -I. -I../.. -I../../include -I./../.. -I..    -O -DDBUG_OFF -fast -xtarget=generic   -D_FILE_OFFSET_BITS=64 -DHAVE_CURSES_H -I/export/home/frank/PORT/mysql-4.1.4-gamma/include -DHAVE_RWLOCK_T -c `test -f 'chared.c' || echo './'`chared.c
command line: warning: -D option argument not followed by "="
command line: warning: -D option argument not followed by "="
command line: warning: -D option argument not followed by "="
command line: warning: -D option argument not followed by "="
"chared.c", line 44: syntax error before or at: 1
"chared.c", line 44: warning: syntax error:  empty declaration
"chared.c", line 79: cannot recover from previous errors
cc: acomp failed for chared.c

How to repeat:
Try to compile, after working around bug 5319.
[1 Sep 2004 21:38] Sergei Golubchik
And the same solution - compile with readline or wait for 4.1.4a.
Sorry for this :(
[2 Sep 2004 8:43] Lenz Grimmer
We updated libedit recently and the code required some additional modifications to be more non-gcc compiler friendly. These modifications will be applied on top of the 4.1.4 release sources, which will then be released as 4.1.4a.

We are currently testing one remaining patch - the other libedit-related modifications can already be obtained from BK - look for ChangeSet 1.2016.2.2, 1.2016.2.3 and 1.2016.2.4 on  http://mysql.bkbits.net:8080/mysql-4.1
[3 Sep 2004 18:25] Lenz Grimmer
These compile problems should now be fixed in the 4.1.4a source tarball that just has been uploaded to our staging server. The Download pages will be updated as soon as the mirrors have caught up. 

We applied the following BK ChangeSets on top of the tagged 4.1.4 sources to fix these libedit compile problems:

ChangeSet
  1.1983.27.1 04/09/03 17:47:36 vva@eagle.mysql.r18.ru +11 -0
  1. discarded term.h from the distribution
  2. changed key_* to el_ley_* in the libedit key.h
     (because it's in the conflict with the aix definitions)
  3. use libedit_term.h instead of term.h in the cmd-line-utils/libedit/el.h
  4. added definition of MIN in the cmd-line-utils/libedit/read.c
     (if it wasn't defined yet)
  5. discarded definition of SUNOS macro from configure.in
     (now we don't include term.h in the el.h at all)

ChangeSet
  1.1983.18.4 04/08/31 18:29:01 vva@eagle.mysql.r18.ru +4 -0
  fixed two compiling bugs for libedit

ChangeSet
  1.1983.18.3 04/08/31 17:51:02 vva@eagle.mysql.r18.ru +1 -0
  fixed compiling bug of libedit on qnx
  discarded using of uint in cmd-line-utils/libedit/chared.c
  because it's undefined on qnx

ChangeSet
  1.1983.18.2 04/08/31 17:29:47 vva@eagle.mysql.r18.ru +4 -0
  fixed compiling bug
  (non gcc compilers don't understand '-Dx()=' option)

ChangeSet
  1.2021 04/08/27 22:52:33 lenz@mysql.com +1 -0
   - adding more missing libedit files

ChangeSet
  1.2020 04/08/27 21:18:51 lenz@mysql.com +1 -0
   - add missing file "read.h" to the source distribution

ChangeSet
  1.1985.3.3 04/08/27 20:32:28 vva@eagle.mysql.r18.ru +1 -0
  fixed format of history of new libedit for compatibility
   with old libedit and readline

  1. discarded reading and writting of hist_cookie as the begin of the file
  2. skip strvis for string before saving

In addition to that, 4.1.4a hopefully fixes BUG#5319

Note that the GPL binaries are not affected by these modifications, as the have been compiled against readline. Therefore they will not be updated to 4.1.4a.