diff --git a/README.md b/README.md index e03e2f6..7c355ad 100644 --- a/README.md +++ b/README.md @@ -5,10 +5,13 @@ 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 @@ -16,18 +19,22 @@ sudo apt-get install -y autoconf gawk bison flex gperf libncurses5-dev texinfo h 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_. @@ -84,4 +91,3 @@ Mentor Graphics stopped to release Sourcery CodeBench _Lite_ in 2013 * Reentrancy with multi-thread support ```-DREENTRANT_SYSCALLS_PROVIDED``` - diff --git a/prepare-crosstool.sh b/bootstrap.sh similarity index 100% rename from prepare-crosstool.sh rename to bootstrap.sh diff --git a/build-toolchain.sh b/build-toolchain.sh index 9d21526..91899af 100755 --- a/build-toolchain.sh +++ b/build-toolchain.sh @@ -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 @@ -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 } @@ -59,5 +75,6 @@ fi for ARG in "$@"; do build "$ARG" + package "$ARG" done diff --git a/crosstool-ng b/crosstool-ng index a3dd55b..368a016 160000 --- a/crosstool-ng +++ b/crosstool-ng @@ -1 +1 @@ -Subproject commit a3dd55b96409922a416c05ab053569ec4f91126b +Subproject commit 368a0169a27313cca60cf7d7358b6f3ef12122e4 diff --git a/gcc-arm-lpc32xx_hf-eabi-linux/defconfig b/gcc-arm-lpc32xx_hf-eabi-linux/defconfig index f22a755..c5be57d 100644 --- a/gcc-arm-lpc32xx_hf-eabi-linux/defconfig +++ b/gcc-arm-lpc32xx_hf-eabi-linux/defconfig @@ -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 diff --git a/gcc-arm-lpc32xx_hf-eabi-win64/defconfig b/gcc-arm-lpc32xx_hf-eabi-win64/defconfig index 4b24241..9eb295b 100644 --- a/gcc-arm-lpc32xx_hf-eabi-win64/defconfig +++ b/gcc-arm-lpc32xx_hf-eabi-win64/defconfig @@ -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" @@ -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 diff --git a/gcc-arm-socfpga_hf-eabi-linux/defconfig b/gcc-arm-socfpga_hf-eabi-linux/defconfig index 9350148..c4e3bca 100644 --- a/gcc-arm-socfpga_hf-eabi-linux/defconfig +++ b/gcc-arm-socfpga_hf-eabi-linux/defconfig @@ -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 diff --git a/gcc-arm-socfpga_hf-eabi-win64/defconfig b/gcc-arm-socfpga_hf-eabi-win64/defconfig index a0f759d..d6500bc 100644 --- a/gcc-arm-socfpga_hf-eabi-win64/defconfig +++ b/gcc-arm-socfpga_hf-eabi-win64/defconfig @@ -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" @@ -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