On Fri, Jun 19, 2009 at 5:53 PM, Jørn Amundsen<Jorn.Amundsen@xxxxxxx> wrote: > Now, g++ -static-libgcc and -static works with Dave's patch. However, > compiling with g++ -static gives the unresolved externals: > > $ g++ -o hw -static hw.cpp > ld: 0711-317 ERROR: Undefined symbol: encrypted_pw_passlen > ld: 0711-317 ERROR: Undefined symbol: crypt_r > ld: 0711-317 ERROR: Undefined symbol: max_history_size > ld: 0711-317 ERROR: Undefined symbol: getpass_auto > ld: 0711-317 ERROR: Undefined symbol: max_pw_passlen > ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more > information. > collect2: ld returned 8 exit status > > This can be worked around by adding -lcrypt. Now, the g++ hello-world > links w/o errors, but it hangs (consuming cpu time) when trying to > execute. As I mentioned in my reply, with the patch I committed to GCC mainline, I now receive the errors above. This seems to be due to some mistakes in AIX libc.a symbols. I had not tried libcrypt.a, but that produces a different set of unresolved symbols. If I use "-Wl,-berok" -- which admittedly is not a great solution and will hide errors in applications -- I produce an executable that runs and completes for a hello world example. David