GithubHelp home page GithubHelp logo

abigagli / cross-compile-toolchain-for-linux-on-osx Goto Github PK

View Code? Open in Web Editor NEW

This project forked from john-tipper/cross-compile-toolchain-for-linux-on-osx

0.0 2.0 0.0 47 KB

A script to create a GCC toolchain on OSX for Linux

Shell 11.30% C 1.26% C++ 87.44%

cross-compile-toolchain-for-linux-on-osx's Introduction

Build an x86_64 GCC toolchain for Linux on OSX

Synopsis

This builds an x86_64 GCC toolchain for Linux on OSX.

This is based on the extremely helpful script that appears at the end of the article describing how to cross-compile a toolchain, located here: http://preshing.com/20141119/how-to-build-a-gcc-cross-compiler/

The script itself is in a Gist, located here: https://gist.github.com/preshing/41d5c7248dea16238b60

Installation notes

  • You will need gettext and gnu-sed installed, plus possibly other packages (I have a load installed on my machine already, so I don't know what exactly you'll need on yours). I suggest installing using brew.
  • The makefiles require gnu-sed, not the normal sed that comes with OSX. If you don't want to mess with the normal sed, perhaps add to the front of PATH the path to gnu-sed before you run this script?
    Installing using brew will result in the installation of a binary called gsed which is not what you want and you'd have to symlink to it from sed to get this to work. You can get around the problem by installing like this: brew install gnu-sed --with-default-names, which will keep the name as sed.
  • Edit vars.sh first to set package versions. The versions that will result in a successful build will vary - some package versions will work, some will not.
  • You will need to increase the number of open files that are permitted by OSX (check your existing limit using ulimit -a). I use 4096.
  • This needs to be run/built in a case sensitive partition. You can create one using OSX's disk utility - I used a 10GB sparse image. It will be installed to a destination of your choosing, so you can delete the partition file when you're done.
  • Clone this repository, change into the directory, download the packages then build.
# assumes gnu-sed v4.2.2 has been installed using brew and the default name has been kept 
export PATH=/usr/local/Cellar/gnu-sed/4.2.2/bin:$PATH
ulimit -n 4096
git clone https://github.com/johnlondon/Cross-compile-toolchain-for-linux-on-OSX.git
./download.sh
./build.sh

License

I was helped by Waldemar Brodkorb on the crosstool-ng mailing list (https://sourceware.org/ml/crossgcc/) as I couldn't get glibc to compile properly with ct-ng. He said that for x86_64 toolchain creation you are required to provide some implementation of endian.h. The files in the endian directory are taken from his OpenADK repository (http://cgit.openadk.org/cgi/cgit/openadk.git/). They are covered by a BSD license, according to the OpenADK license file.

Use this as you see fit, I hope it helps someone.

cross-compile-toolchain-for-linux-on-osx's People

Contributors

abigagli avatar john-london avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.