How to install gnu ld on mac os x 10.6?

喜欢而已 提交于 2019-11-26 17:48:17

问题


I'm having a lot of trouble compiling the otherwise excellent Contiki OS on my macbook pro (with mac os x 10.6). Contiki actually uses a lot of GNU-specific features and options of GCC, AR, LD, and so on. So I installed those utilities via macports, but it looks like "port install binutils" does not install GNU ld, does it ?

So, the question is, how do I get GNU ld on my mac ? Is there a simple alternative to the hard-way (i.e. the wget, configure, make, make install way) ?


回答1:


As far as I can tell, GNU binutils does not support the Mach-O format. None of the documentation mentions it, and some Googling turns up some recent messages indicating that it is not supported.

Now, you mention the Contiki OS, which looks to me like an embedded operating system. Are you needing to compile to a native executable, or are you trying to cross-compile for some other environment? MacPorts does include several ports of binutils for cross compilation.




回答2:


$ port info binutils
(…) Tools are prefixed with g to avoid conflicts with original tools. (…)



回答3:


Generally you can link directly with gcc or g++ and don't need gld. Try setting LD to point to the compiler and see if it doesn't link for you.



来源:https://stackoverflow.com/questions/1608009/how-to-install-gnu-ld-on-mac-os-x-10-6

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!