tags:

views:

45

answers:

2

Lately I have been working on OS X. Things were going pretty peachy for a while until somehow ld got on my system and now gcc won't use dyld. Furthermore, all of my shared libraries are in *.dylib format, and ld is stubornly ignoring there existance. If I mv ld from PATH, gcc just complains it cant find ld.

Please help me to get gcc back on track and using what it should.

+1  A: 

You can try some gcc options. From the man page:

-c  Compile or assemble the source files, but do not link.  The linking
    stage simply is not done.  The ultimate output is in the form of an
    object file for each source file.

You could then link explicitly using whatever linker you want.

Paul Rubel
I considered that, but it seems like to much of a hack. I like hacks when they're fun and short term fixes, but in the long haul they need real solid replacements.
itsmyown
+1  A: 

Does it help to symlink ld to dyld?

mv /usr/bin/ld /usr/bin/ld.old
ln -s /usr/bin/dyld /usr/bin/ld

Edit: fixed ld params order

nicomen
at least on my system, ln appears to work in the opposite direction you specified. Now I just wrote over dyld and need to grab it again from apple, *grumble grumble*.
itsmyown
lol, you are right, except normally if the file already existed, it wouldn't have overwritten it. Sorry!
nicomen
You might be correct about it not overwriting. Unfortunately I `unlink`ed, and that does remove the file completely(what I get for charging ahead without reading documentation). It takes FOREVER to download xCode(the only way to get dyld) from apple, and I just had to restart. Once I get that working and am able to verify, I'll award you this answer if it works, which I suspect it will.
itsmyown
Well,only if dyld accepts the same parameters. I was looking into how to look into changing gcc's specs file to use something else. But I'm not really sure what has happened to your system in the first place, are you sure gcc itself wasn't replaced also?
nicomen