Skip to content

Commit

Permalink
many improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
uboreas committed Jun 19, 2016
1 parent c2987d0 commit fdf464e
Show file tree
Hide file tree
Showing 16 changed files with 1,108 additions and 172 deletions.
84 changes: 49 additions & 35 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
# crosstool-works
Patches and configurations to build Linaro toolchains on OS X 10.9 (Mavericks) host system.
This initial version provides OSX patch for Linaro 14.08 Release. Patches for further releases may be added to this repository.
Patches and configurations to build Linaro toolchains on OS X (>=10.9) host systems.
This version provides crosstool-ng patches for various Linaro releases and for target platforms. Patches for further releases may be added to this repository.

## Notes
* Patch files located under "patches" directory and named as (crosstool-package-version).patch
* ctworks script applies patches automatically according to selected crosstool-ng package.
* Packages under "tarballs" directory automatically copied into the crosstool/.build/tarballs directory (to prevent re-downloading them).
* You can place different packages and patches to work together.
* Patch files located under "patches" directory and named as (crosstool-ng-linaro-version-release).patch
* ctworks.sh script applies patches automatically according to selected crosstool-ng package.
* You can configure ctworks to use with different releases (and patches).

## Toolchains Built and Tested
arm-linux-gnueabi
Expand All @@ -19,53 +18,68 @@ This initial version provides OSX patch for Linaro 14.08 Release. Patches for fu
Tested with Ralink RT5350, MIPS 24KEc V4.12, 32-bit LSB, Linux 3.3.8
x86_64-linux-gnu
Tested with Ubuntu VM, 64-bit LSB
aarch64-linux-gnu
Tested with Amlogic-S905, 64-bit LSB

## Before You Begin
Download crosstool-NG package from Linaro 14.08 release;
## Usage
* Download crosstool-ng packages from Linaro releases storage server (http://releases.linaro.org)

cd /path/to/ctworks
wget "http://releases.linaro.org/14.08/components/toolchain/binaries/crosstool-ng-linaro-1.13.1-4.9-2014.08.tar.bz2"
> ./ctworks.sh get

## Usage
* Change paths within x-x-uclibc files to point this "configs" directory like below:
* Create case sensitive file system in a disk image (or you may use existing one):

> ./ctworks.sh create|attach

* Run with "prepare" switch to extract crosstool-ng package and apply patches etc.

> ./ctworks.sh prepare

CT_LIBC_UCLIBC_CONFIG_FILE=/path/to/ctworks/configs/uClibc-x.x.config
* Run with "config" switch to configure crosstool-ng and follow instructions displayed to build toolchain

* Create a case sensitive file system:
> ./ctworks.sh configure

./ctworks.sh dmgcreate
* Run with "eject" switch to unmount disk image.

* Run ctworks with "config" switch
> ./ctworks.sh eject

./ctworks.sh config
* Notes:

* Select appropriate package
- You may edit ctworks.config file to change your previously saved ctworks-configuration
If you remove some lines from this file, it will be asked again.

* Select desired configuration
- You may need to restart from a step when something goes wrong;
./ct-ng list-steps
RESTART=libc_start_files ./ct-ng build

* Follow the instructins displayed and wait for compilation.
### Prerequisites

* Copy tarballs from .build directory for later use;
* Xcode and Command line tools

cp /path/to/ctworks/disk/crosstool*/.build/tarballs/* /path/to/ctworks/tarballs/

* Find toolchain under "disk" folder and move it to your workspace
> xcode-select --install

* Run ctworks with "eject" switch to unmount dmg file if you want to use it later.
* MacPorts should be installed. Required ports as follows (openwrt requires some of them also);

./ctworks.sh eject
> sudo port install binutils gawk gsed grep gnutar gmake file findutils unrar wget coreutils e2fsprogs ossp-uuid asciidoc fastjar flex getopt gtk2 intltool jikes hs-zlib p5-extutils-makemaker python26 rsync ruby sdcc unzip bison autoconf help2man

* Run ctworks with "clean" switch to delete dmg file completely.
- ln -s /path/to/ports/bin/gsed /path/to/ports/bin/sed

./ctworks.sh clean
### Resources

## Linaro Resources
14.08 Release
> https://wiki.linaro.org/Cycles/1408/Release
http://releases.linaro.org/
https://developer.apple.com/library/ios/technotes/tn2339/_index.html
https://www.macports.org/install.php

Linux and Windows Binaries
> http://releases.linaro.org/14.08/components/toolchain/binaries/
### Testbed

crosstool-NG package from 14.08 Release
> http://releases.linaro.org/14.08/components/toolchain/binaries/crosstool-ng-linaro-1.13.1-4.9-2014.08.tar.bz2
$ uname -a
Darwin gPro.local 15.5.0 Darwin Kernel Version 15.5.0: Tue Apr 19 18:36:36 PDT 2016; root:xnu-3248.50.21~8/RELEASE_X86_64 x86_64
$ gcc --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 7.3.0 (clang-703.0.31)
Target: x86_64-apple-darwin15.5.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
$ /opt/local/bin/port version
Version: 2.3.4

#### Enjoy!
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@ CT_DEBUG_CT_SAVE_STEPS_GZIP=y
#
# Paths
#
CT_LOCAL_TARBALLS_DIR=""
CT_LOCAL_TARBALLS_DIR="__CTWORKS_DIR__/tarballs"
CT_SAVE_TARBALLS=y
CT_WORK_DIR="${CT_TOP_DIR}/.build"
CT_PREFIX_DIR="/opt/devel/projects/crosstool/disk/${CT_TARGET}"
CT_PREFIX_DIR="__CTWORKS_DIR__/disk/${CT_TARGET}"
CT_INSTALL_DIR="${CT_PREFIX_DIR}"
CT_RM_RF_PREFIX_DIR=y
CT_REMOVE_DOCS=y
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@ CT_DEBUG_CT_SAVE_STEPS_GZIP=y
#
# Paths
#
CT_LOCAL_TARBALLS_DIR=""
CT_LOCAL_TARBALLS_DIR="__CTWORKS_DIR__/tarballs"
CT_SAVE_TARBALLS=y
CT_WORK_DIR="${CT_TOP_DIR}/.build"
CT_PREFIX_DIR="/opt/devel/projects/crosstool/disk/${CT_TARGET}"
CT_PREFIX_DIR="__CTWORKS_DIR__/disk/${CT_TARGET}"
CT_INSTALL_DIR="${CT_PREFIX_DIR}"
CT_RM_RF_PREFIX_DIR=y
CT_REMOVE_DOCS=y
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@ CT_DEBUG_CT_SAVE_STEPS_GZIP=y
#
# Paths
#
CT_LOCAL_TARBALLS_DIR=""
CT_LOCAL_TARBALLS_DIR="__CTWORKS_DIR__/tarballs"
CT_SAVE_TARBALLS=y
CT_WORK_DIR="${CT_TOP_DIR}/.build"
CT_PREFIX_DIR="/opt/devel/projects/crosstool/disk/${CT_TARGET}"
CT_PREFIX_DIR="__CTWORKS_DIR__/disk/${CT_TARGET}"
CT_INSTALL_DIR="${CT_PREFIX_DIR}"
CT_RM_RF_PREFIX_DIR=y
CT_REMOVE_DOCS=y
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@ CT_DEBUG_CT_SAVE_STEPS_GZIP=y
#
# Paths
#
CT_LOCAL_TARBALLS_DIR=""
CT_LOCAL_TARBALLS_DIR="__CTWORKS_DIR__/tarballs"
CT_SAVE_TARBALLS=y
CT_WORK_DIR="${CT_TOP_DIR}/.build"
CT_PREFIX_DIR="/opt/devel/projects/crosstool/disk/${CT_TARGET}"
CT_PREFIX_DIR="__CTWORKS_DIR__/disk/${CT_TARGET}"
CT_INSTALL_DIR="${CT_PREFIX_DIR}"
CT_RM_RF_PREFIX_DIR=y
CT_REMOVE_DOCS=y
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@ CT_DEBUG_CT_SAVE_STEPS_GZIP=y
#
# Paths
#
CT_LOCAL_TARBALLS_DIR=""
CT_LOCAL_TARBALLS_DIR="__CTWORKS_DIR__/tarballs"
CT_SAVE_TARBALLS=y
CT_WORK_DIR="${CT_TOP_DIR}/.build"
CT_PREFIX_DIR="/opt/devel/projects/crosstool/disk/${CT_TARGET}"
CT_PREFIX_DIR="__CTWORKS_DIR__/disk/${CT_TARGET}"
CT_INSTALL_DIR="${CT_PREFIX_DIR}"
CT_RM_RF_PREFIX_DIR=y
CT_REMOVE_DOCS=y
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@ CT_DEBUG_CT_SAVE_STEPS_GZIP=y
#
# Paths
#
CT_LOCAL_TARBALLS_DIR=""
CT_LOCAL_TARBALLS_DIR="__CTWORKS_DIR__/tarballs"
CT_SAVE_TARBALLS=y
CT_WORK_DIR="${CT_TOP_DIR}/.build"
CT_PREFIX_DIR="/opt/devel/projects/crosstool/disk/${CT_TARGET}"
CT_PREFIX_DIR="__CTWORKS_DIR__/disk/${CT_TARGET}"
CT_INSTALL_DIR="${CT_PREFIX_DIR}"
CT_RM_RF_PREFIX_DIR=y
CT_REMOVE_DOCS=y
Expand Down Expand Up @@ -413,7 +414,7 @@ CT_LIBC_UCLIBC_DEBUG_LEVEL_0=y
# CT_LIBC_UCLIBC_DEBUG_LEVEL_1 is not set
# CT_LIBC_UCLIBC_DEBUG_LEVEL_2 is not set
CT_LIBC_UCLIBC_DEBUG_LEVEL=0
CT_LIBC_UCLIBC_CONFIG_FILE="/opt/devel/projects/crosstool/configs/linaro-mips-linux-uclibc-uClibc-0.9.32.config"
CT_LIBC_UCLIBC_CONFIG_FILE="__CTWORKS_DIR__/configs/linaro-mips-linux-uclibc-uClibc-0.9.32.config"
CT_LIBC_SUPPORT_THREADS_ANY=y
CT_LIBC_SUPPORT_NPTL=y
CT_LIBC_SUPPORT_LINUXTHREADS=y
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@ CT_DEBUG_CT_SAVE_STEPS_GZIP=y
#
# Paths
#
CT_LOCAL_TARBALLS_DIR=""
CT_LOCAL_TARBALLS_DIR="__CTWORKS_DIR__/tarballs"
CT_SAVE_TARBALLS=y
CT_WORK_DIR="${CT_TOP_DIR}/.build"
CT_PREFIX_DIR="/opt/devel/projects/crosstool/disk/${CT_TARGET}"
CT_PREFIX_DIR="__CTWORKS_DIR__/disk/${CT_TARGET}"
CT_INSTALL_DIR="${CT_PREFIX_DIR}"
CT_RM_RF_PREFIX_DIR=y
CT_REMOVE_DOCS=y
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@ CT_DEBUG_CT_SAVE_STEPS_GZIP=y
#
# Paths
#
CT_LOCAL_TARBALLS_DIR=""
CT_LOCAL_TARBALLS_DIR="__CTWORKS_DIR__/tarballs"
CT_SAVE_TARBALLS=y
CT_WORK_DIR="${CT_TOP_DIR}/.build"
CT_PREFIX_DIR="/opt/devel/projects/crosstool/disk/${CT_TARGET}"
CT_PREFIX_DIR="__CTWORKS_DIR__/disk/${CT_TARGET}"
CT_INSTALL_DIR="${CT_PREFIX_DIR}"
CT_RM_RF_PREFIX_DIR=y
CT_REMOVE_DOCS=y
Expand Down Expand Up @@ -413,7 +414,7 @@ CT_LIBC_UCLIBC_DEBUG_LEVEL_0=y
# CT_LIBC_UCLIBC_DEBUG_LEVEL_1 is not set
# CT_LIBC_UCLIBC_DEBUG_LEVEL_2 is not set
CT_LIBC_UCLIBC_DEBUG_LEVEL=0
CT_LIBC_UCLIBC_CONFIG_FILE="/opt/devel/projects/crosstool/configs/linaro-mipsel-linux-uclibc-uClibc-0.9.32.config"
CT_LIBC_UCLIBC_CONFIG_FILE="__CTWORKS_DIR__/configs/linaro-mipsel-linux-uclibc-uClibc-0.9.32.config"
CT_LIBC_SUPPORT_THREADS_ANY=y
CT_LIBC_SUPPORT_NPTL=y
CT_LIBC_SUPPORT_LINUXTHREADS=y
Expand Down
5 changes: 3 additions & 2 deletions configs/x86_64-linux-gnu → configs/14.08-x86_64-linux-gnu
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@ CT_DEBUG_CT_SAVE_STEPS_GZIP=y
#
# Paths
#
CT_LOCAL_TARBALLS_DIR=""
CT_LOCAL_TARBALLS_DIR="__CTWORKS_DIR__/tarballs"
CT_SAVE_TARBALLS=y
CT_WORK_DIR="${CT_TOP_DIR}/.build"
CT_PREFIX_DIR="/opt/devel/projects/crosstool/disk/${CT_TARGET}"
CT_PREFIX_DIR="__CTWORKS_DIR__/disk/${CT_TARGET}"
CT_INSTALL_DIR="${CT_PREFIX_DIR}"
CT_RM_RF_PREFIX_DIR=y
CT_REMOVE_DOCS=y
Expand Down
Loading

0 comments on commit fdf464e

Please sign in to comment.