Bug #15938 | Compile Error - library libgcc_s not found | ||
---|---|---|---|
Submitted: | 22 Dec 2005 16:27 | Modified: | 17 Apr 2006 16:45 |
Reporter: | [ name withheld ] | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: Documentation | Severity: | S3 (Non-critical) |
Version: | 5.0.17 | OS: | IBM AIX (AIX 5.2) |
Assigned to: | Paul DuBois | CPU Architecture: | Any |
[22 Dec 2005 16:27]
[ name withheld ]
[22 Dec 2005 16:44]
Valeriy Kravchuk
Thank you for a problem report. We do not use gcc for building official binaries on AIX, but there is gcc on the development machine, so I'll try to help you.
[26 Dec 2005 9:03]
Valeriy Kravchuk
Our engineering team updated gcc on our aix52 to 3.3.2, using the RPMs available from ftp://ftp.software.ibm.com/aix/freeSoftware/aixtoolbox/RPMS/ppc/gcc/, and, after several attempts, I was able to build 5.0.17 with GCC and install it successfully. I used some advices from the engineering team, and (surprise), from the same manual page you refered to, http://dev.mysql.com/doc/refman/5.0/en/ibm-aix.html. So, I performed the following steps: LDFLAGS=-static-libgcc CC="gcc -pipe -Wa,-many" \ CXX="gcc -pipe -Wa,-many" ./configure --prefix=/home/mysqldev/valeriy/dbs/5.0 --enable-thread-safe-client --enable-assembler --disable-shared --disable-largefile Sorry, I missed your --with-openssl somehow among many unsuccessfull attempts, but I do not think it will lead to other result. CC and CXX were taken from the manual and slightly simplified. LDFLAGS was the advice of the engineering team. Then I did the following, as described on that manual page: "After configuring, edit config.h and include/my_config.h and change the line that says this: #define HAVE_SNPRINTF 1 to this: #undef HAVE_SNPRINTF" Then, as usual: make clean make make install cd ~/valeriy/dbs/5.0/ Then: mysqldev@aix52:~/valeriy/dbs/5.0> bin/mysql_install_db Installing all prepared tables Fill help tables To start mysqld at boot time you have to copy support-files/mysql.server to the right place for your system PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER ! To do so, start the server, then issue the following commands: /home/mysqldev/valeriy/dbs/5.0/bin/mysqladmin -u root password 'new-password' /home/mysqldev/valeriy/dbs/5.0/bin/mysqladmin -u root -h aix52.mysql.com password 'new-password' See the manual for more instructions. You can start the MySQL daemon with: cd /home/mysqldev/valeriy/dbs/5.0 ; /home/mysqldev/valeriy/dbs/5.0/bin/mysqld_safe & You can test the MySQL daemon with the benchmarks in the 'sql-bench' directory: cd sql-bench ; perl run-all-tests Please report any problems with the /home/mysqldev/valeriy/dbs/5.0/bin/mysqlbug script! The latest information about MySQL is available on the web at http://www.mysql.com mysqldev@aix52:~/valeriy/dbs/5.0> bin/mysqld_safe --skip-networking --socket=/home/mysqldev/valeriy/mysql.sock & [1] 323662 mysqldev@aix52:~/valeriy/dbs/5.0> Starting mysqld daemon with databases from /home/mysqldev/valeriy/dbs/5.0/var mysqldev@aix52:~/valeriy/dbs/5.0> bin/mysql -uroot --socket=/home/mysqldev/val> Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 1 to server version: 5.0.17 No entry for terminal type "cygwin"; using dumb terminal settings. Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql> use mysql Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A Database changed mysql> show tables; +---------------------------+ | Tables_in_mysql | +---------------------------+ | columns_priv | | db | | func | | help_category | | help_keyword | | help_relation | | help_topic | | host | | proc | | procs_priv | | tables_priv | | time_zone | | time_zone_leap_second | | time_zone_name | | time_zone_transition | | time_zone_transition_type | | user | +---------------------------+ 17 rows in set (0.00 sec) mysql> exit Bye Basically, it works. I had not run tests on it, but I'll do. Some additional information: mysqldev@aix52:~/valeriy/dbs/5.0> uname -a AIX aix52 2 5 00592F0F4C00 mysqldev@aix52:~/valeriy/dbs/5.0> gcc -v Reading specs from /opt/freeware/lib/gcc-lib/powerpc-ibm-aix5.2.0.0/3.3.2/specs Configured with: ../configure --with-as=/usr/bin/as --with-ld=/usr/bin/ld --disa ble-nls --enable-languages=c,c++ --prefix=/opt/freeware --enable-threads --enable-version-specific-runtime-libs --host=powerpc-ibm-aix5.2.0.0 Thread model: aix gcc version 3.3.2 mysqldev@aix52:~/valeriy/dbs/5.0> file ~/valeriy/dbs/5.0/libexec/mysqld /home/mysqldev/valeriy/dbs/5.0/libexec/mysqld: executable (RISC System/6000) or object module not stripped Please, try to configure as I described, perform the same steps and try to make. Inform about the results.
[26 Dec 2005 10:16]
Valeriy Kravchuk
Test suit run successfully: Failed 2/342 tests, 99.41% were successful. ... mysql-test-run in default mode: *** Failing the test(s): information_schema innodb These 2 tests failed only because I had not included support for ucs2... So, it is really possible to build 5.0.17 on AIX with GCC successfully.
[26 Dec 2005 16:01]
Valeriy Kravchuk
A small patch to this version of gcc was also installed by our engineering team for me to be able to compile successfully (just got email): *** /opt/freeware/lib/gcc-lib/powerpc-ibm-aix5.2.0.0/3.3.2/include/curses.h.ORIG Mon Dec 26 02:17:28 2005 --- /opt/freeware/lib/gcc-lib/powerpc-ibm-aix5.2.0.0/3.3.2/include/curses.h Mon Dec 26 02:40:13 2005 *************** *** 2023,2029 **** #endif /* _AIX32_CURSES */ ! #if defined(__USE_FIXED_PROTOTYPES__) || defined(__cplusplus) || defined (__STRICT_ANSI__) extern int delwin (WINDOW *); extern int endwin (void); extern int getcurx (WINDOW *); --- 2023,2029 ---- #endif /* _AIX32_CURSES */ ! #if 0 && (defined(__USE_FIXED_PROTOTYPES__) || defined(__cplusplus) || defined (__STRICT_ANSI__)) extern int delwin (WINDOW *); extern int endwin (void); extern int getcurx (WINDOW *); So, please, check (and change, if needed) your curses.h also.
[27 Dec 2005 15:52]
[ name withheld ]
Um... Different compile error right now... Followed your suggestion from comment with timestamp of "[ 26 Dec 10:03 ]". --snip-- export LDFLAGS=-static-libgcc export CC="gcc -pipe -Wa,-many" export CXX="gcc -pipe -Wa,-many" ./configure --prefix=/usr/local/mysql-source-5.0.17-aix5.2-powerpc-64bit --exec-prefix=/usr/local/mysql-source-5.0.17-aix5.2-powerpc-64bit --enable-thread-safe-client --enable-assembler --disable-shared --disable-largefile --snip-- Then edited the config.h before doing the make command. I didn't do the config.h before because the manual stated it applied to AIX 4.2. Result I got is ... --snip-- + rm -f string.c + /usr/bin/ln -s ../libmysql/string.c string.c + rm -f strinstr.c + /usr/bin/ln -s ../libmysql/strinstr.c strinstr.c + rm -f strmake.c + /usr/bin/ln -s ../libmysql/strmake.c strmake.c + rm -f strmov.c + /usr/bin/ln -s ../libmysql/strmov.c strmov.c + rm -f strnlen.c + /usr/bin/ln -s ../libmysql/strnlen.c strnlen.c + rm -f strnmov.c + /usr/bin/ln -s ../libmysql/strnmov.c strnmov.c + rm -f strto.c + /usr/bin/ln -s ../libmysql/strto.c strto.c + rm -f strtod.c + /usr/bin/ln -s ../libmysql/strtod.c strtod.c + rm -f strtoll.c + /usr/bin/ln -s ../libmysql/strtoll.c strtoll.c + rm -f strtoull.c + /usr/bin/ln -s ../libmysql/strtoull.c strtoull.c + rm -f strxmov.c + /usr/bin/ln -s ../libmysql/strxmov.c strxmov.c + rm -f strxnmov.c + /usr/bin/ln -s ../libmysql/strxnmov.c strxnmov.c + rm -f thr_mutex.c + /usr/bin/ln -s ../libmysql/thr_mutex.c thr_mutex.c + rm -f typelib.c + /usr/bin/ln -s ../libmysql/typelib.c typelib.c + rm -f vio.c + /usr/bin/ln -s ../libmysql/vio.c vio.c + rm -f vio_priv.h + /usr/bin/ln -s ../libmysql/vio_priv.h vio_priv.h + rm -f viosocket.c + /usr/bin/ln -s ../libmysql/viosocket.c viosocket.c + rm -f viossl.c + /usr/bin/ln -s ../libmysql/viossl.c viossl.c + rm -f viosslfactories.c + /usr/bin/ln -s ../libmysql/viosslfactories.c viosslfactories.c + rm -f xml.c + /usr/bin/ln -s ../libmysql/xml.c xml.c echo timestamp > linked_libmysql_r_sources cd client; make link_sources for f in log_event.h mysql_priv.h log_event.cc my_decimal.h my_decimal.cc ; do rm -f $f; /usr/bin/ln -s ../sql/$f $f; done; for f in decimal.c ; do rm -f ./$f; /usr/bin/ln -s ../strings/$f $f; done; echo timestamp > linked_client_sources make all-recursive Making all in . Target "all-am" is up to date. Making all in include /usr/bin/cp ../config.h my_config.h make all-am cd .. && /bin/sh ./config.status include/Makefile config.status: creating include/Makefile Target "all-am" is up to date. Making all in Docs cd .. && /bin/sh ./config.status Docs/Makefile config.status: creating Docs/Makefile perl -w ./Support/generate-text-files.pl "installing-source" "windows-source-build" > ../INSTALL-SOURCE Cannot open installing-source: A file or directory in the path name does not exist. at ./Support/generate-text-files.pl line 8. make: 1254-004 The error code from the last command is 2. Stop. make: 1254-004 The error code from the last command is 1. Stop. make: 1254-004 The error code from the last command is 2. Stop. --snip-- I guess I don't need to try the 2nd suggestion with a timestamp of "[ 26 Dec 17:01 ]" at this moment.. Yea, I believe it is possible to build MySQL on AIX with GCC successfully. That compile error, I got that same one a few times before with the original configure command with the configure option setting. The only time I didn't get that compile error is when I change the compiler flags, just got further along and ran into the zlib compile error. Suggestion or option for me to do next??
[27 Dec 2005 15:54]
[ name withheld ]
Whoop!! Forgot one more thing.. --snip-- -=[root@netgate] -=[/usr/local/src/mysql-5.0.17]==>uname -a AIX netgate 2 5 004243DC4C00 -=[root@netgate] -=[/usr/local/src/mysql-5.0.17]==>gcc -v Reading specs from /opt/freeware/lib/gcc-lib/powerpc-ibm-aix5.2.0.0/3.3.2/specs Configured with: ../configure --with-as=/usr/bin/as --with-ld=/usr/bin/ld --disable-nls --enable-languages=c,c++ --prefix=/opt/freeware --enable-threads --enable-version-specific-runtime-libs --host=powerpc-ibm-aix5.2.0.0 Thread model: aix gcc version 3.3.2 --snip--
[27 Dec 2005 16:08]
[ name withheld ]
Sorry for adding so many comments, I try to keep it to one comment. For the sake of curiousity about tweaking the GCC's curses.h file. I modified it, do the make clean, reconfigured and recompile it. I still get that same make error.
[27 Dec 2005 16:33]
Valeriy Kravchuk
The only suggestion I have is to try exectly the same steps I performed, for the beginning, including config.h and my_config.h patching, curses.h patching and, surely, make clean to get rid of the previous make results completely. Please, do it and inform about the results. We have the same version of gcc, and you should be able to build successfully.
[27 Dec 2005 17:34]
[ name withheld ]
I'm guessing that "make clean" doesn't do it all so I deleted the source directory and extracted the *.tar.gz archive. Double checked the curses.h file. Cd into that directory and did the same configure command that worked on your development machine. Then edited the config.h there. There's no my_config.h file found anywhere in that source directory. Then went ahead with the make command. Got a different compile error this time. --snip-- Target "all" is up to date. Making all in mysys blah blah blah.... if gcc -pipe -Wa,-many -DDEFAULT_BASEDIR=\"/usr/local/mysql-source-5.0.17-aix5.2-powerpc-64bit\" -DDATADIR="\"/usr/local/mysql-source-5.0.17-aix5.2-powerpc-64bit/var\"" -DDEFAULT_CHARSET_HOME="\"/usr/local/mysql-source-5.0.17-aix5.2-powerpc-64bit\"" -DSHAREDIR="\"/usr/local/mysql-source-5.0.17-aix5.2-powerpc-64bit/share/mysql\"" -DDEFAULT_HOME_ENV=MYSQL_HOME -DDEFAULT_GROUP_SUFFIX_ENV=MYSQL_GROUP_SUFFIX -DHAVE_CONFIG_H -I. -I. -I.. -I../zlib -I../include -I../include -I. -O3 -DDBUG_OFF -MT mulalloc.o -MD -MP -MF ".deps/mulalloc.Tpo" -c -o mulalloc.o mulalloc.c; then mv -f ".deps/mulalloc.Tpo" ".deps/mulalloc.Po"; else rm -f ".deps/mulalloc.Tpo"; exit 1; fi if gcc -pipe -Wa,-many -DDEFAULT_BASEDIR=\"/usr/local/mysql-source-5.0.17-aix5.2-powerpc-64bit\" -DDATADIR="\"/usr/local/mysql-source-5.0.17-aix5.2-powerpc-64bit/var\"" -DDEFAULT_CHARSET_HOME="\"/usr/local/mysql-source-5.0.17-aix5.2-powerpc-64bit\"" -DSHAREDIR="\"/usr/local/mysql-source-5.0.17-aix5.2-powerpc-64bit/share/mysql\"" -DDEFAULT_HOME_ENV=MYSQL_HOME -DDEFAULT_GROUP_SUFFIX_ENV=MYSQL_GROUP_SUFFIX -DHAVE_CONFIG_H -I. -I. -I.. -I../zlib -I../include -I../include -I. -O3 -DDBUG_OFF -MT my_alloc.o -MD -MP -MF ".deps/my_alloc.Tpo" -c -o my_alloc.o my_alloc.c; then mv -f ".deps/my_alloc.Tpo" ".deps/my_alloc.Po"; else rm -f ".deps/my_alloc.Tpo"; exit 1; fi if gcc -pipe -Wa,-many -DDEFAULT_BASEDIR=\"/usr/local/mysql-source-5.0.17-aix5.2-powerpc-64bit\" -DDATADIR="\"/usr/local/mysql-source-5.0.17-aix5.2-powerpc-64bit/var\"" -DDEFAULT_CHARSET_HOME="\"/usr/local/mysql-source-5.0.17-aix5.2-powerpc-64bit\"" -DSHAREDIR="\"/usr/local/mysql-source-5.0.17-aix5.2-powerpc-64bit/share/mysql\"" -DDEFAULT_HOME_ENV=MYSQL_HOME -DDEFAULT_GROUP_SUFFIX_ENV=MYSQL_GROUP_SUFFIX -DHAVE_CONFIG_H -I. -I. -I.. -I../zlib -I../include -I../include -I. -O3 -DDBUG_OFF -MT safemalloc.o -MD -MP -MF ".deps/safemalloc.Tpo" -c -o safemalloc.o safemalloc.c; then mv -f ".deps/safemalloc.Tpo" ".deps/safemalloc.Po"; else rm -f ".deps/safemalloc.Tpo"; exit 1; fi if gcc -pipe -Wa,-many -DDEFAULT_BASEDIR=\"/usr/local/mysql-source-5.0.17-aix5.2-powerpc-64bit\" -DDATADIR="\"/usr/local/mysql-source-5.0.17-aix5.2-powerpc-64bit/var\"" -DDEFAULT_CHARSET_HOME="\"/usr/local/mysql-source-5.0.17-aix5.2-powerpc-64bit\"" -DSHAREDIR="\"/usr/local/mysql-source-5.0.17-aix5.2-powerpc-64bit/share/mysql\"" -DDEFAULT_HOME_ENV=MYSQL_HOME -DDEFAULT_GROUP_SUFFIX_ENV=MYSQL_GROUP_SUFFIX -DHAVE_CONFIG_H -I. -I. -I.. -I../zlib -I../include -I../include -I. -O -DDBUG_OFF -fno-implicit-templates -fno-exceptions -fno-rtti -MT my_new.o -MD -MP -MF ".deps/my_new.Tpo" -c -o my_new.o my_new.cc; then mv -f ".deps/my_new.Tpo" ".deps/my_new.Po"; else rm -f ".deps/my_new.Tpo"; exit 1; fi gcc: installation problem, cannot exec `cc1plus': No such file or directory make: 1254-004 The error code from the last command is 1. Stop. make: 1254-004 The error code from the last command is 1. Stop. make: 1254-004 The error code from the last command is 2. Stop. --snip--
[27 Dec 2005 17:51]
Valeriy Kravchuk
Check include/my_config.h, please. I had that file, and I changed it... As for that: "gcc: installation problem, cannot exec `cc1plus': No such file or directory" I got the same with old gcc 2.95 only. So, please, check your $PATH. Are you sure your configure picked up gcc 3.2.2 really? I can start my check from the very beginning, if you insist... But I'd better put this bug report in 'Can't repeat' state, because I (and our engineering team) are pretty sure that we can build 5.0.17 with GCC 3.3.2 on AIX 5.2 using the set of steps I described.
[28 Dec 2005 14:22]
[ name withheld ]
Finally, MySQL successfully compiled and installed. But I get errors when trying to start MySQL Daemon. The interesting thing when configuring and compiling MySQL is that it doesn't seem to find the GCC libraries for reason unknown to me as OpenSSL, PHP and Apache had no trouble finding one without the PATH environment variable. Turned out that cc1plus is found in /usr/local/lib/gcc-lib/power-ibm-aix5.2.0.0/3.3.2 directory. I also found the libgcc.a there recently. The interesting thing about it is that some files/directories in that directory are also found in /usr/local/lib. Just that not all are copied over to that /usr/local/lib directory for reasons unknown to me. Maybe it's the way it's installed via GCC package. Not sure if GNU BinUtils had something to do with it. I have never need it until PHP developers said I need GNU Linkers then IBM said I don't really need it. Oh well. Perhap maybe later, I'll re-install AIX from scratch and start from there. This time without GNU BinUtils package/source code and see how it go. Might be a good idea to explain the curses.h that come with GCC package on the mysql.com web documentation if that help some folks here. You can go ahead and mark it as work for me or fixed or whatever. I can see that it take some times and works to get MySQL up and running. So, I'm thinking of giving Relexus Linter a shot (http://www.relexus.com). If I have too many problem with that then I will have to come back to MySQL. I would like to thank you all for your time and help in getting MySQL running with GCC. Might also be a good idea to update the mysql.com web documentation about the libraries flag if possible. Might be interesting to see how it turned out for some folks out there. Good Luck and Thanks again....
[29 Dec 2005 12:05]
Valeriy Kravchuk
Please, send the content of your error log (since you got errors upon startup). As I explained, in my case 5.0.17 not only compiled and started, but passed the tests. There should be something different in machines configurations. Thank you for your (previous, at least) commitment to MySQL and GCC - it forced us to check build process. I want to mark this report as a verified documentation request, for all the findings to be described in the manual. Do you agree with this?
[29 Dec 2005 13:39]
[ name withheld ]
Sound good to me about documentation request as it would help other who may need it. Oddly, there's no log files produced by MySQL. Not sure why is that.
[29 Dec 2005 14:56]
Valeriy Kravchuk
I'll mark this as verified documentation request. This manual page, http://dev.mysql.com/doc/refman/5.0/en/ibm-aix.html, should be changed to reflect the correct steps to compile MySQL 5.0.x with GCC 3.3.2 on AIX 5.2 (based on comments in this bug report). Ask Kent or me for the additional details, if needed.
[17 Apr 2006 16:45]
Paul DuBois
Thank you for your bug report. This issue has been addressed in the documentation. The updated documentation will appear on our website shortly, and will be included in the next release of the relevant product(s). Additional info: I've added the information about gcc 3.3.2 to the end of the AIX section in the manual.