Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to install gnu ld on mac os x 10.6?

Tags:

macos

ld

binutils

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) ?

like image 204
Gyom Avatar asked Oct 22 '09 15:10

Gyom


People also ask

Can you install GNU on Mac?

Homebrew. Homebrew can be used to install the GNU versions of tools onto your Mac, but they are all prefixed with “g” by default. NOTE: All commands have been installed with the prefix “g”. If you need to use these commands with their normal names, you can add a “gnubin” directory to your PATH from your bashrc.

Does macOS have GNU?

The macOS doesn't contain some GNU programs ( watch , wget , wdiff , gdb , autoconf ) and comes with BDS counterpart programs ( sed , tar , which , grep , awk , to name a few). Also, some GNU programs installed on macOS are outdated (e.g. bash , emacs , less , nano , etc.).


2 Answers

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.

like image 61
Brian Campbell Avatar answered Oct 20 '22 00:10

Brian Campbell


$ port info binutils
(…) Tools are prefixed with g to avoid conflicts with original tools. (…)
like image 42
zoul Avatar answered Oct 19 '22 23:10

zoul