Gcc 4.9 Download Mac Average ratng: 4,4/5 6359 votes
< User:Max

In this tutorial you will learn how to build a GCC cross compiler toolchain on Mac OS X (10.9, Mavericks). This includes building cross binutils, a cross compiler and libgcc for your target architecture.

If you are using MATLAB R2015b or R2016a, then download the MinGW installer from the link below. I have the same problems for instal the supports TDM-gcc MinGW 4.9.2 for use in MATLAB for compiling MEX-files. Other versions of MinGW or MinGW 4.9.2 downloaded from other sources would not. Starting with Xcode 4.3 - you must now manually install command line tools from Xcode menu Preferences Downloads. Alternatively, there are stand-alone installation packages both for Mountain Lion (10.8) and for Mavericks (10.9). This package enables UNIX-style development via Terminal by installing command line developer tools, as well as Mac OS X SDK frameworks and headers.

To do this tutorial, I assume that you have a basic knowledge about using the Terminal and commands like cd and mkdir.

Nov 28, 2019. GCC 4.9.3 cross-compiler for Raspberry Pi (supports Pi 1) on Mac. It's hard but it's possible! (tested on 10.11.6) I took me days and a lot of anger to compile this gcc-version on my Mac Clang is a nice compiler but ct-ng support for Mac/Clang is quite poor. The guys behind Raspberry-PI.org think the whole world develops on Linux. Mac OS Forge. Open development of select Mac OS X projects. Tools and Technologies Why you'll love to develop on your Mac. Open Source in Mac OS X Learn about the 200+ open source projects that ship with Mac OS X. Darwin Technologies Beneath the easy-to-use interface of Mac. GCC 4.9.0; binutils 2.24; Once you've downloaded the archive files of the current sources (namely in our case gcc-4.9.0.tar.gz and binutils-2.24.tar.gz), create a folder in your home directory (name it for example src) and unpack the archives there.

  • 4Building
    • 4.4Checking the installation

Installing GCC

To build a cross compiler from the GCC sources, you first need to have the GNU GCC installed on your system (called the 'host system'). This compiler will later be used to compile the cross-toolchain.

There might already be a compiler showing up when using gcc in Terminal, but this is not the actual GNU GCC, it's Apples LLVM compiler. To install the real GNU GCC, we use Homebrew. Once you have Homebrew installed, open up a Terminal. Then install GCC with the brew commands:

Gcc 4.9 Download Mac Iso

This may take a while. It installs the GNU GCC 4.9 with additional support for C++. You should then check if GCC is working by using 'gcc-4.9 --version' in the Terminal.

Installing the necessary libraries

For building GCC you also need to install the libraries GMP, MPFR and MPC on your host system. You can do this with the following brew commands:

Once this is done, the necessary libraries are available on your system, and you are ready for building the cross compiler.

Downloading the sources

The following sources are required to build the cross compiler toolchain. The versions here are the ones I'll be using in the following (and that are in the moment I'm writing this the newest sources). Any newer/older version might - or might not - work as well.

Once you've downloaded the archive files of the current sources (namely in our case gcc-4.9.0.tar.gz and binutils-2.24.tar.gz), create a folder in your home directory (name it for example src) and unpack the archives there.

Gcc 4.9 Download Mac

Building

Open up a terminal and cd to the src directory we just created. Inside of that directory, you should now have the folders gcc-4.9.0 and binutils-2.24 containing our necessary sources.

Preparing environment variables

We will now set some environment variables for the build process by using the export command. Take care - these variables are temporary, if you open a new terminal session, you'll have to enter them again.

First, we set the compiler variables right, to let the configure script and makefiles of binutils and gcc know that they need to use the compiler we just installed instead of the LLVM:

Also, we define the following variables. The PREFIX is the path where you want to install the cross-binaries to. The TARGET determines your target platform, for example we want to build an i686-elf compiler. The PATH export we're doing here just appends the directory that you specified as the target for your cross-binaries to the PATH.

Now we are ready to continue building binutils and then the gcc and libgcc.

binutils

  1. Create a folder binutils-2.24-build in your ~/src folder
  2. cd to that folder
  3. From inside of that folder, we now run the configure script of binutils:
  4. Once the configure script has successfully completed its work, perform the build and installation:

gcc and libgcc

  1. Create a folder gcc-4.9.0-build in your ~/src folder
  2. cd to that folder
  3. From inside of that folder, we now run the configure script for GCC:
    (Note: the configure script might throw an error about not finding the installation of MPC/GMP/MPFR. To make it find these libraries, use the respective '--with-*' parameter. When using brew, this is by default '/usr/local', so '--with-gmp=/usr/local' etc. should work)
  4. Once the configure script has successfully completed its work, perform the build and installation:

Checking the installation

You can now check if the cross compiler works by typing i686-elf-g++ --version. To make the new cross tools always available in Terminal, you will have to open your user .bash_profile like this:

Now, add the following line (if you changed where you installed your crosstools to, you have to change it accordingly):

Press ^x for saving, press y and then enter to confirm saving. The crosstools are now in your PATH and are available in your Terminal.

Location of crosstools and target-libgcc

If you used the PREFIX variable from above, you should find a opt folder in your home directory. Inside of that folder is a cross folder, which contains all the stuff we just built. This folder contains:

  • a bin folder with the binaries of the cross compiler
  • a lib/gcc/i686-elf/4.9.0/ folder which contains a include folder and libgcc.a for linking it with your kernel

Gcc 9.2 Download

Gcc 4.9 Download Mac

Gcc 4.9.4

Retrieved from 'https://wiki.osdev.org/index.php?title=User:Max/Building_a_GCC_4.9_cross_compiler_on_OS_X_Mavericks&oldid=18219'
Coments are closed
Scroll to top