/usr/bin/ld trouble..

Moptop

Registered
So whenever I try to compile something, I get to the step

Code:
checking for gcc... gcc
checking for C compiler default output file name... 
configure: error: C compiler cannot create executables
See `config.log' for more details.

And looking at the log, my problem is...

Code:
/usr/bin/ld: /usr/bin/ld: cannot execute binary file

Which... Is bad. Yes, I've tried chmodding it +x. I've also tried logging in as root and trying to run it, no luck.

What's wrong? =/

Would asking someone else with an iMac G5 to send me theirs, fix it?
 
gcc comes with XCode, so you might need to (re)install it. XCode comes with OS X, either on same disk as the main system or on separate. You can also download it from Apple's website.
 
I think ld is installed as part of gcc so that is probably what suggested the question. But as a first step what do you get from the following two commands:
Code:
elohopea:~ eric$ file /usr/bin/ld
/usr/bin/ld: Mach-O universal binary with 2 architectures
/usr/bin/ld (for architecture i386):	Mach-O executable i386
/usr/bin/ld (for architecture ppc7400):	Mach-O executable ppc
elohopea:~ eric$ ls -la /usr/bin/ld
-r-xr-xr-x  1 root  wheel  2098528 Sep 23  2007 /usr/bin/ld

I have included the output from my MacBook Pro for comparison. I am just wondering if you don't have an incorrect or stripped version of ld for some reason.
 
Well that is your problem right there, your ld is only for intel and you are running on a G5. Now, how you got into this configuration is really a good question. Is there some weird history this particular install? Did you try to install Gcc or Bintools by hand at some point or try to run one of the architecture strippers on you installation?

Curiosity aside, you need to basically reinstall your gcc tool chain and the related bintools stuff. But what you have really should not happen and so I wonder what else might be messed up on your box at this time. So if you can't track down the source of your missing architectures I would just do a reformat and reinstall.
 
Back
Top