quic / toolchain_for_hexagon

Other
18 stars 11 forks source link

Toolchain for Hexagon

This repository contains scripts and recipes for building a cross toolchain for use with the Hexagon DSP.

Check the releases page for links to binary cross toolchain releases. These can be used to build and test Hexagon linux userspace binaries, the hexagon linux kernel, and more.

License

Toolchain for Hexagon is licensed under the BSD 3-clause "New" or "Revised" License. Check out the LICENSE for more details.

Usage

Checkout the required source repos like llvm-project, musl, etc. Invoke get-src-tarballs.sh with the corresponding *_SRC_URL links to the specific releases to use (see Dockerfile for reference / last-known-good versions). Or instead you can check out the trunk of those projects' repos using git - try invoking get_src_repos.sh.

Once the source repos are setup, build the toolchain using build-toolchain.sh.

build-toolchain.sh / build-rootfs.sh expect the inputs below as environment variables:

Sample usage:

export ARTIFACT_TAG=17.0.0
export TOOLCHAIN_INSTALL=$PWD/clang+llvm-${ARTIFACT_TAG}-cross-hexagon-unknown-linux-musl
export ROOT_INSTALL=$PWD/install_rootfs
export ARTIFACT_BASE=$PWD/artifacts

mkdir -p ${ARTIFACT_BASE}

./build-toolchain.sh 2>&1 | tee build_${ARTIFACT_TAG}.log
BUSYBOX_SRC_URL=https://busybox.net/downloads/busybox-1.33.1.tar.bz2 \
   ./build-rootfs.sh 2>&1 | tee build_root.log

Alternatively, you can run build-in-container.sh to build everything in Docker container and extract the results to ./hexagon-artifacts.