Skip to content

Commit

Permalink
Updated to crosstool-ng-1.23.0
Browse files Browse the repository at this point in the history
Enable link-time optimization support
Generate PDF manuals
  • Loading branch information
thomask77 committed Apr 25, 2017
1 parent 61dbe99 commit b7871ed
Show file tree
Hide file tree
Showing 8 changed files with 53 additions and 38 deletions.
18 changes: 12 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,36 @@ build Windows and Linux toolchains for my personal use.

### Installation

* Tested on Ubuntu 16.04 LTS and Debian 8.7

```bash
sudo apt-get install -y autoconf gawk bison flex gperf libncurses5-dev texinfo help2man mingw-w64
sudo apt-get update
sudo apt-get install -y build-essential automake gperf bison flex gawk libncurses5-dev python-dev texinfo help2man mingw-w64

./prepare-crosstool.sh
./bootstrap.sh
```

### How to build

Build a single toolchain:

```bash
./build-toolchain.sh gcc-arm-socfpga_hf-eabi-linux
./build-toolchain.sh gcc-arm-socfpga_hf-eabi-linux
```

.. or build all of them (takes about 2 hours on a recent Core-i7 machine):
.. or build all of them:

```bash
./build-toolchain.sh gcc-*
./build-toolchain.sh gcc-*
```

Building all toolchains requires 45 GB of disk space and will take about
2 hours on a recent Core i7 machine.

Afterwards, you will (hopefully) find nicely packaged toolchains in the
"releases" folder.


## Altera SoCFPGA (Cortex-A9)

Altera's [SoC EDS][1] includes a variant of Sourcery CodeBench _Lite_.
Expand Down Expand Up @@ -84,4 +91,3 @@ Mentor Graphics stopped to release Sourcery CodeBench _Lite_ in 2013
* Reentrancy with multi-thread support

```-DREENTRANT_SYSCALLS_PROVIDED```

File renamed without changes.
47 changes: 32 additions & 15 deletions build-toolchain.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,13 @@ CT_NG=$BASE_DIR/crosstool-ng/ct-ng

function build {
CONFIG_DIR=$BASE_DIR/$1

mkdir -p $DOWNLOADS_DIR
mkdir -p $RELEASES_DIR

echo
echo "***** Building $1 *****"
echo

cd $CONFIG_DIR
mkdir -p "$DOWNLOADS_DIR"

cd "$CONFIG_DIR"
if [[ ! -f defconfig ]]; then
echo "ERROR: $CONFIG_DIR/defconfig not found" 1>&2
exit 1
Expand All @@ -26,27 +24,45 @@ function build {
$CT_NG defconfig
$CT_NG clean
$CT_NG build
}


function package {
CONFIG_DIR=$BASE_DIR/$1
echo
echo "***** Packaging $1 *****"
echo

cd $CONFIG_DIR/output
mkdir -p "$RELEASES_DIR"

# The output directory name is defined by the defconfig and
# includes the GCC version number (which we don't know yet).
#
# So we have to search the output directory.
#
for REL_NAME in *; do
if [[ -d $REL_NAME ]]; then
REL_HOST=${1/*-/} # win64 or linux
REL_DATE=$(date +%Y%m%d -r$REL_NAME)

# h - do not create symlinks (windows can't extract them)
#
tar chvJf $RELEASES_DIR/$REL_NAME-$REL_HOST-$REL_DATE.tar.xz $REL_NAME
fi
cd "$CONFIG_DIR/output"

for REL_NAME in gcc-*; do
if [[ ! -d $REL_NAME ]]; then continue; fi

REL_HOST="${1/*-/}" # win64 or linux
REL_DATE=$(date +%Y%m%d -r"$REL_NAME")

# Keep PDF documentation only and move to one directory
#
chmod -R +w "$REL_NAME/share"
find "$REL_NAME/share/doc" -type f -not -name "*.pdf" -delete
find "$REL_NAME/share/doc" -type f -exec mv "{}" "$REL_NAME/share/doc" ";"
find "$REL_NAME/share/doc" -type d -empty -delete
rm -rf "$REL_NAME/share/info"
rm -rf "$REL_NAME/share/man"
chmod -R -w "$REL_NAME/share"

# --dereference because windows can't handle symlinks
#
tar --create --verbose --dereference --xz \
--file "$RELEASES_DIR/$REL_NAME-$REL_HOST-$REL_DATE.tar.xz" \
"$REL_NAME"
done
}

Expand All @@ -59,5 +75,6 @@ fi

for ARG in "$@"; do
build "$ARG"
package "$ARG"
done

2 changes: 1 addition & 1 deletion crosstool-ng
Submodule crosstool-ng updated 152 files
6 changes: 2 additions & 4 deletions gcc-arm-lpc32xx_hf-eabi-linux/defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,18 @@ CT_DEBUG_CT_SAVE_STEPS=y
CT_DEBUG_INTERACTIVE=y
CT_LOCAL_TARBALLS_DIR="${CT_TOP_DIR}/../downloads"
CT_PREFIX_DIR="${CT_TOP_DIR}/output/gcc-${CT_TARGET}-${CT_CC_GCC_VERSION}"
# CT_REMOVE_DOCS is not set
CT_BUILD_MANUALS=y
CT_ARCH_arm=y
# CT_ARCH_USE_MMU is not set
CT_ARCH_CPU="arm926ej-s"
CT_ARCH_FPU="vfp"
CT_ARCH_FLOAT_HW=y
# CT_ARCH_ARM_TUPLE_USE_EABIHF is not set
CT_STATIC_TOOLCHAIN=y
CT_TARGET_VENDOR="lpc32xx_hf"
CT_LIBC_NEWLIB_TARGET_CFLAGS="-DREENTRANT_SYSCALLS_PROVIDED"
CT_LIBC_NEWLIB_IO_C99FMT=y
CT_LIBC_NEWLIB_IO_LL=y
CT_LIBC_NEWLIB_IO_FLOAT=y
CT_LIBC_NEWLIB_DISABLE_SUPPLIED_SYSCALLS=y
# CT_LIBC_NEWLIB_ENABLE_TARGET_OPTSPACE is not set
# CT_CC_GCC_ENABLE_TARGET_OPTSPACE is not set
CT_CC_LANG_CXX=y
CT_DEBUG_gdb=y
6 changes: 2 additions & 4 deletions gcc-arm-lpc32xx_hf-eabi-win64/defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ CT_DEBUG_CT_SAVE_STEPS=y
CT_DEBUG_INTERACTIVE=y
CT_LOCAL_TARBALLS_DIR="${CT_TOP_DIR}/../downloads"
CT_PREFIX_DIR="${CT_TOP_DIR}/output/gcc-${CT_TARGET}-${CT_CC_GCC_VERSION}"
# CT_REMOVE_DOCS is not set
CT_BUILD_MANUALS=y
CT_ARCH_arm=y
# CT_ARCH_USE_MMU is not set
CT_ARCH_CPU="arm926ej-s"
CT_ARCH_FPU="vfp"
CT_ARCH_FLOAT_HW=y
# CT_ARCH_ARM_TUPLE_USE_EABIHF is not set
CT_STATIC_TOOLCHAIN=y
CT_TARGET_VENDOR="lpc32xx_hf"
CT_CANADIAN=y
CT_HOST="x86_64-w64-mingw32"
Expand All @@ -18,7 +18,5 @@ CT_LIBC_NEWLIB_IO_C99FMT=y
CT_LIBC_NEWLIB_IO_LL=y
CT_LIBC_NEWLIB_IO_FLOAT=y
CT_LIBC_NEWLIB_DISABLE_SUPPLIED_SYSCALLS=y
# CT_LIBC_NEWLIB_ENABLE_TARGET_OPTSPACE is not set
# CT_CC_GCC_ENABLE_TARGET_OPTSPACE is not set
CT_CC_LANG_CXX=y
CT_DEBUG_gdb=y
6 changes: 2 additions & 4 deletions gcc-arm-socfpga_hf-eabi-linux/defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,18 @@ CT_DEBUG_CT_SAVE_STEPS=y
CT_DEBUG_INTERACTIVE=y
CT_LOCAL_TARBALLS_DIR="${CT_TOP_DIR}/../downloads"
CT_PREFIX_DIR="${CT_TOP_DIR}/output/gcc-${CT_TARGET}-${CT_CC_GCC_VERSION}"
# CT_REMOVE_DOCS is not set
CT_BUILD_MANUALS=y
CT_ARCH_arm=y
# CT_ARCH_USE_MMU is not set
CT_ARCH_CPU="cortex-a9"
CT_ARCH_FPU="neon"
CT_ARCH_FLOAT_HW=y
# CT_ARCH_ARM_TUPLE_USE_EABIHF is not set
CT_STATIC_TOOLCHAIN=y
CT_TARGET_VENDOR="socfpga_hf"
CT_LIBC_NEWLIB_TARGET_CFLAGS="-DREENTRANT_SYSCALLS_PROVIDED -D__DYNAMIC_REENT__ -mno-unaligned-access"
CT_LIBC_NEWLIB_IO_C99FMT=y
CT_LIBC_NEWLIB_IO_LL=y
CT_LIBC_NEWLIB_IO_FLOAT=y
CT_LIBC_NEWLIB_DISABLE_SUPPLIED_SYSCALLS=y
# CT_LIBC_NEWLIB_ENABLE_TARGET_OPTSPACE is not set
# CT_CC_GCC_ENABLE_TARGET_OPTSPACE is not set
CT_CC_LANG_CXX=y
CT_DEBUG_gdb=y
6 changes: 2 additions & 4 deletions gcc-arm-socfpga_hf-eabi-win64/defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ CT_DEBUG_CT_SAVE_STEPS=y
CT_DEBUG_INTERACTIVE=y
CT_LOCAL_TARBALLS_DIR="${CT_TOP_DIR}/../downloads"
CT_PREFIX_DIR="${CT_TOP_DIR}/output/gcc-${CT_TARGET}-${CT_CC_GCC_VERSION}"
# CT_REMOVE_DOCS is not set
CT_BUILD_MANUALS=y
CT_ARCH_arm=y
# CT_ARCH_USE_MMU is not set
CT_ARCH_CPU="cortex-a9"
CT_ARCH_FPU="neon"
CT_ARCH_FLOAT_HW=y
# CT_ARCH_ARM_TUPLE_USE_EABIHF is not set
CT_STATIC_TOOLCHAIN=y
CT_TARGET_VENDOR="socfpga_hf"
CT_CANADIAN=y
CT_HOST="x86_64-w64-mingw32"
Expand All @@ -18,7 +18,5 @@ CT_LIBC_NEWLIB_IO_C99FMT=y
CT_LIBC_NEWLIB_IO_LL=y
CT_LIBC_NEWLIB_IO_FLOAT=y
CT_LIBC_NEWLIB_DISABLE_SUPPLIED_SYSCALLS=y
# CT_LIBC_NEWLIB_ENABLE_TARGET_OPTSPACE is not set
# CT_CC_GCC_ENABLE_TARGET_OPTSPACE is not set
CT_CC_LANG_CXX=y
CT_DEBUG_gdb=y

0 comments on commit b7871ed

Please sign in to comment.