Giter VIP home page Giter VIP logo

build-tools-clang's Introduction

CLANG toolchain build script

This is a script to build CLANG toolchains targeting arm, arm64, and x86 devices based on nathanchance's scripts.

Using the script

To build a toolchain, you will need to the following:

  • A Linux distribution
  • A decent processor and RAM (i5 and 8GB of RAM or more is preferred)
  • Core developer packages

For Debian and Ubuntu:

$ sudo apt-get install build-essential git git-svn bc binfmt-support automake autogen autoconf autotools-dev libtool shtool python m4 gcc libtool zlib1g-dev libelf-dev libxml2-dev python-yaml python-pygments pigz pxz ninja

Install CMake 3.4.3:

$ wget http://www.cmake.org/files/v3.4/cmake-3.4.3.tar.gz
$ tar xf cmake-3.4.3.tar.gz
$ cd cmake-3.4.3
$ ./bootstrap && make && sudo make install

Install subversion 1.10.0:

$ sudo sh -c 'echo "deb http://opensource.wandisco.com/ubuntu `lsb_release -cs` svn110" >> /etc/apt/sources.list.d/subversion110.list'
$ sudo wget -q http://opensource.wandisco.com/wandisco-debian.gpg -O- | sudo apt-key add -
$ sudo apt-get update && sudo apt-get install subversion

Install Prebuilt GCC 4.9

$ sudo add-apt-repository ppa:ubuntu-toolchain-r/test
$ sudo apt-get install gcc-4.9 g++-4.9
$ sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.9 100
$ sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.9 100

Install prebuilt clang 6.0:

$ wget -O - http://llvm.org/apt/llvm-snapshot.gpg.key | sudo apt-key add -
$ echo 'deb http://llvm.org/apt/[trusty/xenial/artful/bionic]/ llvm-toolchain-[trusty/xenial/artful/bionic]-6.0 main' | sudo tee -a /etc/apt/sources.list
$ sudo apt-get update
$ sudo apt-get install clang-6.0 lldb-6.0 lld-6.0
$ sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-6.0 100
$ sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-6.0 100

Once you have set up your environment, run the following to build clang:

$ git clone https://github.com/khusika/build-tools-clang
$ cd build-tools-clang
$ ./build-clang -h

The printout will show you how to run the script.

Example commands:

# Build a Clang 8.x toolchain for all architecture
./build-clang -a ARM -v 8

# Build a Clang 7.x toolchain for arm64
./build-clang -a arm64 -v 7

Credits/thanks

  • nathanchance: For great script!
  • krasCGQ: For some modifications to update the script/components

build-tools-clang's People

Contributors

nathanchance avatar khusika avatar krascgq avatar fatihunsever avatar joshchoo avatar

Stargazers

Bard avatar  avatar  avatar Vos avatar

Watchers

 avatar  avatar  avatar

Forkers

cmremix

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.