I'm pretty stumped. I don't understand why the loader is failing to link-edit to3d. And the errors in running AFNI indicate that the compiler is generating incorrect code for the call to EDIT_dset_items() that creates the dummy dataset that is used when no datasets are input.
Can you use the sgi10k_6.5 binaries downloadable from the AFNI server? Maybe they will work for you. They are compiled with the SGI compiler. I'm not sure I ever actually succeeded in compiling AFNI with gcc on the SGI -- it has been a long time since I tried, and I vaguely recall some troubles like the ones you are having.
bob cox