Bug #11397 unable to compile mysql on axp v5.1
Submitted: 16 Jun 2005 20:23 Modified: 27 Aug 2005 18:30
Reporter: James Woodworth Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Server: Compiling Severity:S3 (Non-critical)
Version:4.1.12 OS:OSF1 V5.1 2650 alpha
Assigned to: Assigned Account CPU Architecture:Any

[16 Jun 2005 20:23] James Woodworth
Description:
unaware if compiler bug or a misconfiguration on my part.

needing client libs and client utils, i reviewed the manual page (and others) at:
http://dev.mysql.com/doc/mysql/en/alpha-dec-unix.html
i chose the following config:

CC="cc -pthread" \
CFLAGS="-O3 -ansi_alias -ansi_args -fast -inline speed -speculate all -arch host" \
CXX="cxx -pthread" \
CXXFLAGS="-O3 -ansi_alias -ansi_args -fast -inline speed -speculate all -arch host -noexceptions -nortti" \
./configure \
--prefix=/sw/mysql/4.1.12/clients/axp51 \
--without-server \
--with-extra-charsets=complex \
--enable-thread-safe-client \
--enable-shared \
--enable-large-files \
--enable-local-infile \
--with-named-thread-libs="-lpthread -lmach -lexc -lc"

i am observing the following compilation error messages:

/bin/ksh ../libtool --preserve-dup-deps --mode=link cc -pthread  -O -DDBUG_OFF -O0 -ansi_alias -ansi_args -fast -inline speed -speculate all -arch host
   -DUNDEF_HAVE_GETHOSTBYNAME_R -DSNPRINTF_RETURN_TRUNC   -o libz.la -rpath /sw/mysql/4.1.12/clients/axp51/lib/mysql  adler32.lo compress.lo crc32.lo d
eflate.lo gzio.lo infback.lo inffast.lo inflate.lo inftrees.lo trees.lo uncompr.lo zutil.lo  -lpthread -lmach -lexc -lc -lm  -lpthread -lmach -lexc -lc

/bin/ld -shared -expect_unresolved \*  .libs/adler32.o .libs/compress.o .libs/crc32.o .libs/deflate.o .libs/gzio.o .libs/infback.o .libs/inffast.o .lib
s/inflate.o .libs/inftrees.o .libs/trees.o .libs/uncompr.o .libs/zutil.o  -pthread -lpthread -lmach -lexc -lc -lm -lpthread -lmach -lexc -lc -lc  -msym
 -soname libz.so.0 `test -n "0.0.0:0.0" && echo -set_version 0.0.0:0.0` -update_registry .libs/so_locations -o .libs/libz.so.0.0.0
/bin/ld:
-pthread: Unknown flag
/bin/ld: Usage: /bin/ld [options] file [...]
gmake.axp51[2]: *** [libz.la] Error 1
gmake.axp51[2]: Leaving directory `/tmp_mnt/rs1/mysql/mysql-4.1.12/zlib'
gmake.axp51[1]: *** [all-recursive] Error 1
gmake.axp51[1]: Leaving directory `/tmp_mnt/rs1/mysql/mysql-4.1.12'
gmake.axp51: *** [all] Error 2

this is my machine configuration:
OSF1 V5.1 2650 alpha
$ cc -V
Compaq C V6.5-011 on Compaq Tru64 UNIX V5.1B (Rev. 2650)
Compiler Driver V6.5-003 (sys) cc Driver
$ cxx -V
Compaq C++ V6.5-014 for Compaq Tru64 UNIX V5.1B (Rev. 2650)
Compiler Driver V6.5-014 (cxx) cxx Driver

i am attempting to investigate if i messed up the config, but i have been trying various combinations for some time now.

thanks for the help.

How to repeat:
compile on axp v5.1 using the description above.  removing "-pthread" allows the compile to continue, but fails later complaining about "incompatible thread functions":

source='str2int.c' object='str2int.o' libtool=no \
depfile='.deps/str2int.Po' tmpdepfile='.deps/str2int.TPo' \
depmode=tru64 /bin/ksh ../depcomp \
cc -DHAVE_CONFIG_H -I. -I. -I.. -I../include    -O -DDBUG_OFF -O3 -ansi_alias -ansi_args -fast -inline speed -speculate all -arch host   -DUNDEF_HAVE_GETHOSTBYNAME_R -DSNPRINTF_RETURN_TRUNC -c str2int.c
cc: Warning: ../include/my_pthread.h, line 328: In this declaration, parameter 1 has a different type than specified in an earlier declaration of this function. (mismatparam)
int sigwait(sigset_t *setp, int *sigp);         /* Use our implemention */
----^
cc: Error: ../include/my_pthread.h, line 328: In this declaration, the type of "sigwait" is not compatible with the type of a previous declaration of "sigwait" at line number 515 in file /usr/include/signal.h. (notcompat)
int sigwait(sigset_t *setp, int *sigp);         /* Use our implemention */
----^
gmake.axp51[2]: *** [str2int.o] Error 1
gmake.axp51[2]: Leaving directory `/tmp_mnt/rs1/mysql/mysql-4.1.12/strings'
gmake.axp51[1]: *** [all-recursive] Error 1
gmake.axp51[1]: Leaving directory `/tmp_mnt/rs1/mysql/mysql-4.1.12'
gmake.axp51: *** [all] Error 2
[antaeus:jaw2]$
[16 Jun 2005 23:43] James Woodworth
out of curiosity, i ran gnumake with config that is shown on the page of binary downloads with no success (with new but similar compiler error message):

CC="cc -pthread" CFLAGS="-O4 -ansi_alias -ansi_args -fast -inline speed -speculate all" \
CXX="cxx -pthread" CXXFLAGS="-O4 -ansi_alias -fast -inline speed -speculate all -noexceptions -nortti" \
./configure --prefix=/sw/mysql/4.1.12/clients/axp51 --with-extra-charsets=complex --enable-thread-safe-client --enable-local-infile --with-named-t
hread-libs=-lpthread -lmach -lexc -lc --disable-shared --with-mysqld-ldflags=-all-static

gmake.axp51[4]: Entering directory `/tmp_mnt/rs1/mysql/mysql-4.1.12/sql'
cxx -pthread -DMYSQL_SERVER -DDEFAULT_MYSQL_HOME="\"/sw/mysql/4.1.12/clients/axp51\"" -DDATADIR="\"/sw/mysql/4.1.12/clients/axp51/var\"" -DSHAREDIR="\"/sw/mysql/4.1.12/clients/axp51/share/mysql\"" -DHAVE_CONFIG_H -I. -I. -I.. -I../zlib -I../innobase/include -I../include -I../regex -I.     -O3 -DDBUG_OFF -O4 -ansi_alias -fast -inline speed -speculate all -noexceptions -nortti   -DUNDEF_HAVE_GETHOSTBYNAME_R -DSNPRINTF_RETURN_TRUNC -I/usr/include/cxx -I/usr/include/cxx_cname -I/usr/include -I/usr/include.dtk -c -I../zlib -I../innobase/include -I../include -I../regex -I.  -DTZINFO2SQL mysql_tzinfo_to_sql.cc
/bin/ksh ../libtool --preserve-dup-deps --mode=link cxx -pthread  -O3 -DDBUG_OFF -O4 -ansi_alias -fast -inline speed -speculate all -noexceptions -nortti   -DUNDEF_HAVE_GETHOSTBYNAME_R -DSNPRINTF_RETURN_TRUNC -I/usr/include/cxx -I/usr/include/cxx_cname -I/usr/include -I/usr/include.dtk   -o mysql_tzinfo_to_sql  mysql_tzinfo_to_sql.o -all-static ../myisam/libmyisam.a ../myisammrg/libmyisammrg.a ../heap/libheap.a ../vio/libvio.a ../mysys/libmysys.a ../dbug/libdbug.a ../regex/libregex.a ../strings/libmystrings.a ../zlib/libz.la   -lpthread -lmach -lexc -lc -lm  -lpthread -lmach -lexc -lc 
mkdir .libs
cxx -O3 -DDBUG_OFF -O4 -ansi_alias -fast -inline speed -speculate all -noexceptions -nortti -DUNDEF_HAVE_GETHOSTBYNAME_R -DSNPRINTF_RETURN_TRUNC -I/usr/include/cxx -I/usr/include/cxx_cname -I/usr/include -I/usr/include.dtk -o mysql_tzinfo_to_sql mysql_tzinfo_to_sql.o  -pthread ../myisam/libmyisam.a ../myisammrg/libmyisammrg.a ../heap/libheap.a ../vio/libvio.a ../mysys/libmysys.a ../dbug/libdbug.a ../regex/libregex.a ../strings/libmystrings.a ../zlib/.libs/libz.a -lpthread -lmach -lexc -lc -lpthread -lmach -lexc -lc -lpthread -lmach -lexc -lc -lm -lpthread -lmach -lexc -lc
ld (prelink):
-speculate: Unknown flag
ld: Usage: ld [options] file [...]
ld:
-speculate: Unknown flag
ld: Usage: ld [options] file [...]
gmake.axp51[4]: *** [mysql_tzinfo_to_sql] Error 1
gmake.axp51[4]: Leaving directory `/tmp_mnt/rs1/mysql/mysql-4.1.12/sql'
gmake.axp51[3]: *** [all-recursive] Error 1
gmake.axp51[3]: Leaving directory `/tmp_mnt/rs1/mysql/mysql-4.1.12/sql'
gmake.axp51[2]: *** [all] Error 2
gmake.axp51[2]: Leaving directory `/tmp_mnt/rs1/mysql/mysql-4.1.12/sql'
gmake.axp51[1]: *** [all-recursive] Error 1
gmake.axp51[1]: Leaving directory `/tmp_mnt/rs1/mysql/mysql-4.1.12'
gmake.axp51: *** [all] Error 2
[17 Jun 2005 19:47] James Woodworth
hope this is not too much info.  am i doing this wrong?  compiler problem?  software?  thank you.

i thought i would try something else:
with this config:
CC="cc -pthread" \
CFLAGS="-O4 -ansi_alias -ansi_args -fast -inline speed" \
CXX="cxx -pthread" \
CXXFLAGS="-O4 -ansi_alias -fast -inline speed -noexceptions -nortti" \
./configure --prefix=/sw/mysql/4.1.12/clients/axp51 --without-server \
--with-low-memory --enable-shared --with-pthread \
--enable-thread-safe-client --with-named-thread-libs="-lpthread -lmach -lexc -lc"

first i tar'd the successful make i had once i disabled shared objects and removed "-speculate all".

i tried to compile and expected it to fail as before in the zlib directory.  then i extracted the zlib directory from the above tar file.  then editted zlib's makefile to auto-return "true" and tried to recompile.

got to building a shared object i need and failed:

(cd .libs/libmysqlclient_r.lax/libz.a && ar x /sw/mysql/mysql-4.1.12/libmysql_r/../zlib/.libs/libz.a)
/bin/ld -shared -expect_unresolved \*  .libs/libmysql.o ...skipped... -msym -soname libmysqlclient_r.so.14 `test -n "14.0.0:14.0" && echo -set_version 14.0.0:14.0` -update_regis
try .libs/so_locations -o .libs/libmysqlclient_r.so.14.0.0
/bin/ld:
-pthread: Unknown flag
/bin/ld: Usage: /bin/ld [options] file [...]
gmake.axp51[2]: *** [libmysqlclient_r.la] Error 1
gmake.axp51[2]: Leaving directory `/tmp_mnt/rs1/mysql/mysql-4.1.12/libmysql_r'
gmake.axp51[1]: *** [all-recursive] Error 1
gmake.axp51[1]: Leaving directory `/tmp_mnt/rs1/mysql/mysql-4.1.12'
gmake.axp51: *** [all] Error 2
[27 Jul 2005 18:30] Matthew Lord
Hi James,

Thank you for the bug report!  Are you able to successfully build mysql the following way:

CC=cc CFLAGS="-O2 -pthread -ansi_alias -ansi_args -fast -inline speed -speculate all" CXX=cxx CXXFLAGS="-O2 -pthread -ansi_alias -fast -inline speed -noexceptions -nortti"  ./configure --prefix=/usr/local/mysql --localstatedir=/usr/local/mysql/data --libexecdir=/usr/local/mysql/bin --with-comment="MySQL Community Edition - Standard (GPL)" --with-extra-charsets=complex --with-server-suffix="-standard" --enable-thread-safe-client --enable-local-infile --with-named-thread-libs="-lpthread -lmach -lexc -lc" --disable-shared --with-mysqld-ldflags=-all-static --with-readline --with-embedded-server --with-archive-storage-engine --with-innodb

Best Regards
[27 Aug 2005 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".