Bug #1682 can't compile DBD::mysql with mysql 4.1
Submitted: 27 Oct 2003 13:36 Modified: 24 Nov 2004 18:11
Reporter: Michael Felt Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Server Severity:S1 (Critical)
Version:mysql-max-4.1.0-alpha-ibm-aix5.1.0.0-pow OS:IBM AIX (AIX 5.1)
Assigned to: Assigned Account CPU Architecture:Any

[27 Oct 2003 13:36] Michael Felt
Description:
While compiling the modules needed for Perl integration I get the following errors:

[excerpt]
 .__floatdisf              [1150]  ER PR libmysql.c(/usr/local/mysql/lib/libmysqlclient.a[libmysql.o
])
                                   0000a868 .text    R_BR     [292]   <.send_data_long>
 .__floatdidf              [1152]  ER PR libmysql.c(/usr/local/mysql/lib/libmysqlclient.a[libmysql.o
])
                                   0000a8a0 .text    R_BR     [292]   <.send_data_long>
 .__fixdfdi                [1156]  ER PR libmysql.c(/usr/local/mysql/lib/libmysqlclient.a[libmysql.o
])
                                   0000aaf8 .text    R_BR     [294]   <.send_data_double>
ER: The return code is 8.
ld: 0711-317 ERROR: Undefined symbol: .__udivdi3
ld: 0711-317 ERROR: Undefined symbol: .__umoddi3
ld: 0711-317 ERROR: Undefined symbol: .floor
ld: 0711-317 ERROR: Undefined symbol: .__floatdisf
ld: 0711-317 ERROR: Undefined symbol: .__floatdidf
ld: 0711-317 ERROR: Undefined symbol: .__fixdfdi
make: 1254-004 The error code from the last command is 1.

How to repeat:

Perl modules:
DBD-mysql-2.9003
and
Msql-Mysql-modules-1.2219

both fail following:
perl Makefile.PL
make

File sets install on AIX:
  vac.C                      6.0.0.0    C     F    C for AIX Compiler
  bos.adt.base              5.1.0.51    C     F    Base Application Development
  bos.adt.data               5.1.0.0    C     F    Base Application Development
  bos.adt.debug             5.1.0.50    C     F    Base Application Development
  bos.adt.graphics          5.1.0.25    C     F    Base Application Development
  bos.adt.include           5.1.0.55    C     F    Base Application Development
  bos.adt.lib               5.1.0.35    C     F    Base Application Development
  bos.adt.libm              5.1.0.26    C     F    Base Application Development
  bos.adt.prof              5.1.0.55    C     F    Base Profiling Support
  bos.adt.prt_tools          5.1.0.0    C     F    Printer Support Development
  bos.adt.samples           5.1.0.52    C     F    Base Operating System Samples
  bos.adt.sccs              5.1.0.25    C     F    SCCS Application Development
  bos.adt.syscalls          5.1.0.50    C     F    System Calls Application
  bos.adt.utils              5.1.0.0    C     F    Base Application Development
  bos.loc.adt.iconv         5.1.0.51    C     F    Language Converter Development
  bos.loc.adt.icu            5.1.0.0    C     F    Internationalized Classes for
  bos.loc.adt.imk            5.1.0.0    C     F    Keymap Development Toolkit
  bos.loc.adt.locale        5.1.0.10    C     F    Locale Development Toolkit
  bos.loc.adt.unicode       5.1.0.15    C     F    Developers Toolkit for Unicode
  bos.net.nfs.adt           5.1.0.50    C     F    Network File System
  bos.net.tcp.adt           5.1.0.35    C     F    TCP/IP Application Toolkit
  ipfx.adt                   2.2.0.0    C     F    IBM Information Presentation
  ipfx.msg.en_US.adt         2.2.0.0    C     F    English ISO8859-1 message and
  ldap.client.adt            3.2.1.0    C     F    SecureWay Directory Client SDK
  memdbg.adt                 4.4.3.0    C     F    User Heap/Memory Debug Toolkit
  memdbg.aix50.adt           4.4.3.0    C     F    User Heap/Memory Debug Toolkit
  xlC.adt.include            6.0.0.0    C     F    C Set ++ Application
[27 Oct 2003 14:09] Michael Felt
the following version compiles fine:
mysql-standard-4.0.13-ibm-aix5.1.0.0-powerpc

After adding -lm to the Makefile (adding it for the previous report only removes the .floor "missing" entry.

After searching the web it looks like it is a gcc compiler/library dependancy.
[27 Oct 2003 14:19] Michael Felt
with version:
mysql-standard-4.1.0-alpha-ibm-aix5.1.0.0-powerpc
=====
michael@felt121:[/home/michael/.cpan/build/DBD-mysql-2.9003]make
         /bin/sh -c true
         /bin/sh -c true
        /usr/bin/perl -p -e "s/~DRIVER~/mysql/g" /usr/opt/perl5/lib/site_perl/5.6.0/aix/auto/DBI/Dri
ver.xst > mysql.xsi
        /usr/bin/perl -I/usr/opt/perl5/lib/5.6.0/aix -I/usr/opt/perl5/lib/5.6.0 /usr/opt/perl5/lib/5
.6.0/ExtUtils/xsubpp  -typemap /usr/opt/perl5/lib/5.6.0/ExtUtils/typemap mysql.xs > mysql.xsc && mv
mysql.xsc mysql.c
Warning: duplicate function definition 'do' detected in mysql.xs, line 192
Warning: duplicate function definition 'rows' detected in mysql.xs, line 290
        cc -c -I/usr/opt/perl5/lib/site_perl/5.6.0/aix/auto/DBI -I/usr/local/mysql/include -D_ALL_SO
URCE -D_ANSI_C_SOURCE -D_POSIX_SOURCE -qmaxmem=16384 -q32 -D_LARGE_FILES -qlonglong -O      -DVERSIO
N=\"2.9003\"  -DXS_VERSION=\"2.9003\"  -I/usr/opt/perl5/lib/5.6.0/aix/CORE  mysql.c
        LD_RUN_PATH="/usr/local/mysql/lib:/lib" /usr/bin/perl myld ld -o blib/arch/auto/DBD/mysql/my
sql.so  -bhalt:4 -bM:SRE -bI:/usr/opt/perl5/lib/5.6.0/aix/CORE/perl.exp -bE:mysql.exp -b noentry -lC
 -lc -lm dbdimp.o  mysql.o    -L/usr/local/mysql/lib -lmysqlclient -lz -lm
ld: 0711-317 ERROR: Undefined symbol: .__udivdi3
ld: 0711-317 ERROR: Undefined symbol: .__umoddi3
ld: 0711-317 ERROR: Undefined symbol: .__floatdisf
ld: 0711-317 ERROR: Undefined symbol: .__floatdidf
ld: 0711-317 ERROR: Undefined symbol: .__fixdfdi
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
make: 1254-004 The error code from the last command is 1.

Stop.
michael@felt121:[/home/michael/.cpan/build/DBD-mysql-2.9003]
[19 Nov 2003 5:32] Lenz Grimmer
Ranger, can you please take a look at this? I am not very familiar with DBD::MySQL...
[6 Jan 2004 4:36] Michael Felt
IMHO: it is because libmysql is compiled using GNU C, and these functions are getting added to the library. I dont have a GNU compiler, so I can't determine the call stack.

Is there anyway to eliminate these the need for these library functions?

M. Felt
[16 Jun 2004 15:30] Kent Boortz
The "libmysqlclient.a" library contains references to functions in 
"libgcc.a" on the build system. The references where put in by gcc
for things not inlined. On the customer system the GNU tools 
to compile/link where not used and the functions are then missing. 
The functions needed are mostly for "long long" operations and to 
make it even more complex different versions of GCC may use some 
of the "long long" support in the non GNU libc, others don't. So
the dependency on libgcc can vary between operating systems and
gcc version.

If this is a binary release we could of course compile on AIX using
cc instead of gcc (if MySQL can be compiled with the AIX compiler
that is). Then the problem is gone, at least for native cc users on AIX.

If not a possible solution I think that "libgcc.a" has a special
license allowing us to extract the objects in it and include it in
"libmysqlclient.a". The correct libgcc for the lib can be found 
from configure/make using

  gcc -print-libgcc-file-name

If we don't need "long long" operations but used them accidently we
could rewrite the source so that it doesn't use it any longer.

If the "long long" operations are in source not needed for this
build it may have got in there because the linker needed other code 
in the same source file. Then the source can be rearanged so that the
code not used will be in a separate object file not needed in
the linking of DBD::mysql.

kent
[16 Jun 2004 21:23] Michael Felt
It has been awhile, so I forget what my problem was with compiling mysql myself on AIX with xlC (or vac.C).

I resolved my problemn by not using 4.1.0 (but 4.0.X) - i.e. a different binary mysql distribution.

I shall try to take a look at the newer versions in the coming month.
[22 Oct 2004 13:43] MySQL Verification Team
Hi,

In your last post you have commented that the issue was resolved
in the source 4.0.XX. Are you also resolved on 4.1.XX source ?

Thanks in advance.
[24 Oct 2004 18:11] Michael Felt
I'll give it a try soon with AIX 5.1, 5.2 and 5.3. Just have to get some systems installed. (getting a 5.3 system might take a while).

And I'll try with gcc (which will probably work) as well as with the IBM compiler (vac 6).
[14 Feb 2005 22:54] 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".