Bug #56928 Mysql5.5.6 on Linux x64 compile x86 binary realase error
Submitted: 22 Sep 2010 12:08 Modified: 29 Oct 2010 10:20
Reporter: li mohao Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Server: Compiling Severity:S4 (Feature request)
Version:Mysql5.5.6 OS:Linux
Assigned to: CPU Architecture:Any

[22 Sep 2010 12:08] li mohao
Description:
I am use Centos5.5 x64 compile x86(m32) release , But get error

configure

CC="/opt/gcc/gcc-4.4.4/bin/gcc" CFLAGS="-O3 -pipe -fPIC -static-libgcc -m32 -fomit-frame-pointer -DDBUG_OFF" CXX="/opt/gcc/gcc-4.4.4/bin/gcc" CXXFLAGS="-O3 -pipe -fPIC -static-libgcc -m32 -fomit-frame-pointer -felide-constructors -fno-exceptions -fno-rtti -fno-implicit-templates -DDBUG_OFF" ./configure --prefix=/opt/mysql  --enable-local-infile --enable-thread-safe-client --enable-assembler --with-client-ldflags=-static --with-mysqld-ldflags=-static --with-unix-socket-path=/opt/mysql/tmp/mysql.sock --with-plugins=partition,archive,blackhole,federated,ibmdb2i,innobase,perfschema,myisam,myisammrg --with-big-tables --without-debug --with-tcp-port=3306 --with-readline --enable-profiling --enable-shared --enable-static --with-extra-charsets=complex  --with-pic --with-fast-mutexes --with-zlib-dir=bundled --with-ssl --without-docs --without-man

there are no error

then make 

I got the error

/opt/gcc/gcc-4.4.4/bin/gcc -DHAVE_CONFIG_H -I. -I../../include -I../../include -I../../include -I../../regex -I../../sql -I.    -O3 -pipe -fPIC -static-libgcc -m32 -fomit-frame-pointer -DDBUG_OFF   -DUNIV_LINUX -MT mi_delete_table.o -MD -MP -MF .deps/mi_delete_table.Tpo -c -o mi_delete_table.o mi_delete_table.c
/opt/gcc/gcc-4.4.4/bin/gcc -DHAVE_CONFIG_H -I. -I../../include -I../../include -I../../include -I../../regex -I../../sql -I.    -O3 -pipe -fPIC -static-libgcc -m32 -fomit-frame-pointer -DDBUG_OFF   -DUNIV_LINUX -MT mi_rename.o -MD -MP -MF .deps/mi_rename.Tpo -c -o mi_rename.o mi_rename.c
/opt/gcc/gcc-4.4.4/bin/gcc -DHAVE_CONFIG_H -I. -I../../include -I../../include -I../../include -I../../regex -I../../sql -I.    -O3 -pipe -fPIC -static-libgcc -m32 -fomit-frame-pointer -DDBUG_OFF   -DUNIV_LINUX -MT mi_check.o -MD -MP -MF .deps/mi_check.Tpo -c -o mi_check.o mi_check.c
mi_static.c:40: error: conflicting types for ‘myisam_max_temp_length’
../../include/myisam.h:254: note: previous declaration of ‘myisam_max_temp_length’ was here
make[2]: *** [mi_static.o] Error 1
make[2]: *** Waiting for unfinished jobs....
mv -f .deps/mi_dynrec.Tpo .deps/mi_dynrec.Po
mv -f .deps/mi_delete_all.Tpo .deps/mi_delete_all.Po
mv -f .deps/mi_rename.Tpo .deps/mi_rename.Po
mv -f .deps/mi_delete_table.Tpo .deps/mi_delete_table.Po
mv -f .deps/mi_log.Tpo .deps/mi_log.Po
mv -f .deps/mi_packrec.Tpo .deps/mi_packrec.Po
mv -f .deps/mi_create.Tpo .deps/mi_create.Po
mv -f .deps/mi_check.Tpo .deps/mi_check.Po
make[2]: Leaving directory `/opt/mysql-5.5.6-rc/storage/myisam'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/opt/mysql-5.5.6-rc/storage'
make: *** [all-recursive] Error 1

I also compile use mysql5.1.50

configure line

CC="/opt/gcc/gcc-4.4.4/bin/gcc" CFLAGS="-O3 -pipe -fPIC -static-libgcc -m32 -fomit-frame-pointer -DDBUG_OFF" CXX="/opt/gcc/gcc-4.4.4/bin/gcc" CXXFLAGS="-O3 -pipe -fPIC -static-libgcc -m32 -fomit-frame-pointer -felide-constructors -fno-exceptions -fno-rtti -fno-implicit-templates -DDBUG_OFF" ./configure --prefix=/opt/mysql  --enable-local-infile --enable-thread-safe-client --enable-assembler --with-client-ldflags=-static --with-mysqld-ldflags=-static --with-unix-socket-path=/opt/mysql/tmp/mysql.sock --with-plugins=partition,archive,blackhole,csv,federated,heap,ibmdb2i,innobase,myisam,myisammrg  --with-big-tables --without-debug --with-tcp-port=3306 --with-readline --enable-profiling --enable-shared --enable-static --with-extra-charsets=complex  --with-pic --with-fast-mutexes --with-zlib-dir=bundled --with-ssl --without-docs --without-man

make 

there are no error

How to repeat:
as desc
[22 Sep 2010 12:13] li mohao
OS is linux
[22 Sep 2010 12:37] Joerg Bruehe
Effectively, you are doing a cross build:
On a 64 bit system, you want to create 32 bit binaries.
The MySQL build setup is not fully prepared for that, especially when using autotools. (With cmake, things are said to look better.)
Is there some compelling reason for doing these cross builds?

You could avoid doing cross builds by having a 32 bit virtual machine running on your 64 bit host, and then doing the 32 bit build in that VM.

Looking at the sources, the technical problem seems to be that your build environment does support "long long" with a size > 4 (a 64 bit integer type), but has "off_t" with size 4 (32 bit). This causes "my_off_t" to have a different size than "ulonglong", which finally leads to the conflict.

Fixing that is probably not very high on our priority list, nor are cross builds using the autotools. So if you really want to build 32 bit binaries on the 64 bit machine, you might try cmake; in any case, it should work well in a 32 bit VM.
[29 Oct 2010 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".