diff --git a/README.md b/README.md index 16cb2bc..b4d74a3 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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! diff --git a/configs/linaro-arm-linux-gnueabi b/configs/14.08-linaro-arm-linux-gnueabi similarity index 98% rename from configs/linaro-arm-linux-gnueabi rename to configs/14.08-linaro-arm-linux-gnueabi index b86a0b4..938d306 100644 --- a/configs/linaro-arm-linux-gnueabi +++ b/configs/14.08-linaro-arm-linux-gnueabi @@ -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 diff --git a/configs/linaro-arm-linux-gnueabihf b/configs/14.08-linaro-arm-linux-gnueabihf similarity index 99% rename from configs/linaro-arm-linux-gnueabihf rename to configs/14.08-linaro-arm-linux-gnueabihf index b6d8ca4..72a8d3a 100644 --- a/configs/linaro-arm-linux-gnueabihf +++ b/configs/14.08-linaro-arm-linux-gnueabihf @@ -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 diff --git a/configs/linaro-arm-linux-gnueabihf-raspbian b/configs/14.08-linaro-arm-linux-gnueabihf-raspbian similarity index 98% rename from configs/linaro-arm-linux-gnueabihf-raspbian rename to configs/14.08-linaro-arm-linux-gnueabihf-raspbian index b1a9551..355e00a 100644 --- a/configs/linaro-arm-linux-gnueabihf-raspbian +++ b/configs/14.08-linaro-arm-linux-gnueabihf-raspbian @@ -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 diff --git a/configs/linaro-arm-none-eabi b/configs/14.08-linaro-arm-none-eabi similarity index 98% rename from configs/linaro-arm-none-eabi rename to configs/14.08-linaro-arm-none-eabi index 93ea286..148cea6 100644 --- a/configs/linaro-arm-none-eabi +++ b/configs/14.08-linaro-arm-none-eabi @@ -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 diff --git a/configs/linaro-mips-linux-gnu b/configs/14.08-linaro-mips-linux-gnu similarity index 98% rename from configs/linaro-mips-linux-gnu rename to configs/14.08-linaro-mips-linux-gnu index c109eee..f3b7a3c 100644 --- a/configs/linaro-mips-linux-gnu +++ b/configs/14.08-linaro-mips-linux-gnu @@ -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 diff --git a/configs/linaro-mips-linux-uclibc b/configs/14.08-linaro-mips-linux-uclibc similarity index 97% rename from configs/linaro-mips-linux-uclibc rename to configs/14.08-linaro-mips-linux-uclibc index 05251db..9686ecd 100644 --- a/configs/linaro-mips-linux-uclibc +++ b/configs/14.08-linaro-mips-linux-uclibc @@ -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 @@ -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 diff --git a/configs/linaro-mips-linux-uclibc-uClibc-0.9.32.config b/configs/14.08-linaro-mips-linux-uclibc-uClibc-0.9.32.config similarity index 100% rename from configs/linaro-mips-linux-uclibc-uClibc-0.9.32.config rename to configs/14.08-linaro-mips-linux-uclibc-uClibc-0.9.32.config diff --git a/configs/linaro-mipsel-linux-gnu b/configs/14.08-linaro-mipsel-linux-gnu similarity index 98% rename from configs/linaro-mipsel-linux-gnu rename to configs/14.08-linaro-mipsel-linux-gnu index c1f6303..7b4dfea 100644 --- a/configs/linaro-mipsel-linux-gnu +++ b/configs/14.08-linaro-mipsel-linux-gnu @@ -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 diff --git a/configs/linaro-mipsel-linux-uclibc b/configs/14.08-linaro-mipsel-linux-uclibc similarity index 97% rename from configs/linaro-mipsel-linux-uclibc rename to configs/14.08-linaro-mipsel-linux-uclibc index 5fa0ad7..0621db9 100644 --- a/configs/linaro-mipsel-linux-uclibc +++ b/configs/14.08-linaro-mipsel-linux-uclibc @@ -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 @@ -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 diff --git a/configs/linaro-mipsel-linux-uclibc-uClibc-0.9.32.config b/configs/14.08-linaro-mipsel-linux-uclibc-uClibc-0.9.32.config similarity index 100% rename from configs/linaro-mipsel-linux-uclibc-uClibc-0.9.32.config rename to configs/14.08-linaro-mipsel-linux-uclibc-uClibc-0.9.32.config diff --git a/configs/x86_64-linux-gnu b/configs/14.08-x86_64-linux-gnu similarity index 98% rename from configs/x86_64-linux-gnu rename to configs/14.08-x86_64-linux-gnu index 469ee6b..42bc639 100644 --- a/configs/x86_64-linux-gnu +++ b/configs/14.08-x86_64-linux-gnu @@ -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 diff --git a/configs/14.09-linaro-aarch64-linux-gnu b/configs/14.09-linaro-aarch64-linux-gnu new file mode 100644 index 0000000..452959e --- /dev/null +++ b/configs/14.09-linaro-aarch64-linux-gnu @@ -0,0 +1,579 @@ +# +# Automatically generated make config: don't edit +# crosstool-NG linaro-1.13.1-4.9-2014.09 Configuration +# Fri May 27 01:57:19 2016 +# +CT_CONFIGURE_has_xzutils=y +CT_CONFIGURE_has_svn=y +CT_MODULES=y + +# +# Paths and misc options +# + +# +# crosstool-NG behavior +# +CT_OBSOLETE=y +CT_EXPERIMENTAL=y +CT_DEBUG_CT=y +# CT_DEBUG_PAUSE_STEPS is not set +CT_DEBUG_CT_SAVE_STEPS=y +CT_DEBUG_CT_SAVE_STEPS_GZIP=y +# CT_NO_OVERIDE_LC_MESSAGES is not set + +# +# Paths +# +CT_LOCAL_TARBALLS_DIR="__CTWORKS_DIR__/tarballs" +CT_SAVE_TARBALLS=y +CT_WORK_DIR="${CT_TOP_DIR}/.build" +CT_PREFIX_DIR="__CTWORKS_DIR__/disk/${CT_TARGET}" +CT_INSTALL_DIR="${CT_PREFIX_DIR}" +CT_RM_RF_PREFIX_DIR=y +# CT_REMOVE_DOCS is not set +CT_BUILD_MANUALS=y +# CT_INSTALL_DIR_RO is not set +CT_STRIP_ALL_TOOLCHAIN_EXECUTABLES=y + +# +# Downloading +# +# CT_FORBID_DOWNLOAD is not set +# CT_FORCE_DOWNLOAD is not set +CT_CONNECT_TIMEOUT=10 +# CT_ONLY_DOWNLOAD is not set +# CT_USE_MIRROR is not set + +# +# Extracting +# +# CT_FORCE_EXTRACT is not set +CT_OVERIDE_CONFIG_GUESS_SUB=y +# CT_ONLY_EXTRACT is not set +# CT_PATCH_BUNDLED is not set +# CT_PATCH_LOCAL is not set +CT_PATCH_BUNDLED_LOCAL=y +# CT_PATCH_LOCAL_BUNDLED is not set +# CT_PATCH_BUNDLED_FALLBACK_LOCAL is not set +# CT_PATCH_LOCAL_FALLBACK_BUNDLED is not set +# CT_PATCH_NONE is not set +CT_PATCH_ORDER="bundled,local" +CT_PATCH_USE_LOCAL=y +CT_LOCAL_PATCH_DIR="${CT_LIB_DIR}/contrib/linaro/patches" + +# +# Build behavior +# +CT_PARALLEL_JOBS=2 +CT_LOAD=0 +CT_USE_PIPES=y +CT_EXTRA_FLAGS_FOR_HOST="-fno-stack-protector -U_FORTIFY_SOURCE" +# CT_CONFIG_SHELL_SH is not set +# CT_CONFIG_SHELL_ASH is not set +CT_CONFIG_SHELL_BASH=y +# CT_CONFIG_SHELL_CUSTOM is not set +CT_CONFIG_SHELL="${bash}" + +# +# Logging +# +# CT_LOG_ERROR is not set +# CT_LOG_WARN is not set +# CT_LOG_INFO is not set +CT_LOG_EXTRA=y +# CT_LOG_ALL is not set +# CT_LOG_DEBUG is not set +CT_LOG_LEVEL_MAX="EXTRA" +# CT_LOG_SEE_TOOLS_WARN is not set +# CT_LOG_PROGRESS_BAR is not set +CT_LOG_TO_FILE=y +CT_LOG_FILE_COMPRESS=y + +# +# Target options +# +CT_ARCH="aarch64" +CT_ARCH_SUPPORTS_BOTH_ENDIAN=y +CT_ARCH_SUPPORTS_64=y +CT_ARCH_SUPPORT_ARCH=y +CT_ARCH_SUPPORT_CPU=y +CT_ARCH_DEFAULT_HAS_MMU=y +CT_ARCH_DEFAULT_LE=y +CT_ARCH_DEFAULT_64=y +CT_ARCH_ARCH="armv8-a" +CT_ARCH_CPU="" +# CT_ARCH_BE is not set +CT_ARCH_LE=y +CT_ARCH_64=y +CT_ARCH_BITNESS=64 +CT_ARCH_FLOAT_HW=y +# CT_ARCH_FLOAT_SW is not set +CT_TARGET_CFLAGS="-g -O2" +CT_TARGET_LDFLAGS="" +CT_ARCH_aarch64=y +# CT_ARCH_alpha is not set +# CT_ARCH_arm is not set +# CT_ARCH_avr32 is not set +# CT_ARCH_blackfin is not set +# CT_ARCH_m68k is not set +# CT_ARCH_mips is not set +# CT_ARCH_powerpc is not set +# CT_ARCH_s390 is not set +# CT_ARCH_sh is not set +# CT_ARCH_sparc is not set +# CT_ARCH_x86 is not set +CT_ARCH_aarch64_AVAILABLE=y +CT_ARCH_alpha_AVAILABLE=y +CT_ARCH_arm_AVAILABLE=y +CT_ARCH_avr32_AVAILABLE=y +CT_ARCH_blackfin_AVAILABLE=y +CT_ARCH_m68k_AVAILABLE=y +CT_ARCH_mips_AVAILABLE=y +CT_ARCH_powerpc_AVAILABLE=y +CT_ARCH_s390_AVAILABLE=y +CT_ARCH_sh_AVAILABLE=y +CT_ARCH_sparc_AVAILABLE=y +CT_ARCH_x86_AVAILABLE=y + +# +# Generic target options +# +CT_ARCH_USE_MMU=y + +# +# Target optimisations +# +CT_ARCH_FLOAT="hard" + +# +# Toolchain options +# + +# +# General toolchain options +# +CT_USE_SYSROOT=y +# CT_PREBUILT_SYSROOT is not set +CT_SYSROOT_NAME="libc" +CT_SYSROOT_DIR_PREFIX="" +# CT_STATIC_TOOLCHAIN is not set +CT_TOOLCHAIN_PKGVERSION="Linaro GCC 4.9-2014.09" +CT_TOOLCHAIN_BUGURL="https://bugs.launchpad.net/gcc-linaro" + +# +# Tuple completion and aliasing +# +CT_TARGET_VENDOR="" +CT_TARGET_ALIAS_SED_EXPR="" +CT_TARGET_ALIAS="" + +# +# Toolchain type +# +# CT_NATIVE is not set +CT_CROSS=y +# CT_CROSS_NATIVE is not set +# CT_CANADIAN is not set +CT_TOOLCHAIN_TYPE="cross" + +# +# Build system +# +CT_BUILD="" +CT_BUILD_PREFIX="" +CT_BUILD_SUFFIX="" +# CT_BUILD_USE_LSBCC is not set + +# +# Misc options +# +CT_TOOLCHAIN_ENABLE_NLS=y +# CT_TOOLCHAIN_ENABLE_MULTILIB is not set + +# +# Operating System +# +CT_KERNEL_SUPPORTS_SHARED_LIBS=y +CT_KERNEL="linux" +CT_KERNEL_VERSION="3.7" +# CT_KERNEL_bare_metal is not set +CT_KERNEL_linux=y +CT_KERNEL_bare_metal_AVAILABLE=y +CT_KERNEL_linux_AVAILABLE=y +# CT_KERNEL_LINUX_USE_CUSTOM_HEADERS is not set +CT_KERNEL_V_3_7=y +# CT_KERNEL_V_3_1_1 is not set +# CT_KERNEL_V_3_1 is not set +# CT_KERNEL_V_3_0_9 is not set +# CT_KERNEL_V_2_6_39_4 is not set +# CT_KERNEL_V_2_6_38_8 is not set +# CT_KERNEL_V_2_6_37_6 is not set +# CT_KERNEL_V_2_6_36_4 is not set +# CT_KERNEL_V_2_6_33_20 is not set +# CT_KERNEL_V_2_6_32_48 is not set +# CT_KERNEL_V_2_6_31_14 is not set +# CT_KERNEL_V_2_6_27_57 is not set +# CT_KERNEL_LINUX_CUSTOM is not set +CT_KERNEL_mingw32_AVAILABLE=y +CT_KERNEL_prebuilt_AVAILABLE=y + +# +# Common kernel options +# +CT_SHARED_LIBS=y + +# +# linux other options +# +CT_KERNEL_LINUX_VERBOSITY_0=y +# CT_KERNEL_LINUX_VERBOSITY_1 is not set +# CT_KERNEL_LINUX_VERBOSITY_2 is not set +CT_KERNEL_LINUX_VERBOSE_LEVEL=0 +# CT_KERNEL_LINUX_INSTALL_CHECK is not set + +# +# Binary utilities +# +CT_ARCH_BINFMT_ELF=y + +# +# GNU binutils +# +CT_BINUTILS_LINARO_V_2_24_0_2014_09=y +# CT_BINUTILS_V_2_24_PRE is not set +# CT_BINUTILS_V_2_23_1 is not set +# CT_BINUTILS_V_2_22 is not set +# CT_BINUTILS_V_2_21_53 is not set +# CT_BINUTILS_V_2_21_1a is not set +# CT_BINUTILS_V_2_20_1a is not set +# CT_BINUTILS_V_2_19_1a is not set +# CT_BINUTILS_V_2_18a is not set +# CT_BINUTILS_V_2_17a is not set +# CT_BINUTILS_V_2_16_1a is not set +CT_BINUTILS_VERSION="linaro-2.24.0-2014.09" +CT_BINUTILS_2_22_or_later=y +CT_BINUTILS_2_21_or_later=y +CT_BINUTILS_2_20_or_later=y +CT_BINUTILS_2_19_or_later=y +CT_BINUTILS_2_18_or_later=y +CT_BINUTILS_HAS_GOLD=y +CT_BINUTILS_HAS_PLUGINS=y +CT_BINUTILS_HAS_PKGVERSION_BUGURL=y +CT_BINUTILS_FORCE_LD_BFD=y +CT_BINUTILS_LINKER_LD=y +CT_BINUTILS_LINKERS_LIST="ld" +CT_BINUTILS_LINKER_DEFAULT="bfd" +CT_BINUTILS_PLUGINS=y +CT_BINUTILS_EXTRA_CONFIG_ARRAY="" +# CT_BINUTILS_FOR_TARGET is not set + +# +# sstrip +# +# CT_SSTRIP is not set + +# +# C compiler +# +CT_CC="gcc" +CT_CC_VERSION="linaro-4.9-2014.09" +CT_CC_gcc=y +CT_CC_GCC_SHOW_LINARO=y +CT_CC_V_linaro_4_9_2014_09=y +# CT_CC_V_linaro_4_7_2014_06 is not set +# CT_CC_V_linaro_4_8_2014_08 is not set +# CT_CC_V_linaro_4_7_TIP is not set +# CT_CC_V_arm_aarch64_4_7_PRE is not set +# CT_CC_V_4_7_0 is not set +# CT_CC_V_4_6_2 is not set +# CT_CC_V_4_6_1 is not set +# CT_CC_V_4_6_0 is not set +# CT_CC_V_linaro_4_5_2012_03 is not set +# CT_CC_V_4_5_3 is not set +# CT_CC_V_4_5_2 is not set +# CT_CC_V_4_5_1 is not set +# CT_CC_V_4_5_0 is not set +# CT_CC_V_linaro_4_4_2011_02_0 is not set +# CT_CC_V_4_4_6 is not set +# CT_CC_V_4_4_5 is not set +# CT_CC_V_4_4_4 is not set +# CT_CC_V_4_4_3 is not set +# CT_CC_V_4_4_2 is not set +# CT_CC_V_4_4_1 is not set +# CT_CC_V_4_4_0 is not set +# CT_CC_V_4_3_6 is not set +# CT_CC_V_4_3_5 is not set +# CT_CC_V_4_3_4 is not set +# CT_CC_V_4_3_3 is not set +# CT_CC_V_4_3_2 is not set +# CT_CC_V_4_3_1 is not set +# CT_CC_V_4_2_4 is not set +# CT_CC_V_4_2_3 is not set +# CT_CC_V_4_2_2 is not set +# CT_CC_V_4_2_1 is not set +# CT_CC_V_4_2_0 is not set +# CT_CC_V_4_1_2 is not set +# CT_CC_V_4_0_4 is not set +# CT_CC_V_3_4_6 is not set +CT_CC_GCC_4_2_or_later=y +CT_CC_GCC_4_3_or_later=y +CT_CC_GCC_4_4_or_later=y +CT_CC_GCC_4_5_or_later=y +CT_CC_GCC_4_6_or_later=y +CT_CC_GCC_4_7_or_later=y +CT_CC_GCC_4_8=y +CT_CC_GCC_4_8_or_later=y +CT_CC_GCC_HAS_GRAPHITE=y +CT_CC_GCC_HAS_LTO=y +CT_CC_GCC_HAS_PKGVERSION_BUGURL=y +CT_CC_GCC_HAS_BUILD_ID=y +CT_CC_GCC_ENABLE_PLUGINS=y +CT_CC_GCC_USE_GMP_MPFR=y +CT_CC_GCC_USE_PPL_CLOOG=y +CT_CC_GCC_USE_ISL_CLOOG=y +CT_CC_GCC_USE_MPC=y +CT_CC_LANG_FORTRAN=y +CT_CC_SUPPORT_CXX=y +CT_CC_SUPPORT_FORTRAN=y +CT_CC_SUPPORT_JAVA=y +CT_CC_SUPPORT_ADA=y +CT_CC_SUPPORT_OBJC=y +CT_CC_SUPPORT_OBJCXX=y + +# +# Additional supported languages: +# +CT_CC_LANG_CXX=y +# CT_CC_LANG_JAVA is not set +# CT_CC_LANG_ADA is not set +# CT_CC_LANG_OBJC is not set +# CT_CC_LANG_OBJCXX is not set +CT_CC_LANG_OTHERS="" + +# +# gcc other options +# +CT_CC_ENABLE_CXX_FLAGS="" +CT_CC_CORE_EXTRA_CONFIG_ARRAY="" +CT_CC_EXTRA_CONFIG_ARRAY="" +# CT_CC_STATIC_LIBSTDCXX is not set + +# +# Optimisation features +# +CT_CC_GCC_USE_GRAPHITE=y +CT_CC_GCC_USE_LTO=y + +# +# Settings for libraries running on target +# +# CT_CC_GCC_ENABLE_TARGET_OPTSPACE is not set +# CT_CC_GCC_LIBMUDFLAP is not set +CT_CC_GCC_LIBGOMP=y +# CT_CC_GCC_LIBSSP is not set + +# +# Misc. obscure options. +# +CT_CC_CXA_ATEXIT=y +CT_CC_GCC_DISABLE_PCH=y +CT_CC_GCC_SJLJ_EXCEPTIONS=m +CT_CC_GCC_LDBL_128=m +CT_CC_GCC_BUILD_ID=y + +# +# C-library +# +CT_LIBC="eglibc" +CT_LIBC_VERSION="linaro-2.19-2014.08" +CT_LIBC_eglibc=y +# CT_LIBC_glibc is not set +# CT_LIBC_uClibc is not set +CT_LIBC_eglibc_AVAILABLE=y +CT_LIBC_EGLIBC_LINARO_V_2_19_2014_08=y +# CT_LIBC_EGLIBC_V_2_17 is not set +# CT_LIBC_EGLIBC_V_2_14 is not set +# CT_LIBC_EGLIBC_V_2_13 is not set +# CT_LIBC_EGLIBC_V_2_12 is not set +# CT_LIBC_EGLIBC_V_2_11 is not set +# CT_LIBC_EGLIBC_V_2_10 is not set +# CT_LIBC_EGLIBC_V_2_9 is not set +# CT_LIBC_EGLIBC_V_2_8 is not set +# CT_LIBC_EGLIBC_V_2_7 is not set +# CT_LIBC_EGLIBC_V_2_6 is not set +# CT_LIBC_EGLIBC_V_2_5 is not set +# CT_LIBC_EGLIBC_V_TRUNK is not set +CT_LIBC_EGLIBC_2_14_or_later=y +CT_LIBC_EGLIBC_2_13_or_later=y +CT_LIBC_EGLIBC_2_12_or_later=y +CT_LIBC_EGLIBC_2_11_or_later=y +CT_LIBC_EGLIBC_2_10_or_later=y +CT_LIBC_EGLIBC_2_9_or_later=y +CT_LIBC_EGLIBC_HAS_PKGVERSION_BUGURL=y +CT_EGLIBC_REVISION="HEAD" +# CT_EGLIBC_HTTP is not set +# CT_EGLIBC_CHECKOUT is not set +# CT_EGLIBC_OPT_SIZE is not set +# CT_EGLIBC_CUSTOM_CONFIG is not set +CT_LIBC_glibc_AVAILABLE=y +CT_LIBC_mingw_AVAILABLE=y +CT_LIBC_newlib_AVAILABLE=y +CT_LIBC_none_AVAILABLE=y +CT_LIBC_prebuilt_AVAILABLE=y +CT_LIBC_uClibc_AVAILABLE=y +CT_LIBC_SUPPORT_THREADS_ANY=y +CT_LIBC_SUPPORT_NPTL=y +CT_LIBC_SUPPORT_LINUXTHREADS=y +CT_THREADS="nptl" + +# +# Common C library options +# +CT_THREADS_NPTL=y +# CT_THREADS_LINUXTHREADS is not set +CT_LIBC_XLDD=y + +# +# eglibc other options +# +CT_LIBC_glibc_familly=y +CT_LIBC_GLIBC_EXTRA_CONFIG_ARRAY="--enable-profile" +CT_LIBC_GLIBC_CONFIGPARMS="rtlddir=/lib\\nlibdir=/usr/lib/aarch64-linux-gnu\\nslibdir=/lib/aarch64-linux-gnu" +CT_LIBC_GLIBC_EXTRA_CFLAGS="-O2" +CT_LIBC_EXTRA_CC_ARGS="" +# CT_LIBC_ENABLE_FORTIFIED_BUILD is not set +# CT_LIBC_DISABLE_VERSIONING is not set +CT_LIBC_OLDEST_ABI="" +CT_LIBC_GLIBC_FORCE_UNWIND=y +CT_LIBC_GLIBC_USE_PORTS=y +CT_LIBC_ADDONS_LIST="" + +# +# WARNING !!! +# + +# +# For glibc >= 2.8, it can happen that the tarballs +# + +# +# for the addons are not available for download. +# + +# +# If that happens, bad luck... Try a previous version +# + +# +# or try again later... :-( +# +# CT_LIBC_LOCALES is not set +CT_LIBC_GLIBC_KERNEL_VERSION_NONE=y +# CT_LIBC_GLIBC_KERNEL_VERSION_AS_HEADERS is not set +# CT_LIBC_GLIBC_KERNEL_VERSION_CHOSEN is not set +CT_LIBC_GLIBC_MIN_KERNEL="" + +# +# Debug facilities +# +# CT_DEBUG_dmalloc is not set +# CT_DEBUG_duma is not set +CT_DEBUG_gdb=y +CT_GDB_CROSS=y +# CT_GDB_CROSS_STATIC is not set +# CT_GDB_CROSS_PYTHON is not set +CT_GDB_CROSS_EXTRA_CONFIG_ARRAY="" +# CT_GDB_NATIVE is not set +CT_GDB_GDBSERVER=y +CT_GDB_GDBSERVER_STATIC=y + +# +# gdb version +# +CT_DEBUG_GDB_SHOW_LINARO=y +CT_GDB_V_linaro_7_6_1_2013_10=y +# CT_GDB_V_7_6_PRE is not set +# CT_GDB_V_linaro_7_5_2012_12 is not set +# CT_GDB_V_7_3a is not set +# CT_GDB_V_linaro_7_2_2011_05_0 is not set +# CT_GDB_V_7_2a is not set +# CT_GDB_V_7_1a is not set +# CT_GDB_V_7_0_1a is not set +# CT_GDB_V_7_0a is not set +# CT_GDB_V_6_8a is not set +CT_GDB_7_0_or_later=y +CT_GDB_HAS_PKGVERSION_BUGURL=y +CT_GDB_INSTALL_GDBINIT=y +CT_GDB_VERSION="linaro-7.6.1-2013.10" +# CT_DEBUG_ltrace is not set +# CT_DEBUG_strace is not set + +# +# Companion libraries +# +CT_COMPLIBS_NEEDED=y +CT_GMP_NEEDED=y +CT_MPFR_NEEDED=y +CT_ISL_NEEDED=y +CT_CLOOG_NEEDED=y +CT_MPC_NEEDED=y +CT_ZLIB_NEEDED=y +CT_COMPLIBS=y +CT_GMP=y +CT_MPFR=y +CT_ISL=y +CT_CLOOG=y +CT_MPC=y +CT_GMP_V_5_0_2=y +# CT_GMP_V_5_0_1 is not set +# CT_GMP_V_4_3_2 is not set +# CT_GMP_V_4_3_1 is not set +# CT_GMP_V_4_3_0 is not set +# CT_GMP_V_4_2_4 is not set +# CT_GMP_V_4_2_2 is not set +CT_GMP_VERSION="5.0.2" +CT_MPFR_V_3_1_0=y +# CT_MPFR_V_3_0_1 is not set +# CT_MPFR_V_3_0_0 is not set +# CT_MPFR_V_2_4_2 is not set +# CT_MPFR_V_2_4_1 is not set +# CT_MPFR_V_2_4_0 is not set +# CT_MPFR_V_2_3_2 is not set +# CT_MPFR_V_2_3_1 is not set +CT_MPFR_VERSION="3.1.0" +CT_ISL_V_0_11_1=y +CT_ISL_VERSION="0.11.1" +CT_CLOOG_V_0_18_0=y +CT_CLOOG_VERSION="0.18.0" +CT_MPC_V_0_9=y +# CT_MPC_V_0_8_2 is not set +# CT_MPC_V_0_8_1 is not set +# CT_MPC_V_0_7 is not set +# CT_MPC_V_0_6 is not set +CT_MPC_VERSION="0.9" + +# +# Companion libraries common options +# +# CT_COMPLIBS_CHECK is not set + +# +# Companion tools +# + +# +# READ HELP before you say 'Y' below !!! +# +# CT_COMP_TOOLS is not set + +# +# Extra cross build tools +# +CT_CROSS_EXTRAS=y +CT_CROSS_EXTRAS_pkg_config=y + +# +# Test suite +# +# CT_TEST_SUITE_GCC is not set diff --git a/ctworks.sh b/ctworks.sh index 430b0c4..efa107b 100755 --- a/ctworks.sh +++ b/ctworks.sh @@ -1,22 +1,16 @@ #!/bin/bash # -# crosstoolWorks, to speed up things .. -# 2014 +# crosstool-works, to speed up things .. +# 2014 # -pkname="crosstool-ng" -dmgout="./disk.dmg" -mpoint="./disk" -dmgsize="10g" +ctwpwd=`pwd` +confile="${ctwpwd}/ctworks.config" +relfile="${ctwpwd}/ctworks.releases" -ctpack="" -ctconf="" -ctvers="" -ctxarg="" -ctmake="make" dotper="50" -ctwpwd=`pwd` +mkdir -p tarballs trap doclean EXIT function doclean() { @@ -44,93 +38,251 @@ function oformat() { fi } -function dmgerr() { - if [ "${1}" == "stay" ]; then - echo | oformat "!" "${2}" +function readarg() { + cf="${confile}" + if [ "${cf}" == "" ]; then + return + fi + if [ ! -e "${cf}" ]; then return fi - echo | oformat "!" "${2}" - exit + cs="${1}" + __rc=`cat "${cf}" | grep "^${cs}=" | awk -F"${cs}=" {'print $2'}` + if [ "${__rc}" != "" ]; then + eval "${1}='${__rc}'" + fi } -function dmgeject() { - if [ ! -d "${mpoint}" ]; then - dmgerr "${1}" "Disk ${dmgout} not mounted!" +function getarg() { + cf="${confile}" + if [ "${cf}" != "" ]; then + if [ ! -e "${cf}" ]; then + echo "#" > "${cf}" + echo "# ctworks configuratin file" >> "${cf}" + echo "#" >> "${cf}" + echo >> "${cf}" + fi + cs="${1}" + __rc=`cat "${cf}" | grep "^${cs}=" | awk -F"${cs}=" {'print $2'}` + if [ "${__rc}" != "" ]; then + echo " > ${2} [${__rc}]" + eval "${1}='${__rc}'" + return + fi + fi + __rc="${4}" + echo -n " > ${2} " + if [ "${4}" != "" ]; then + echo -n "[${4}${5}]: " + else + echo -n ": " + fi + __q="" + if [ "${3}" == "pass" ]; then + stty -echo + read __q + stty echo else - hdiutil detach -force "${mpoint}" + read __q + fi + if [ "${__q}" != "" ]; then + __rc="${__q}" fi - if [ "${mpoint}" != "/Volumes" ]; then - rm -rf "${mpoint}" + if [ "${3}" == "must" -o "${3}" == "pass" ]; then + if [ "${__rc}" == "" ]; then + echo " ! Can't continue .." + echo + exit + fi fi + if [ "${cf}" != "" ]; then + cs="${1}" + __xc=`cat "${cf}" | grep "^${cs}="` + if [ "${__xc}" != "" ]; then + cat "${cf}" | grep -v "^${cs}=" > .tt + mv .tt "${cf}" + fi + echo "${cs}=${__rc}" >> "${cf}" + fi + eval "${1}='${__rc}'" } -function dmgattach() { - if [ ! -f "${dmgout}" ]; then - dmgerr "" "Disk Image ${dmgout} not found! Create it first.." - elif [ -d "${mpoint}" ]; then - dmgerr "${1}" "Disk ${dmgout} already mounted!" +function dmgeject() { + readarg mount_point + if [ "${mount_point}" == "" -o "${1}" == "" ]; then + getarg mount_point "Mount point" "must" "disk" + fi + if [ "`mount | grep "${ctwpwd}/${mount_point}"`" == "" ]; then + echo " > DMG not mounted." else - if [ "${mpoint}" != "/Volumes" ]; then - mkdir -p "${mpoint}" - fi - hdiutil attach -mountpoint "${mpoint}" "${dmgout}" + hdiutil detach -force "./${mount_point}" | oformat fi } function dmgcreate() { - hdiutil create ${dmgout} -ov -volname "${pkname}" -fs "Case-sensitive Journaled HFS+" -type UDIF -size "${dmgsize}" - dmgattach + readarg dmg + if [ "${dmg}" == "" -o "${1}" == "" ]; then + getarg dmg "DMG file to create" "must" "disk.dmg" + fi + if [ -e "${dmg}" ]; then + echo " ! DMG file (${dmg}) already exist." + return + fi + readarg dmgsize + if [ "${dmgsize}" == "" -o "${1}" == "" ]; then + getarg dmgsize "Please specify DMG size" "must" "10g" + fi + readarg mount_point + if [ "${mount_point}" == "" -o "${1}" == "" ]; then + getarg mount_point "Mount point" "must" "disk" + fi + if [ "`mount | grep "${ctwpwd}/${mount_point}"`" != "" ]; then + echo " > Mount point (${mount_point}) not available (already mounted)." + return + fi + hdiutil create ./${dmg} -ov -volname "crosstool-ng" -fs "Case-sensitive Journaled HFS+" -type UDIF -size "${dmgsize}" | oformat + sync } -function gettool() { - ls | grep "^crosstool" | awk -F ".tar" {'print $1'} | oformat ">" "Available packages;~" "-" " - " - ctpack=`cat .p | tail -1` - echo - echo -n " Please select package you want to use [${ctpack}] : " - read cp - if [ "${cp}" != "" ]; then - ctpack="${cp}" +function dmgattach() { + getarg dmg "DMG file to use" "must" "disk.dmg" + getarg mount_point "Mount point" "must" "disk" + if [ "`mount | grep "${ctwpwd}/${mount_point}"`" != "" ]; then + echo " > Disk ${dmg} already mounted." + return fi - ls configs | grep -v "\.config$" | oformat ">" "Available configurations;~" "-" " - " - ctconf=`cat .p | head -1` + if [ ! -f "${dmg}" ]; then + dmgcreate "noask" + sleep 1 + sync + fi + if [ "`mount | grep "${ctwpwd}/${mount_point}"`" != "" ]; then + echo " > Disk ${dmg} already mounted." + return + fi + mkdir -p "${mount_point}" + hdiutil attach -mountpoint "./${mount_point}" "./${dmg}" | oformat echo - echo -n " Please select configuration you want to build [${ctconf}] : " - read cc - if [ "${cc}" != "" ]; then - ctconf="${cc}" +} + +function gethash() { + cat "${relfile}" | grep "^${1};" | awk -F";" {'print $2'} +} +function geturl() { + cat "${relfile}" | grep "^${1};" | awk -F";" {'print $3'} +} + +function getpkg() { + geturl "${1}" | awk -F"/" {'print $NF'} +} + +function getrel() { + pkg=`getpkg "${1}"` + if [ "${pkg}" == "" ]; then + echo " ! Specified release(${1}) not found." + exit + fi + if [ -e "${pkg}" ]; then + if [ "`gethash "${1}"`" == "`md5 ${pkg} | awk -F" = " {'print $2'}`" ]; then + if [ "${2}" == "silent" ]; then + return 1 + fi + echo " > Package ${pkg} for release(${1}) already exist." + echo + exit + fi fi + wget --progress=dot "`geturl "${1}"`" -O "${pkg}" 2>&1 | oformat ">" "Downloading ${pkg} +" + return 0 +} + +function gettool() { + cat "${relfile}" | awk -F ";" {'print $1'} | oformat ">" "Supported Linaro releases;~" "-" " - " + release=`cat .p | tail -1` + echo + getarg release "Please select release you want to use" "must" "${release}" + while true; do + getrel "${release}" "silent" + if [ "${?}" == "1" ]; then + break + fi + done + ls configs/${release}-* | grep -v "\.config$" | awk -F"/" {'print $NF'} | oformat ">" "Available configurations;~" "-" " - " + build_config=`cat .p | tail -1` + echo + getarg build_config "Please select configuration you want to build" "must" "${build_config}" } function ctpatch() { - pbase="../../patches/${1}" - if [ -e "${pbase}.patch" ]; then - patch -p1 < "${pbase}.patch" 2>&1 | oformat ">" "Applying ${1}.patch" - fi - if [ -e "${pbase}-${2}.patch" ]; then - patch -p1 < "${pbase}-${2}.patch" 2>&1 | oformat ">" "Applying ${pbase}-${2}.patch" + echo + getarg patch "Shall I apply ctwork patches?" "must" "Y" "/n" + readarg build_config + if [ "${patch}" == "y" -o "${q}" == "Y" -o "${q}" == "" ]; then + pbase="${ctwpwd}/patches/${1}" + if [ -e "${pbase}.patch" ]; then + patch -p1 < "${pbase}.patch" 2>&1 | oformat "-" "Applying ${1}.patch" + fi + if [ -e "${pbase}-${build_config}.patch" ]; then + patch -p1 < "${pbase}-${build_config}.patch" 2>&1 | oformat ">" "Applying ${pbase}-${build_config}.patch" + fi fi - cbase="../../configs/${2}" + echo +} + +function ctcpcf() { + readarg build_config + cbase="${ctwpwd}/configs/${build_config}" if [ -f "${cbase}" ]; then echo | oformat ">" "Copying configuration ${cbase}" "." - cp "${cbase}" .config + np=`echo "${ctwpwd}" | sed 's/\\//\\\\\\//g'` + echo "cat '${cbase}' | sed 's/__CTWORKS_DIR__/${np}/g' > .config" > .ctcpcf + source .ctcpcf + rm -f .ctcpcf fi } -function ctbegin() { - cd "${mpoint}" - rm -rf "${ctpack}" - tar -jxvf ../${ctpack}.tar.* 2>&1 | oformat ">" "Extracting ${ctpack} " "." - cd crosstool* - ctpatch "${ctpack}" "${ctconf}" - ctxarg="--local" - if [ "`echo "${ctpack}" | grep -- "-1\.2[0-9]+\."`" != "" ]; then - ctxarg="--enable-local" - ctvers="new" - fi +function ctprepare() { + gettool + readarg release + dmgattach + readarg mount_point + cd "${mount_point}" + pkg=`getpkg "${release}"` + pkd=`echo "${pkg}" | awk -F"\.tar" {'print $1'}` + rm -rf "${pkd}" + tar -jxvf ../${pkg} 2>&1 | oformat ">" "Extracting ${pkg} " "." + cd "${pkd}" + ctpatch "${pkd}" + ctcpcf } -function ctboot() { - gp="/opt/local/bin" +function ctconfig() { + gettool + readarg release + dmgattach + readarg mount_point + cd "${mount_point}" + pkg=`getpkg "${release}"` + pkd=`echo "${pkg}" | awk -F"\.tar" {'print $1'}` + if [ ! -d "${pkd}" ]; then + tar -jxvf ../${pkg} 2>&1 | oformat ">" "Extracting ${pkg} " "." + cd "${pkd}" + ctpatch "${pkd}" + ctcpcf + cd .. + fi + cd "${pkd}" + config_args="--enable-local" + if [ "${release}" == "14.09" ]; then + config_args="--local" + fi + getarg config_args "Additional args for configure" "" "${config_args}" + macports_home="/opt/local" + getarg macports_home "MacPorts installation directory" "must" "${macports_home}" + + gp="${macports_home}/bin" + cat <<_EOF_ >> envsetup.inc export sed="${gp}/gsed" export objcopy="${gp}/gobjcopy" export objdump="${gp}/gobjdump" @@ -138,13 +290,26 @@ function ctboot() { export readelf="${gp}/greadelf" export libtool="${gp}/glibtool" export libtoolize="${gp}/glibtoolize" +_EOF_ + echo + source envsetup.inc ./configure \ - ${ctxarg} \ + ${config_args} \ | oformat ">" "Issuing configure .." if [ "`cat .p | grep "Bailing out"`" != "" ]; then echo exit fi + echo + td=`pwd | awk -F"${ctwpwd}" {'print $2'}` + echo " + cd .${td} + make + ./ct-ng menuconfig + ulimit -n 2048 + ./ct-ng build + " | oformat ">" "Please run below commands to build toolchain" + cd ../.. } function ctballs() { @@ -161,73 +326,71 @@ function ctballs() { echo " done" } -function ctend() { - td=`pwd | awk -F"${ctwpwd}" {'print $2'}` - echo " - cd .${td} - ${ctmake} - ./ct-ng menuconfig - ulimit -n 2048 - ./ct-ng build - " | oformat ">" "Please run below commands to build tools" - cd ../.. -} - -function ctconfig() { - dmgattach "stay" - gettool - ctbegin - ctboot - ctballs - ctend +function ctgetrel() { + cat "${relfile}" | awk -F ";" {'print $1'} | oformat ">" "Supported Linaro releases;~" "-" " - " + rel=`cat .p | tail -1` + echo + echo -n " Please select release you want to download [${rel}] : " + read cr + if [ "${cr}" != "" ]; then + rel="${cr}" + fi + getrel "${rel}" } function cthelp() { echo " - 0. Change paths within *-*-uclibc files to point this \"configs\" directory like below: - CT_LIBC_UCLIBC_CONFIG_FILE=`pwd`/configs/uClibc-*.config - - 1. Create a case sensitive file system: - > ${0} dmgcreate + 1. Download crosstool-ng packages from Linaro releases storage server (http://releases.linaro.org) + > ${0} get - 2. Run ctworks with \"config\" switch - > ${0} config + 2. Create case sensitive file system in a disk image: + > ${0} create + or you may use existing one; + > ${0} attach - 3. Select appropriate package + 3. Run with \"prepare\" switch to extract crosstool-ng package and apply patches etc. + > ${0} prepare - 4. Select desired configuration + 4. Run with \"config\" switch to configure crosstool-ng and follow instructions displayed to build toolchain + > ${0} configure - 5. Follow the instructins displayed and wait for compilation. - - 6. Copy tarballs from .build directory for later use; - > cp `pwd`/disk/crosstool*/.build/tarballs/* `pwd`/tarballs/ - - 7. Find toolchain under \"disk\" folder and move it to your workspace - - 8. Run ctworks with \"eject\" switch to unmount dmg file if you want to use it later. + 5. Run with \"eject\" switch to unmount disk image. > ${0} eject - 9. Run ctworks with \"clean\" switch to delete dmg file completely. - > ${0} clean + Notes: + - 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. + + - You may need to restart from a step when something goes wrong; + ./ct-ng list-steps + RESTART=libc_start_files ./ct-ng build " } +if [ ! -e "${relfile}" ]; then + cat <<_EOF_ > "${relfile}" +14.08;204e3e477db00c2c9c5d19e03548eb8a;http://releases.linaro.org/14.08/components/toolchain/binaries/crosstool-ng-linaro-1.13.1-4.9-2014.08.tar.bz2 +14.09;8a01fde555f1127885b16b55793cfb65;http://releases.linaro.org/14.09/components/toolchain/binaries/crosstool-ng-linaro-1.13.1-4.9-2014.09.tar.bz2 +_EOF_ +fi + echo -if [ "${1}" == "eject" ]; then - dmgeject +if [ "${1}" == "create" ]; then + dmgcreate elif [ "${1}" == "attach" ]; then dmgattach -elif [ "${1}" == "create" ]; then - dmgcreate -elif [ "${1}" == "clean" ]; then - dmgeject "stay" - rm -f "${dmgout}" -elif [ "${1}" == "config" ]; then +elif [ "${1}" == "eject" ]; then + dmgeject +elif [ "${1}" == "get" ]; then + ctgetrel +elif [ "${1}" == "prepare" ]; then + ctprepare +elif [ "${1}" == "configure" ]; then ctconfig elif [ "${1}" == "help" ]; then cthelp else - dmgerr "" "Nothing to do, try create|attach|detach|eject|clean|config|help" + echo " ! Nothing to do, try get|prepare|configure|create|attach|eject|help" fi echo diff --git a/patches/crosstool-ng-linaro-1.13.1-4.9-2014.08.patch b/patches/crosstool-ng-linaro-1.13.1-4.9-2014.08.patch index e920263..7ac99c9 100644 --- a/patches/crosstool-ng-linaro-1.13.1-4.9-2014.08.patch +++ b/patches/crosstool-ng-linaro-1.13.1-4.9-2014.08.patch @@ -276,6 +276,27 @@ diff -Nuar o/patches/uClibc/0.9.32/180-osx-strlcpy-macro-fix.patch m/patches/uCl + + /* types of input lines: */ + typedef enum { +diff -Nuar o/patches/gmp/5.0.2/100-fix-ptrdiff_t.patch m/patches/gmp/5.0.2/100-fix-ptrdiff_t.patch +--- o/patches/gmp/5.0.2/100-fix-ptrdiff_t.patch 1970-01-01 02:00:00.000000000 +0200 ++++ m/patches/gmp/5.0.2/100-fix-ptrdiff_t.patch 2016-04-02 19:46:38.000000000 +0300 +@@ -0,0 +1,17 @@ ++diff -Nuar o/gmp-h.in m/gmp-h.in ++--- o/gmp-h.in 2011-05-08 12:49:29.000000000 +0300 +++++ m/gmp-h.in 2016-04-02 19:45:03.000000000 +0300 ++@@ -45,13 +45,11 @@ ++ #ifndef __GNU_MP__ ++ #define __GNU_MP__ 5 ++ ++-#define __need_size_t /* tell gcc stddef.h we only want size_t */ ++ #if defined (__cplusplus) ++ #include /* for size_t */ ++ #else ++ #include /* for size_t */ ++ #endif ++-#undef __need_size_t ++ ++ /* Instantiated by configure. */ ++ #if ! defined (__GMP_WITHIN_CONFIGURE) diff -Nuar o/scripts/build/cc/gcc.sh m/scripts/build/cc/gcc.sh --- o/scripts/build/cc/gcc.sh 2014-08-22 03:36:31.000000000 +0300 +++ m/scripts/build/cc/gcc.sh 2014-09-28 19:00:02.000000000 +0300 diff --git a/patches/crosstool-ng-linaro-1.13.1-4.9-2014.09.patch b/patches/crosstool-ng-linaro-1.13.1-4.9-2014.09.patch new file mode 100644 index 0000000..2fc53c0 --- /dev/null +++ b/patches/crosstool-ng-linaro-1.13.1-4.9-2014.09.patch @@ -0,0 +1,150 @@ +diff -Nuar o/configure t/configure +--- o/configure 2016-05-26 19:24:34.000000000 +0300 ++++ t/configure 2016-05-26 19:23:43.000000000 +0300 +@@ -236,7 +236,11 @@ + for item in ${lib}; do + for ext in ${lib_exts}; do + printf "Checking for '${item}.${ext}'... " +- where="$( gcc -print-file-name="${item}.${ext}" )" ++ # where="$( gcc -print-file-name="${item}.${ext}" )" ++ where="${item}.${ext}" ++ if [ -e "/usr/lib/${item}.${ext}" ]; then ++ where="/usr/lib/${item}.${ext}" ++ fi + if [ "${where}" != "${item}.${ext}" ]; then + where="$( readlink "${where}" )" + status=yes +diff -Nuar o/kconfig/kconfig.mk t/kconfig/kconfig.mk +--- o/kconfig/kconfig.mk 2016-06-19 16:01:20.000000000 +0300 ++++ t/kconfig/kconfig.mk 2016-05-26 19:31:52.000000000 +0300 +@@ -67,7 +67,7 @@ + + # Build flags + CFLAGS = -DCONFIG_=\"CT_\" -DPACKAGE="\"crosstool-NG $(CT_VERSION)\"" +-LDFLAGS = ++LDFLAGS = -lncurses + + # Compiler flags to use gettext + INTL_CFLAGS = $(shell $(SHELL) $(check_gettext) $(HOST_CC) $(EXTRA_CFLAGS)) +diff -Nuar o/patches/eglibc/linaro-2.19-2014.08/001-libintl.patch t/patches/eglibc/linaro-2.19-2014.08/001-libintl.patch +--- o/patches/eglibc/linaro-2.19-2014.08/001-libintl.patch 1970-01-01 02:00:00.000000000 +0200 ++++ t/patches/eglibc/linaro-2.19-2014.08/001-libintl.patch 2016-06-19 17:04:46.000000000 +0300 +@@ -0,0 +1,11 @@ ++diff -Nuar o/Makefile.in m/Makefile.in ++--- o/Makefile.in 2014-08-01 17:39:34.000000000 +0300 +++++ m/Makefile.in 2014-09-26 00:06:30.000000000 +0300 ++@@ -6,6 +6,7 @@ ++ .PHONY: all install bench ++ ++ all .DEFAULT: +++ C_INCLUDE_PATH="/opt/local/include" BUILD_LDFLAGS="-L/opt/local/lib -lintl"; export C_INCLUDE_PATH BUILD_LDFLAGS; \ ++ $(MAKE) -r PARALLELMFLAGS="$(PARALLELMFLAGS)" -C $(srcdir) objdir=`pwd` $@ ++ ++ install: +diff -Nuar o/patches/gcc/linaro-4.9-2014.09/0001-nested-bracket.patch t/patches/gcc/linaro-4.9-2014.09/0001-nested-bracket.patch +--- o/patches/gcc/linaro-4.9-2014.09/0001-nested-bracket.patch 1970-01-01 02:00:00.000000000 +0200 ++++ t/patches/gcc/linaro-4.9-2014.09/0001-nested-bracket.patch 2016-06-19 17:04:00.000000000 +0300 +@@ -0,0 +1,13 @@ ++diff -Naur o/Makefile.in m/Makefile.in ++--- o/Makefile.in 2014-09-24 00:49:00.000000000 +0300 +++++ m/Makefile.in 2014-09-24 02:49:29.000000000 +0300 ++@@ -9986,6 +9986,9 @@ ++ test ! -f $(HOST_SUBDIR)/gcc/Makefile || exit 0; \ ++ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gcc ; \ ++ $(HOST_EXPORTS) \ +++ CFLAGS="$(CFLAGS) -fbracket-depth=1024"; export CFLAGS; \ +++ CXXFLAGS="$(CXXFLAGS) -fbracket-depth=1024"; export CXXFLAGS; \ +++ CPPFLAGS="$(CPPFLAGS) -fbracket-depth=1024"; export CPPFLAGS; \ ++ echo Configuring in $(HOST_SUBDIR)/gcc; \ ++ cd "$(HOST_SUBDIR)/gcc" || exit 1; \ ++ case $(srcdir) in \ +diff -Nuar o/patches/gmp/5.0.2/100-fix-ptrdiff_t.patch t/patches/gmp/5.0.2/100-fix-ptrdiff_t.patch +--- o/patches/gmp/5.0.2/100-fix-ptrdiff_t.patch 1970-01-01 02:00:00.000000000 +0200 ++++ t/patches/gmp/5.0.2/100-fix-ptrdiff_t.patch 2016-06-19 16:19:31.000000000 +0300 +@@ -0,0 +1,17 @@ ++diff -Nuar o/gmp-h.in m/gmp-h.in ++--- o/gmp-h.in 2011-05-08 12:49:29.000000000 +0300 +++++ m/gmp-h.in 2016-04-02 19:45:03.000000000 +0300 ++@@ -45,13 +45,11 @@ ++ #ifndef __GNU_MP__ ++ #define __GNU_MP__ 5 ++ ++-#define __need_size_t /* tell gcc stddef.h we only want size_t */ ++ #if defined (__cplusplus) ++ #include /* for size_t */ ++ #else ++ #include /* for size_t */ ++ #endif ++-#undef __need_size_t ++ ++ /* Instantiated by configure. */ ++ #if ! defined (__GMP_WITHIN_CONFIGURE) +diff -Nuar o/patches/ncurses/5.9/001-pointer.patch t/patches/ncurses/5.9/001-pointer.patch +--- o/patches/ncurses/5.9/001-pointer.patch 1970-01-01 02:00:00.000000000 +0200 ++++ t/patches/ncurses/5.9/001-pointer.patch 2016-06-19 17:25:54.000000000 +0300 +@@ -0,0 +1,42 @@ ++diff -Nuar o/c++/cursesf.h m/c++/cursesf.h ++--- o/c++/cursesf.h 2005-08-13 21:08:24.000000000 +0300 +++++ m/c++/cursesf.h 2014-09-23 00:01:02.000000000 +0300 ++@@ -681,7 +681,7 @@ ++ const T* p_UserData = STATIC_CAST(T*)(0), ++ bool with_frame=FALSE, ++ bool autoDelete_Fields=FALSE) ++- : NCursesForm (Fields, with_frame, autoDelete_Fields) { +++ : NCursesForm (&Fields, with_frame, autoDelete_Fields) { ++ if (form) ++ set_user (const_cast(p_UserData)); ++ }; ++@@ -694,7 +694,7 @@ ++ const T* p_UserData = STATIC_CAST(T*)(0), ++ bool with_frame=FALSE, ++ bool autoDelete_Fields=FALSE) ++- : NCursesForm (Fields, nlines, ncols, begin_y, begin_x, +++ : NCursesForm (&Fields, nlines, ncols, begin_y, begin_x, ++ with_frame, autoDelete_Fields) { ++ if (form) ++ set_user (const_cast(p_UserData)); ++diff -Nuar o/c++/cursesm.h m/c++/cursesm.h ++--- o/c++/cursesm.h 2005-08-13 21:10:36.000000000 +0300 +++++ m/c++/cursesm.h 2014-09-23 00:03:01.000000000 +0300 ++@@ -639,7 +639,7 @@ ++ const T* p_UserData = STATIC_CAST(T*)(0), ++ bool with_frame=FALSE, ++ bool autoDelete_Items=FALSE) ++- : NCursesMenu (Items, with_frame, autoDelete_Items) { +++ : NCursesMenu (&Items, with_frame, autoDelete_Items) { ++ if (menu) ++ set_user (const_cast(p_UserData)); ++ }; ++@@ -651,7 +651,7 @@ ++ int begin_x = 0, ++ const T* p_UserData = STATIC_CAST(T*)(0), ++ bool with_frame=FALSE) ++- : NCursesMenu (Items, nlines, ncols, begin_y, begin_x, with_frame) { +++ : NCursesMenu (&Items, nlines, ncols, begin_y, begin_x, with_frame) { ++ if (menu) ++ set_user (const_cast(p_UserData)); ++ }; +diff -Nuar o/scripts/build/cross_extras/500-pkg_config.sh t/scripts/build/cross_extras/500-pkg_config.sh +--- o/scripts/build/cross_extras/500-pkg_config.sh 2016-06-19 17:39:28.000000000 +0300 ++++ t/scripts/build/cross_extras/500-pkg_config.sh 2016-06-19 17:40:25.000000000 +0300 +@@ -20,6 +20,7 @@ + CT_Pushd "${CT_BUILD_DIR}/build-pkg-config" + + CT_DoExecLog CFG \ ++ CFLAGS="-std=gnu89" \ + "${CT_SRC_DIR}/pkg-config-${CT_PKG_CONFIG_VERSION}/configure" \ + --prefix="${CT_PREFIX_DIR}" \ + --build=${CT_BUILD} \ +diff -Nuar o/scripts/functions t/scripts/functions +--- o/scripts/functions 2016-06-19 16:43:12.000000000 +0300 ++++ t/scripts/functions 2016-06-19 16:44:12.000000000 +0300 +@@ -1196,7 +1196,7 @@ + CT_DoLog STATE " Restoring log file" + exec >/dev/null + case "${CT_DEBUG_CT_SAVE_STEPS_GZIP}" in +- y) zcat "${state_dir}/log.gz" >"${tmp_log_file}";; ++ y) gzcat "${state_dir}/log.gz" >"${tmp_log_file}";; + *) cat "${state_dir}/log" >"${tmp_log_file}";; + esac + cat "${state_dir}/tail.log" >>"${tmp_log_file}"