Sponsored LinksКатегорииLinksUnix Tutorial
Personal Development Ruslan Valiev Solaris Performance Team Damien Farnham Fintan Ryan Nicky Veitch Niall Mullen Sean McGrath DTrace Bryan Cantrill Brendan Gregg ZFS Tim Foster General Ben Rockwood Learning Solaris 10 Privacy policy |
Monday, April 10. 2006Compiling MySQL for amd64
Yesterday I started compiling all the necessary software on my new server. Naturally, I'm trying to make it all 64bit. For lots of software packages I've used the same set of CFLAGS and LDFLAGS parameters, and everything worked just fine.
So, I've used the same configure script parameters to compile the latest 64-bit version of MySQL - 5.0.19: mysql#MAKE="/usr/sfw/bin/gmake" CFLAGS="-m64" LDFLAGS="-m64 -L/lib/64" ./configure --prefix=/export/soft/mysql-5.0.19 --with-charset=utf8 but during the compilation I've got this error: Making all in sql gmake[2]: Entering directory `/export/dist/mysql-5.0.19/sql' if g++ -DMYSQL_SERVER -DDEFAULT_MYSQL_HOME="\"/export/soft/mysql-5.0.19\"" -DDATADIR="\"/export/soft/mysql-5.0.19/var\"" -DSHAREDIR="\"/export/soft/mysql-5.0.19/share/mysql\"" -DHAVE_CONFIG_H -I. -I. -I.. -I../zlib -I../innobase/include -I../include -I../include -I../regex -I. -O3 -DDBUG_OFF -fno-implicit-templates -fno-exceptions -fno-rtti -DHAVE_RWLOCK_T -MT gen_lex_hash.o -MD -MP -MF ".deps/gen_lex_hash.Tpo" -c -o gen_lex_hash.o gen_lex_hash.cc; \ then mv -f ".deps/gen_lex_hash.Tpo" ".deps/gen_lex_hash.Po"; else rm -f ".deps/gen_lex_hash.Tpo"; exit 1; fi /bin/bash ../libtool --preserve-dup-deps --mode=link g++ -O3 -DDBUG_OFF -fno-implicit-templates -fno-exceptions -fno-rtti -DHAVE_RWLOCK_T -m64 -L/lib/64 -o gen_lex_hash gen_lex_hash.o ../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 -lthread -lposix4 -lcrypt -lgen -lsocket -lnsl -lm -lpthread -lthread mkdir .libs g++ -O3 -DDBUG_OFF -fno-implicit-templates -fno-exceptions -fno-rtti -DHAVE_RWLOCK_T -m64 -o .libs/gen_lex_hash gen_lex_hash.o -L/lib/64 ../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.so -lpthread -lthread -lpthread -lthread -lpthread -lthread -lposix4 -lcrypt -lgen -lsocket -lnsl -lm -lpthread -lthread -Wl,-R -Wl,/export/soft/mysql-5.0.19/lib/mysql ld: fatal: file gen_lex_hash.o: wrong ELF class: ELFCLASS32 ld: fatal: File processing errors. No output written to .libs/gen_lex_hash collect2: ld returned 1 exit status gmake[2]: *** [gen_lex_hash] Error 1 gmake[2]: Leaving directory `/export/dist/mysql-5.0.19/sql' gmake[1]: *** [all-recursive] Error 1 gmake[1]: Leaving directory `/export/dist/mysql-5.0.19' gmake: *** [all] Error 2 Attentive reader or a seasoned developer will immediately see what my problem was. Turned out, I've forgotten to specify the -m64 parameter for g++. So the following parameters worked for me: mysql#MAKE="/usr/sfw/bin/gmake" CFLAGS="-m64" CXXFLAGS="-m64" LDFLAGS="-m64 -L/lib/64" ./configure --prefix=/export/soft/mysql-5.0.19 --with-charset=utf8 Update: One more error was found at a later stage of MySQL compilation (I've abridged the command output to save space): gmake[3]: Entering directory `/export/dist/mysql-5.0.19/server-tools/instance-manager' ... g++ -DDBUG_OFF -m64 -fno-implicit-templates -fno-exceptions -fno-rtti -DHAVE_RWLOCK_T -m64 -o .libs/mysqlmanager command.o mysqlmanager.o manager.o log.o thread_registry.o listener.o protocol.o mysql_connection.o user_map.o messages.o commands.o instance.o instance_map.o instance_options.o buffer.o parse.o guardian.o parse_output.o -L/lib/64 -L/usr/sfw/lib/amd64 ./.libs/liboptions.a -lpthread -lthread -lpthread -lthread /usr/sfw/lib/amd64/libstdc++.so -lgcc_s libnet.a ../../vio/libvio.a ../../mysys/libmysys.a ../../strings/libmystrings.a ../../dbug/libdbug.a ../../zlib/.libs/libz.so -lpthread -lthread -lpthread -lthread -lpthread -lthread -lposix4 -lcrypt -lgen -lsocket -lnsl -lm -lpthread -lthread -Wl,-R -Wl,/usr/sfw/lib/amd64 -Wl,-R -Wl,/export/soft/mysql-5.0.19/lib/mysql ld: fatal: library -lgcc_s: not found ld: warning: file /usr/sfw/lib/amd64/libstdc++.so: attempted multiple inclusion of file ld: fatal: File processing errors. No output written to .libs/mysqlmanager collect2: ld returned 1 exit status gmake[3]: *** [mysqlmanager] Error 1 gmake[3]: Leaving directory `/export/dist/mysql-5.0.19/server-tools/instance-manager' gmake[2]: *** [all-recursive] Error 1 gmake[2]: Leaving directory `/export/dist/mysql-5.0.19/server-tools' gmake[1]: *** [all-recursive] Error 1 gmake[1]: Leaving directory `/export/dist/mysql-5.0.19' gmake: *** [all] Error 2 So I had to go into /usr/sfw/lib/amd64 and do this: ln -s libgcc_s.so.1 libgcc_s.so If I come across anything interesting while compiling 64bit things, I'll be sure to mention it here, but for now I just hope this entry will keep you from making the same mistake. Good luck! Trackbacks
Trackback specific URI for this entry
No Trackbacks
|





