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:
None 
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 ]
Description:
AIX OS: 5.2 (with 64 bit kernel enabled and JFS2 filesystem)
Machine: RS600 44P Model 170
GCC Version: 3.3.2

Compile had run into compile errors.

Configure command...
--snip--
./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 --with-openssl
--snip--

Make command...
--snip--
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
Target "all-am" is up to date.
Making all in Docs
Target "all" is up to date.
Making all in zlib
        if /bin/sh ../libtool --preserve-dup-deps --mode=compile gcc -DHAVE_CONFIG_H  -I. -I. -I..      -O3 -DDBUG_OFF    -MT adler32.lo -MD -MP -MF ".deps/adler32.Tpo" -c -o adler32.lo adler32.c;  then mv -f ".deps/adler32.Tpo" ".deps/adler32.Plo"; else rm -f ".deps/adler32.Tpo"; exit 1; fi
mkdir .libs
 gcc -DHAVE_CONFIG_H -I. -I. -I.. -O3 -DDBUG_OFF -MT adler32.lo -MD -MP -MF .deps/adler32.Tpo -c adler32.c  -DPIC -o .libs/adler32.o
        if /bin/sh ../libtool --preserve-dup-deps --mode=compile gcc -DHAVE_CONFIG_H  -I. -I. -I..      -O3 -DDBUG_OFF    -MT compress.lo -MD -MP -MF ".deps/compress.Tpo" -c -o compress.lo compress.c;  then mv -f ".deps/compress.Tpo" ".deps/compress.Plo"; else rm -f ".deps/compress.Tpo"; exit 1; fi
 gcc -DHAVE_CONFIG_H -I. -I. -I.. -O3 -DDBUG_OFF -MT compress.lo -MD -MP -MF .deps/compress.Tpo -c compress.c  -DPIC -o .libs/compress.o
        if /bin/sh ../libtool --preserve-dup-deps --mode=compile gcc -DHAVE_CONFIG_H  -I. -I. -I..      -O3 -DDBUG_OFF    -MT crc32.lo -MD -MP -MF ".deps/crc32.Tpo" -c -o crc32.lo crc32.c;  then mv -f ".deps/crc32.Tpo" ".deps/crc32.Plo"; else rm -f ".deps/crc32.Tpo"; exit 1; fi
 gcc -DHAVE_CONFIG_H -I. -I. -I.. -O3 -DDBUG_OFF -MT crc32.lo -MD -MP -MF .deps/crc32.Tpo -c crc32.c  -DPIC -o .libs/crc32.o
        if /bin/sh ../libtool --preserve-dup-deps --mode=compile gcc -DHAVE_CONFIG_H  -I. -I. -I..      -O3 -DDBUG_OFF    -MT deflate.lo -MD -MP -MF ".deps/deflate.Tpo" -c -o deflate.lo deflate.c;  then mv -f ".deps/deflate.Tpo" ".deps/deflate.Plo"; else rm -f ".deps/deflate.Tpo"; exit 1; fi
 gcc -DHAVE_CONFIG_H -I. -I. -I.. -O3 -DDBUG_OFF -MT deflate.lo -MD -MP -MF .deps/deflate.Tpo -c deflate.c  -DPIC -o .libs/deflate.o
        if /bin/sh ../libtool --preserve-dup-deps --mode=compile gcc -DHAVE_CONFIG_H  -I. -I. -I..      -O3 -DDBUG_OFF    -MT gzio.lo -MD -MP -MF ".deps/gzio.Tpo" -c -o gzio.lo gzio.c;  then mv -f ".deps/gzio.Tpo" ".deps/gzio.Plo"; else rm -f ".deps/gzio.Tpo"; exit 1; fi
 gcc -DHAVE_CONFIG_H -I. -I. -I.. -O3 -DDBUG_OFF -MT gzio.lo -MD -MP -MF .deps/gzio.Tpo -c gzio.c  -DPIC -o .libs/gzio.o
        if /bin/sh ../libtool --preserve-dup-deps --mode=compile gcc -DHAVE_CONFIG_H  -I. -I. -I..      -O3 -DDBUG_OFF    -MT infback.lo -MD -MP -MF ".deps/infback.Tpo" -c -o infback.lo infback.c;  then mv -f ".deps/infback.Tpo" ".deps/infback.Plo"; else rm -f ".deps/infback.Tpo"; exit 1; fi
 gcc -DHAVE_CONFIG_H -I. -I. -I.. -O3 -DDBUG_OFF -MT infback.lo -MD -MP -MF .deps/infback.Tpo -c infback.c  -DPIC -o .libs/infback.o
        if /bin/sh ../libtool --preserve-dup-deps --mode=compile gcc -DHAVE_CONFIG_H  -I. -I. -I..      -O3 -DDBUG_OFF    -MT inffast.lo -MD -MP -MF ".deps/inffast.Tpo" -c -o inffast.lo inffast.c;  then mv -f ".deps/inffast.Tpo" ".deps/inffast.Plo"; else rm -f ".deps/inffast.Tpo"; exit 1; fi
 gcc -DHAVE_CONFIG_H -I. -I. -I.. -O3 -DDBUG_OFF -MT inffast.lo -MD -MP -MF .deps/inffast.Tpo -c inffast.c  -DPIC -o .libs/inffast.o
        if /bin/sh ../libtool --preserve-dup-deps --mode=compile gcc -DHAVE_CONFIG_H  -I. -I. -I..      -O3 -DDBUG_OFF    -MT inflate.lo -MD -MP -MF ".deps/inflate.Tpo" -c -o inflate.lo inflate.c;  then mv -f ".deps/inflate.Tpo" ".deps/inflate.Plo"; else rm -f ".deps/inflate.Tpo"; exit 1; fi
 gcc -DHAVE_CONFIG_H -I. -I. -I.. -O3 -DDBUG_OFF -MT inflate.lo -MD -MP -MF .deps/inflate.Tpo -c inflate.c  -DPIC -o .libs/inflate.o
        if /bin/sh ../libtool --preserve-dup-deps --mode=compile gcc -DHAVE_CONFIG_H  -I. -I. -I..      -O3 -DDBUG_OFF    -MT inftrees.lo -MD -MP -MF ".deps/inftrees.Tpo" -c -o inftrees.lo inftrees.c;  then mv -f ".deps/inftrees.Tpo" ".deps/inftrees.Plo"; else rm -f ".deps/inftrees.Tpo"; exit 1; fi
 gcc -DHAVE_CONFIG_H -I. -I. -I.. -O3 -DDBUG_OFF -MT inftrees.lo -MD -MP -MF .deps/inftrees.Tpo -c inftrees.c  -DPIC -o .libs/inftrees.o
        if /bin/sh ../libtool --preserve-dup-deps --mode=compile gcc -DHAVE_CONFIG_H  -I. -I. -I..      -O3 -DDBUG_OFF    -MT trees.lo -MD -MP -MF ".deps/trees.Tpo" -c -o trees.lo trees.c;  then mv -f ".deps/trees.Tpo" ".deps/trees.Plo"; else rm -f ".deps/trees.Tpo"; exit 1; fi
 gcc -DHAVE_CONFIG_H -I. -I. -I.. -O3 -DDBUG_OFF -MT trees.lo -MD -MP -MF .deps/trees.Tpo -c trees.c  -DPIC -o .libs/trees.o
        if /bin/sh ../libtool --preserve-dup-deps --mode=compile gcc -DHAVE_CONFIG_H  -I. -I. -I..      -O3 -DDBUG_OFF    -MT uncompr.lo -MD -MP -MF ".deps/uncompr.Tpo" -c -o uncompr.lo uncompr.c;  then mv -f ".deps/uncompr.Tpo" ".deps/uncompr.Plo"; else rm -f ".deps/uncompr.Tpo"; exit 1; fi
 gcc -DHAVE_CONFIG_H -I. -I. -I.. -O3 -DDBUG_OFF -MT uncompr.lo -MD -MP -MF .deps/uncompr.Tpo -c uncompr.c  -DPIC -o .libs/uncompr.o
        if /bin/sh ../libtool --preserve-dup-deps --mode=compile gcc -DHAVE_CONFIG_H  -I. -I. -I..      -O3 -DDBUG_OFF    -MT zutil.lo -MD -MP -MF ".deps/zutil.Tpo" -c -o zutil.lo zutil.c;  then mv -f ".deps/zutil.Tpo" ".deps/zutil.Plo"; else rm -f ".deps/zutil.Tpo"; exit 1; fi
 gcc -DHAVE_CONFIG_H -I. -I. -I.. -O3 -DDBUG_OFF -MT zutil.lo -MD -MP -MF .deps/zutil.Tpo -c zutil.c  -DPIC -o .libs/zutil.o
        /bin/sh ../libtool --preserve-dup-deps --mode=link gcc  -O3 -DDBUG_OFF       -o libz.la -rpath /usr/local/mysql-source-5.0.17-aix5.2-powerpc-64bit/lib/mysql  adler32.lo compress.lo crc32.lo deflate.lo  gzio.lo infback.lo inffast.lo inflate.lo inftrees.lo trees.lo  uncompr.lo zutil.lo  -lcrypt -lnsl_r -lm  -lpthread 
generating symbol list for `libz.la'
/usr/bin/nm -B -BCpg  .libs/adler32.o .libs/compress.o .libs/crc32.o .libs/deflate.o .libs/gzio.o .libs/infback.o .libs/inffast.o .libs/inflate.o .libs/inftrees.o .libs/trees.o .libs/uncompr.o .libs/zutil.o  | awk '{ if ((($2 == "T") || ($2 == "D") || ($2 == "B")) && (substr($3,1,1) != ".")) { print $3 } }' | sort -u > .libs/libz.exp
gcc -shared -o .libs/libz.so.0  .libs/adler32.o .libs/compress.o .libs/crc32.o .libs/deflate.o .libs/gzio.o .libs/infback.o .libs/inffast.o .libs/inflate.o .libs/inftrees.o .libs/trees.o .libs/uncompr.o .libs/zutil.o  -lcrypt -lnsl_r -lm -lpthread -lc  -Wl,-bE:.libs/libz.exp -Wl,-bnoentry ${wl}-berok
collect2: library libgcc_s not found
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--

It have been encourage that we use GCC instead of AIX's C/C++ compilers.  http://www-128.ibm.com/developerworks/eserver/articles/gnu.html  

As of AIX 4.1, the C compiler has been "unbundled" from AIX and became a separate product.  Later, a few different AIX C/C++ compilers appears.  So, it make the GCC all the more appealing for AIX and open source codes.

Although I'm not sure what GCC flags is to be used.  I tried a different flags like this from http://dev.mysql.com/doc/refman/5.0/en/ibm-aix.html

--snip--
CC="gcc -pipe -mcpu=powerpc -Wa,-many" CXX="gcc -pipe -mcpu=powerpc -Wa,-many" CXXFLAGS="-O3 -felide-constructors
 -fno-exceptions -fno-rtti"
--snip--

But got a different compile error.  Seem that MySQL is designed differently because I had no trouble compiling OpenSSL, Apache, PHP, etc. without the flags, like this..

--snip--
CC="" CXX="" CXXFLAGS=""
--snip--

I wonder if MySQL can be truely be compilable with gcc on AIX.  I still get this same compile error with the flags as CC="" CXX="" CXXFLAGS="".

How to repeat:
1) Download the source code in "*.tar.gz" format (not the AIX pre-compiled package) to the AIX machine.

2) Unzipped it and get into that directory.

3) Use the configure commands and do the make to compile MySQL.

Suggested fix:
Make MySQL be compilable with GCC.
[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.