
This will fail immediately, but no worries, the information printed will allow us to fix the problem. (The ulimit command increases the number of open files allowed, otherwise the build will fail just before the end…)
#Gcc for mac os download#
In there, we need to change the default locations of the download- and output directories to point into the case sensitive disk image (the download directory doesn’t need to be there but again, it keeps things organised. This is the same as used for the Linux kernel.

To generate the configuration for one of the per-defined builds as a test case. To try it out, navigate to that directory and issue ct-ng arm-unknown-linux-gnueabi

If all went well, there should be a working version of crosstool-ng in the INSTALL_DIR. You’ll need to verify the Homebrew installation of those tools in this case. Checking the output of the configuration step might show that some of the GNU/Linux tools were not recognised correctly. Any errors will indicate that some of the previous instructions did not succeed.
#Gcc for mac os install#
This will make and install crosstool-ng in that directory. Where I choose PATH_TO_INSTALL_DIR to be /Volumes/ct-ng/ct-ng in the build disk image. I find it sensible to install it into the build disk image to have it all in one spot. Then we will need to decide where we want to install the crosstool executable. This creates the directory crosstool-ng, containing the source code. The clone the git repository into this directory cd build_dir Crosstool-ng does not require a case sensitive file system. This can be anywhere on the Mac disk, or in the newly created disk image. Step 4:Ĭreate a directory to build crosstools-ng. Be aware that disk utility actually changes the file system properties as you set the options, so make sure that it is set to case sensitive file system before creating the image. Basically, you want to create a sparse disk image with case sensitive file system somewhere on your disk. Luckily, this is actually quite easy with disk utility. So we need to create a case sensitive disk somehow. So trying to build gcc on the standard Mac disk will inevitably fail. Gcc is a Linux tool and Linux uses case sensitive file systems by default. 2017) is one remaining bug that requires this knowledge. Crosstool-ng is set up nicely to find these alternate versions for you during building. Some of these tools have their equivalent in macOS, so Homebrew installs them with a prefix g, so make becomes gmake and so on. So you need to install Homebrew, which is quite easy. So we need to build the tool from the git master for now. This is outdated and does not work on macOS at the time of writing.

Note: Homebrew contains a formula to install crosstool-ng 1.22. Other methods might work as well but have not been tested. The package manager Homebrew can be used to install those tools quite easily. Building a beast like gcc, however, requires those extra functionalities. Some of the macOS build tools are not equivalent to the GNU/Linux versions. Nothing that follows will work without it. You need X-Code or the command line tools installed to provide build tools on macOS. These can be changed to any other location as desired, of course. In this tutorial I am using places and paths that I find logical. Most of the workarounds listed on these pages are no longer required, but at the time of writing a small number of new hiccups need to be considered. Those other websites are still a good source of information, and well worth visiting in the process.
#Gcc for mac os update#
, so here is an update that works on macOS Sierra with the latest crosstool-ng version.
