From 3a2cd748bc0cc9c688df2b34eda743d8df9a351a Mon Sep 17 00:00:00 2001 From: Tim 'mithro' Ansell Date: Mon, 10 Sep 2018 21:19:24 -0700 Subject: [PATCH 01/36] Remove the __conda_XXXX__ output files. --- lm32/binutils/build.sh | 3 --- lm32/gcc-newlib/build.sh | 6 +----- lm32/gcc-nostdc/build.sh | 6 +----- lm32/gdb/build.sh | 5 +---- or1k/binutils/build.sh | 5 +---- or1k/gcc-newlib/build.sh | 6 +----- or1k/gcc-nostdc/build.sh | 6 +----- or1k/gdb/build.sh | 5 +---- 8 files changed, 7 insertions(+), 35 deletions(-) diff --git a/lm32/binutils/build.sh b/lm32/binutils/build.sh index 79e9576e..abc1424a 100644 --- a/lm32/binutils/build.sh +++ b/lm32/binutils/build.sh @@ -16,6 +16,3 @@ cd build make -j$CPU_COUNT make install-strip -touch .buildstamp -TZ=UTC date +%Y%m%d_%H%M%S -r .buildstamp > ../__conda_buildstr__.txt -TZ=UTC date +%Y%m%d%H%M%S -r .buildstamp > ../__conda_buildnum__.txt diff --git a/lm32/gcc-newlib/build.sh b/lm32/gcc-newlib/build.sh index 89fd63db..ce161224 100644 --- a/lm32/gcc-newlib/build.sh +++ b/lm32/gcc-newlib/build.sh @@ -92,8 +92,4 @@ cd .. VERSION_DIR="$(echo $SRC_DIR | sed -e's-/work/.*-/work/-')" $PREFIX/bin/$GCC --version -$PREFIX/bin/$GCC --version 2>&1 | head -1 | sed -e"s/$GCC (GCC) //" > $VERSION_DIR/__conda_version__.txt -touch .buildstamp -TZ=UTC date +%Y%m%d_%H%M%S -r .buildstamp > $VERSION_DIR/__conda_buildstr__.txt -TZ=UTC date +%Y%m%d%H%M%S -r .buildstamp > $VERSION_DIR/__conda_buildnum__.txt -cat $VERSION_DIR/__conda_*__.txt +echo $($PREFIX/bin/$GCC --version 2>&1 | head -1 | sed -e"s/$GCC (GCC) //") diff --git a/lm32/gcc-nostdc/build.sh b/lm32/gcc-nostdc/build.sh index abcf1ef9..828a1adb 100644 --- a/lm32/gcc-nostdc/build.sh +++ b/lm32/gcc-nostdc/build.sh @@ -68,8 +68,4 @@ cd .. VERSION_DIR="$(echo $SRC_DIR | sed -e's-/work/.*-/work/-')" $PREFIX/bin/$TARGET-gcc --version -$PREFIX/bin/$TARGET-gcc --version 2>&1 | head -1 | sed -e"s/$TARGET-gcc (GCC) //" > $VERSION_DIR/__conda_version__.txt -touch .buildstamp -TZ=UTC date +%Y%m%d_%H%M%S -r .buildstamp > $VERSION_DIR/__conda_buildstr__.txt -TZ=UTC date +%Y%m%d%H%M%S -r .buildstamp > $VERSION_DIR/__conda_buildnum__.txt -cat $VERSION_DIR/__conda_*__.txt +echo $($PREFIX/bin/$TARGET-gcc --version 2>&1 | head -1 | sed -e"s/$TARGET-gcc (GCC) //") diff --git a/lm32/gdb/build.sh b/lm32/gdb/build.sh index 579b49ae..66a73bc3 100644 --- a/lm32/gdb/build.sh +++ b/lm32/gdb/build.sh @@ -42,7 +42,4 @@ make install ) $PREFIX/bin/lm32-elf-gdb --version -$PREFIX/bin/lm32-elf-gdb --version 2>&1 | head -1 | sed -e's/.* //' > ./__conda_version__.txt -touch .buildstamp -TZ=UTC date +%Y%m%d_%H%M%S -r .buildstamp > ../__conda_buildstr__.txt -TZ=UTC date +%Y%m%d%H%M%S -r .buildstamp > ../__conda_buildnum__.txt +echo $($PREFIX/bin/lm32-elf-gdb --version 2>&1 | head -1 | sed -e's/.* //') diff --git a/or1k/binutils/build.sh b/or1k/binutils/build.sh index 84596e21..cd1cfc70 100644 --- a/or1k/binutils/build.sh +++ b/or1k/binutils/build.sh @@ -18,7 +18,4 @@ make -j$CPU_COUNT make install-strip $PREFIX/bin/or1k-elf-ld --version -$PREFIX/bin/or1k-elf-ld --version 2>&1 | head -1 | sed -e's/GNU ld (GNU Binutils) //' > ./__conda_version__.txt -touch .buildstamp -TZ=UTC date +%Y%m%d_%H%M%S -r .buildstamp > ../__conda_buildstr__.txt -TZ=UTC date +%Y%m%d%H%M%S -r .buildstamp > ../__conda_buildnum__.txt +echo $($PREFIX/bin/or1k-elf-ld --version 2>&1 | head -1 | sed -e's/GNU ld (GNU Binutils) //') diff --git a/or1k/gcc-newlib/build.sh b/or1k/gcc-newlib/build.sh index a0c485c1..3b870338 100644 --- a/or1k/gcc-newlib/build.sh +++ b/or1k/gcc-newlib/build.sh @@ -121,8 +121,4 @@ cd .. VERSION_DIR="$(echo $SRC_DIR | sed -e's-/work/.*-/work/-')" $PREFIX/bin/$GCC --version -$PREFIX/bin/$GCC --version 2>&1 | head -1 | sed -e's/.* //' -e"s/\$/_$GIT_REV/" > $VERSION_DIR/__conda_version__.txt -touch .buildstamp -TZ=UTC date +%Y%m%d_%H%M%S -r .buildstamp > $VERSION_DIR/__conda_buildstr__.txt -TZ=UTC date +%Y%m%d%H%M%S -r .buildstamp > $VERSION_DIR/__conda_buildnum__.txt -cat $VERSION_DIR/__conda_*__.txt +echo $($PREFIX/bin/$GCC --version 2>&1 | head -1 | sed -e's/.* //' -e"s/\$/_$GIT_REV/") diff --git a/or1k/gcc-nostdc/build.sh b/or1k/gcc-nostdc/build.sh index d5b4bfe1..517bc971 100644 --- a/or1k/gcc-nostdc/build.sh +++ b/or1k/gcc-nostdc/build.sh @@ -93,8 +93,4 @@ cd .. VERSION_DIR="$(echo $SRC_DIR | sed -e's-/work/.*-/work/-')" $PREFIX/bin/$TARGET-gcc --version -$PREFIX/bin/$TARGET-gcc --version 2>&1 | head -1 | sed -e"s/$TARGET-gcc (GCC) //" -e"s/\$/_$GIT_REV/" > $VERSION_DIR/__conda_version__.txt -touch .buildstamp -TZ=UTC date +%Y%m%d_%H%M%S -r .buildstamp > $VERSION_DIR/__conda_buildstr__.txt -TZ=UTC date +%Y%m%d%H%M%S -r .buildstamp > $VERSION_DIR/__conda_buildnum__.txt -cat $VERSION_DIR/__conda_*__.txt +echo $($PREFIX/bin/$TARGET-gcc --version 2>&1 | head -1 | sed -e"s/$TARGET-gcc (GCC) //" -e"s/\$/_$GIT_REV/") diff --git a/or1k/gdb/build.sh b/or1k/gdb/build.sh index 39503393..8bd27d02 100644 --- a/or1k/gdb/build.sh +++ b/or1k/gdb/build.sh @@ -56,7 +56,4 @@ make install ) $PREFIX/bin/or1k-elf-gdb --version -$PREFIX/bin/or1k-elf-gdb --version 2>&1 | head -1 | sed -e's/.* //' -e"s/\$/_$GIT_REV/" > ./__conda_version__.txt -touch .buildstamp -TZ=UTC date +%Y%m%d_%H%M%S -r .buildstamp > ../__conda_buildstr__.txt -TZ=UTC date +%Y%m%d%H%M%S -r .buildstamp > ../__conda_buildnum__.txt +echo $($PREFIX/bin/or1k-elf-gdb --version 2>&1 | head -1 | sed -e's/.* //' -e"s/\$/_$GIT_REV/") From aff969b8b4c24feed4f8112527686f33b81825e5 Mon Sep 17 00:00:00 2001 From: Tim 'mithro' Ansell Date: Tue, 18 Sep 2018 16:24:16 -0700 Subject: [PATCH 02/36] binutils: Using on package with environment variables. --- {lm32/binutils => binutils}/build.sh | 8 ++++++- {riscv32/binutils => binutils}/meta.yaml | 16 ++++++++----- conda-env.sh | 5 ++++ conda-meta-extra.sh | 5 ++++ lm32/binutils/meta.yaml | 30 ------------------------ or1k/binutils/build.sh | 21 ----------------- or1k/binutils/meta.yaml | 30 ------------------------ riscv32/binutils/build.sh | 21 ----------------- sh2/binutils/build.sh | 21 ----------------- sh2/binutils/meta.yaml | 30 ------------------------ 10 files changed, 27 insertions(+), 160 deletions(-) rename {lm32/binutils => binutils}/build.sh (60%) rename {riscv32/binutils => binutils}/meta.yaml (59%) delete mode 100644 lm32/binutils/meta.yaml delete mode 100644 or1k/binutils/build.sh delete mode 100644 or1k/binutils/meta.yaml delete mode 100644 riscv32/binutils/build.sh delete mode 100644 sh2/binutils/build.sh delete mode 100644 sh2/binutils/meta.yaml diff --git a/lm32/binutils/build.sh b/binutils/build.sh similarity index 60% rename from lm32/binutils/build.sh rename to binutils/build.sh index abc1424a..c1645207 100644 --- a/lm32/binutils/build.sh +++ b/binutils/build.sh @@ -3,6 +3,12 @@ set -e set -x +if [ -z "${TOOLCHAIN_ARCH}" ]; then + export + echo "Missing \${TOOLCHAIN_ARCH} env value" + exit 1 +fi + if [ x"$TRAVIS" = xtrue ]; then CPU_COUNT=2 fi @@ -10,7 +16,7 @@ fi mkdir build cd build ../configure \ - --target=lm32-elf \ + --target=${TOOLCHAIN_ARCH}-elf \ --prefix=$PREFIX \ --enable-deterministic-archives \ diff --git a/riscv32/binutils/meta.yaml b/binutils/meta.yaml similarity index 59% rename from riscv32/binutils/meta.yaml rename to binutils/meta.yaml index 8ba9408d..33c68ee5 100644 --- a/riscv32/binutils/meta.yaml +++ b/binutils/meta.yaml @@ -1,9 +1,9 @@ package: - name: binutils-riscv32-elf + name: binutils-{{ environ.get('TOOLCHAIN_ARCH') }}-elf version: 2.31.1 source: - fn: binutils-2.31.tar.bz2 + fn: binutils-2.31.1.tar.bz2 url: https://ftp.gnu.org/gnu/binutils/binutils-2.31.1.tar.bz2 sha256: ffcc382695bf947da6135e7436b8ed52d991cf270db897190f19d6f9838564d0 @@ -13,16 +13,20 @@ build: script_env: - CI - TRAVIS + - TOOLCHAIN_ARCH requirements: build: - - system # [not win] - - isl >=0.15 + - {{ compiler('c') }} + run: + {% for package in resolved_packages('host') %} + - {{ package }} + {% endfor %} test: commands: - - riscv32-elf-ld --version - - riscv32-elf-ld --version 2>&1 | grep -q 2.31.1 + - {{ environ.get('TOOLCHAIN_ARCH') }}-elf-ld --version + - {{ environ.get('TOOLCHAIN_ARCH') }}-elf-ld --version 2>&1 | grep -q 2.31.1 about: home: https://www.gnu.org/software/binutils/ diff --git a/conda-env.sh b/conda-env.sh index 1337607c..1206a167 100755 --- a/conda-env.sh +++ b/conda-env.sh @@ -1,5 +1,9 @@ #!/bin/bash +if ! which conda; then + export PATH=~/conda/bin:$PATH +fi + # Disable this warning; # xxxx/conda_build/environ.py:377: UserWarning: The environment variable # 'TRAVIS' is being passed through with value 0. If you are splitting @@ -37,4 +41,5 @@ export TRAVIS_REPO_SLUG="$(git rev-parse --abbrev-ref --symbolic-full-name @{u}) echo "TRAVIS_REPO_SLUG='${TRAVIS_REPO_SLUG}'" ./conda-meta-extra.sh +echo conda $@ conda $@ diff --git a/conda-meta-extra.sh b/conda-meta-extra.sh index bb6dd2fd..797b3e52 100755 --- a/conda-meta-extra.sh +++ b/conda-meta-extra.sh @@ -17,6 +17,11 @@ extra: describe: $GITREV date: $DATESTR EOF +if [ ! -z "${TOOLCHAIN_ARCH}" ]; then + cat >> recipe_append.yaml <=0.15 - -test: - commands: - - lm32-elf-ld --version - - lm32-elf-ld --version 2>&1 | grep -q 2.31.1 - -about: - home: https://www.gnu.org/software/binutils/ - license: GPL - summary: 'A set of programming tools for creating and managing binary programs, object files, libraries, profile data, and assembly source code.' diff --git a/or1k/binutils/build.sh b/or1k/binutils/build.sh deleted file mode 100644 index cd1cfc70..00000000 --- a/or1k/binutils/build.sh +++ /dev/null @@ -1,21 +0,0 @@ -#! /bin/bash - -set -e -set -x - -if [ x"$TRAVIS" = xtrue ]; then - CPU_COUNT=2 -fi - -mkdir build -cd build -../configure \ - --target=or1k-elf \ - --prefix=$PREFIX \ - --enable-deterministic-archives \ - -make -j$CPU_COUNT -make install-strip - -$PREFIX/bin/or1k-elf-ld --version -echo $($PREFIX/bin/or1k-elf-ld --version 2>&1 | head -1 | sed -e's/GNU ld (GNU Binutils) //') diff --git a/or1k/binutils/meta.yaml b/or1k/binutils/meta.yaml deleted file mode 100644 index 0543459e..00000000 --- a/or1k/binutils/meta.yaml +++ /dev/null @@ -1,30 +0,0 @@ -package: - name: binutils-or1k-elf - version: 2.31.1 - -source: - fn: binutils-2.31.tar.bz2 - url: https://ftp.gnu.org/gnu/binutils/binutils-2.31.1.tar.bz2 - sha256: ffcc382695bf947da6135e7436b8ed52d991cf270db897190f19d6f9838564d0 - -build: - detect_binary_files_with_prefix: True - number: 0 - script_env: - - CI - - TRAVIS - -requirements: - build: - - system # [not win] - - isl >=0.15 - -test: - commands: - - or1k-elf-ld --version - - or1k-elf-ld --version 2>&1 | grep -q 2.31.1 - -about: - home: https://www.gnu.org/software/binutils/ - license: GPL - summary: 'A set of programming tools for creating and managing binary programs, object files, libraries, profile data, and assembly source code.' diff --git a/riscv32/binutils/build.sh b/riscv32/binutils/build.sh deleted file mode 100644 index 1f492d84..00000000 --- a/riscv32/binutils/build.sh +++ /dev/null @@ -1,21 +0,0 @@ -#! /bin/bash - -set -e -set -x - -if [ x"$TRAVIS" = xtrue ]; then - CPU_COUNT=2 -fi - -mkdir build -cd build -../configure \ - --target=riscv32-elf \ - --prefix=$PREFIX \ - --enable-deterministic-archives \ - -make -j$CPU_COUNT -make install-strip -touch .buildstamp -TZ=UTC date +%Y%m%d_%H%M%S -r .buildstamp > ../__conda_buildstr__.txt -TZ=UTC date +%Y%m%d%H%M%S -r .buildstamp > ../__conda_buildnum__.txt diff --git a/sh2/binutils/build.sh b/sh2/binutils/build.sh deleted file mode 100644 index ceb7d551..00000000 --- a/sh2/binutils/build.sh +++ /dev/null @@ -1,21 +0,0 @@ -#! /bin/bash - -set -e -set -x - -if [ x"$TRAVIS" = xtrue ]; then - CPU_COUNT=2 -fi - -mkdir build -cd build -../configure \ - --target=sh2-elf \ - --prefix=$PREFIX \ - --enable-deterministic-archives \ - -make -j$CPU_COUNT -make install-strip -touch .buildstamp -TZ=UTC date +%Y%m%d_%H%M%S -r .buildstamp > ../__conda_buildstr__.txt -TZ=UTC date +%Y%m%d%H%M%S -r .buildstamp > ../__conda_buildnum__.txt diff --git a/sh2/binutils/meta.yaml b/sh2/binutils/meta.yaml deleted file mode 100644 index 6e8155b2..00000000 --- a/sh2/binutils/meta.yaml +++ /dev/null @@ -1,30 +0,0 @@ -package: - name: binutils-sh2-elf - version: 2.31.1 - -source: - fn: binutils-2.31.tar.bz2 - url: https://ftp.gnu.org/gnu/binutils/binutils-2.31.1.tar.bz2 - sha256: ffcc382695bf947da6135e7436b8ed52d991cf270db897190f19d6f9838564d0 - -build: - detect_binary_files_with_prefix: True - number: 0 - script_env: - - CI - - TRAVIS - -requirements: - build: - - system # [not win] - - isl >=0.15 - -test: - commands: - - sh2-elf-ld --version - - sh2-elf-ld --version 2>&1 | grep -q 2.31.1 - -about: - home: https://www.gnu.org/software/binutils/ - license: GPL - summary: 'A set of programming tools for creating and managing binary programs, object files, libraries, profile data, and assembly source code.' From 99252a300faed2367d023482ca9f287b9945bbc3 Mon Sep 17 00:00:00 2001 From: Tim 'mithro' Ansell Date: Tue, 18 Sep 2018 16:25:09 -0700 Subject: [PATCH 03/36] travis: Change split between install/run. * Install now does the download. * Script shouldn't contact the internet. --- .travis/common.sh | 16 ++++++++++------ .travis/install.sh | 29 +++++++++++++++++++++++------ .travis/script.sh | 12 +++++------- 3 files changed, 38 insertions(+), 19 deletions(-) diff --git a/.travis/common.sh b/.travis/common.sh index d2eed591..1ee9b81e 100644 --- a/.travis/common.sh +++ b/.travis/common.sh @@ -1,10 +1,10 @@ # Some colors, use it like following; # echo -e "Hello ${YELLOW}yellow${NC}" -GRAY='\033[0;30m' -RED='\033[0;31m' -GREEN='\033[0;32m' -YELLOW='\033[0;33m' -PURPLE='\033[0;35m' +GRAY=' \033[0;30m' +RED=' \033[0;31m' +GREEN=' \033[0;32m' +YELLOW=' \033[0;33m' +PURPLE=' \033[0;35m' NC='\033[0m' # No Color SPACER="echo -e ${GRAY} - ${NC}" @@ -49,4 +49,8 @@ mkdir -p "$BASE_PATH" export PATH="$PATH:$CONDA_PATH/bin" export GITREV="$(git describe --long 2>/dev/null || echo "unknown")" -export CONDA_OUT="$(conda render $PACKAGE --output 2> /dev/null | tail -n 1 | sed -e's/-[0-9]\+\.tar/*.tar/' -e's/-git//')" +export CONDA_BUILD_ARGS=$PACKAGE +if [ -f "$PACKAGE/conda_build_config.$TOOLCHAIN_ARCH.yaml" ]; then + export CONDA_BUILD_ARGS="$CONDA_BUILD_ARGS -m $PACKAGE/conda_build_config.$TOOLCHAIN_ARCH.yaml" +fi +export CONDA_OUT="$(conda render $CONDA_BUILD_ARGS --output 2> /dev/null | tail -n 1 | sed -e's/-[0-9]\+\.tar/*.tar/' -e's/-git//')" diff --git a/.travis/install.sh b/.travis/install.sh index be8f1309..2d674860 100755 --- a/.travis/install.sh +++ b/.travis/install.sh @@ -36,11 +36,28 @@ conda config --show end_section "info.conda.config" start_section "info.conda.package" "Info on ${YELLOW}conda package${NC}" -conda render $PACKAGE +conda render --no-source $CONDA_BUILD_ARGS || true end_section "info.conda.package" -start_section "info.autotools" "Info on ${YELLOW}autotools${NC}" -autoconf --version -automake --version -libtool --version -end_section "info.autotools" +$SPACER + +start_section "conda.copy" "${GREEN}Copying package...${NC}" +mkdir -p /tmp/conda/$PACKAGE +cp -vRL $PACKAGE/* /tmp/conda/$PACKAGE/ +cd /tmp/conda/ +end_section "conda.copy" + +$SPACER + +start_section "conda.download" "${GREEN}Downloading..${NC}" +conda build --source $CONDA_BUILD_ARGS || true +end_section "conda.download" + +if [ -e $PACKAGE/prescript.$TOOLCHAIN_ARCH.sh ]; then + start_section "conda.prescript" "${GREEN}Prescript..${NC}" + ( + cd $TRAVIS_BUILD_DIR + $PACKAGE/prescript.$TOOLCHAIN_ARCH.sh + ) + end_section "conda.prescript" +fi diff --git a/.travis/script.sh b/.travis/script.sh index 0f8a0ebf..664da185 100755 --- a/.travis/script.sh +++ b/.travis/script.sh @@ -5,22 +5,20 @@ set -e $SPACER -start_section "conda.copy" "${GREEN}Copying package...${NC}" -mkdir -p /tmp/conda/$PACKAGE -cp -vRL $PACKAGE/* /tmp/conda/$PACKAGE/ -cd /tmp/conda/ -end_section "conda.copy" +start_section "info.conda.package" "Info on ${YELLOW}conda package${NC}" +conda render $CONDA_BUILD_ARGS +end_section "info.conda.package" $SPACER start_section "conda.check" "${GREEN}Checking...${NC}" -conda build --check $PACKAGE +conda build --check $CONDA_BUILD_ARGS || true end_section "conda.check" $SPACER start_section "conda.build" "${GREEN}Building..${NC}" -$CONDA_PATH/bin/python $TRAVIS_BUILD_DIR/.travis-output.py /tmp/output.log conda build $PACKAGE +$CONDA_PATH/bin/python $TRAVIS_BUILD_DIR/.travis-output.py /tmp/output.log conda build $CONDA_BUILD_ARGS end_section "conda.build" $SPACER From 624b29b47bf7e6a96f0efa6232fe8fe0234ae225 Mon Sep 17 00:00:00 2001 From: Tim 'mithro' Ansell Date: Tue, 18 Sep 2018 16:26:19 -0700 Subject: [PATCH 04/36] Removing conda-multisrc-example as conda has native support now. --- .gitmodules | 3 --- conda-multisrc-example | 1 - 2 files changed, 4 deletions(-) delete mode 100644 .gitmodules delete mode 160000 conda-multisrc-example diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index 92464e00..00000000 --- a/.gitmodules +++ /dev/null @@ -1,3 +0,0 @@ -[submodule "conda-multisrc-example"] - path = conda-multisrc-example - url = https://github.com/mithro/conda-multisrc-example.git diff --git a/conda-multisrc-example b/conda-multisrc-example deleted file mode 160000 index 9cee5464..00000000 --- a/conda-multisrc-example +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 9cee546447a31c3246338188d06c125c81758dc1 From 5c9bc3d33f6fd967b4d9b98f580483987ebfa366 Mon Sep 17 00:00:00 2001 From: Tim 'mithro' Ansell Date: Tue, 18 Sep 2018 16:27:14 -0700 Subject: [PATCH 05/36] gdb: Move to common recipe. --- {lm32/gdb => gdb}/build.sh | 11 +++---- gdb/meta.yaml | 45 +++++++++++++++++++++++++++++ lm32/gdb/meta.yaml | 31 -------------------- or1k/gdb/build.sh | 59 -------------------------------------- or1k/gdb/meta.yaml | 30 ------------------- 5 files changed, 51 insertions(+), 125 deletions(-) rename {lm32/gdb => gdb}/build.sh (71%) create mode 100644 gdb/meta.yaml delete mode 100644 lm32/gdb/meta.yaml delete mode 100644 or1k/gdb/build.sh delete mode 100644 or1k/gdb/meta.yaml diff --git a/lm32/gdb/build.sh b/gdb/build.sh similarity index 71% rename from lm32/gdb/build.sh rename to gdb/build.sh index 66a73bc3..998e9579 100644 --- a/lm32/gdb/build.sh +++ b/gdb/build.sh @@ -12,7 +12,7 @@ fi mkdir build cd build ../configure \ - --target=lm32-elf \ + --target=${TOOLCHAIN_ARCH}-elf \ --prefix=$PREFIX \ \ --disable-itcl \ @@ -24,7 +24,7 @@ cd build --disable-rda \ --disable-sid \ --disable-sim \ - --disable-lm32sim \ + --disable-${TOOLCHAIN_ARCH}sim \ --with-sysroot \ --disable-newlib \ --disable-libgloss \ @@ -32,14 +32,15 @@ cd build --disable-ld \ --disable-binutils \ --disable-gprof \ - --with-system-zlib \ \ --disable-shared \ --enable-static \ +# --with-system-zlib \ + make -j$CPU_COUNT make install ) -$PREFIX/bin/lm32-elf-gdb --version -echo $($PREFIX/bin/lm32-elf-gdb --version 2>&1 | head -1 | sed -e's/.* //') +$PREFIX/bin/${TOOLCHAIN_ARCH}-elf-gdb --version +echo $($PREFIX/bin/${TOOLCHAIN_ARCH}-elf-gdb --version 2>&1 | head -1 | sed -e's/.* //') diff --git a/gdb/meta.yaml b/gdb/meta.yaml new file mode 100644 index 00000000..f2016e79 --- /dev/null +++ b/gdb/meta.yaml @@ -0,0 +1,45 @@ +package: + name: gdb-{{ environ.get('TOOLCHAIN_ARCH') }}-elf + version: 7.11 + +{% if environ.get('TOOLCHAIN_ARCH') == "or1k" %} +source: + git_url: https://github.com/openrisc/binutils-gdb.git + git_rev: gdb-7.11-or1k-release +{% else %} +source: + fn: gdb-7.11.tar.gz + url: http://ftp.gnu.org/gnu/gdb/gdb-7.11.tar.gz + sha256: 9382f5534aa0754169e1e09b5f1a3b77d1fa8c59c1e57617e06af37cb29c669a +{% endif %} + +build: + detect_binary_files_with_prefix: True + number: 0 + script_env: + - CI + - TRAVIS + - TOOLCHAIN_ARCH + +requirements: + build: + - {{ compiler('c') }} + - {{ compiler('cxx') }} + - binutils-{{ environ.get('TOOLCHAIN_ARCH') }}-elf + - gcc-{{ environ.get('TOOLCHAIN_ARCH') }}-elf-nostdc + - zlib + run: + - binutils-{{ environ.get('TOOLCHAIN_ARCH') }}-elf + {% for package in resolved_packages('host') %} + - {{ package }} + {% endfor %} + +test: + commands: + - {{ environ.get('TOOLCHAIN_ARCH') }}-elf-gdb --version + - {{ environ.get('TOOLCHAIN_ARCH') }}-elf-gdb --version 2>&1 | grep -q 7.11 + +about: + home: https://www.gnu.org/software/gdb/ + license: GPL + summary: 'GDB, the GNU Project debugger, allows you to see what is going on "inside" another program while it executes -- or what another program was doing at the moment it crashed.' diff --git a/lm32/gdb/meta.yaml b/lm32/gdb/meta.yaml deleted file mode 100644 index e0bb38fd..00000000 --- a/lm32/gdb/meta.yaml +++ /dev/null @@ -1,31 +0,0 @@ -package: - name: gdb-lm32-elf - version: 7.11 - -source: - fn: gdb-7.11.tar.gz - url: http://ftp.gnu.org/gnu/gdb/gdb-7.11.tar.gz - sha256: 9382f5534aa0754169e1e09b5f1a3b77d1fa8c59c1e57617e06af37cb29c669a - -build: - detect_binary_files_with_prefix: True - number: 0 - script_env: - - CI - - TRAVIS - -requirements: - build: - - system # [not win] - - binutils-lm32-elf - - gcc-lm32-elf-nostdc - -test: - commands: - - lm32-elf-gdb --version - - lm32-elf-gdb --version 2>&1 | grep -q 7.11 - -about: - home: https://www.gnu.org/software/gdb/ - license: GPL - summary: 'GDB, the GNU Project debugger, allows you to see what is going on "inside" another program while it executes -- or what another program was doing at the moment it crashed.' diff --git a/or1k/gdb/build.sh b/or1k/gdb/build.sh deleted file mode 100644 index 8bd27d02..00000000 --- a/or1k/gdb/build.sh +++ /dev/null @@ -1,59 +0,0 @@ -#!/bin/bash -# Instructions from http://openrisc.io/newlib/building.html - -set -x -set -e - -if [ x"$TRAVIS" = xtrue ]; then - CPU_COUNT=2 -fi - -# Fetch upstream binutils-gdb so we can get a git-describe delta -git remote add upstream git://sourceware.org/git/binutils-gdb.git -git fetch upstream - -# Find our current or1k release -OR1K_RELEASE=$(git describe --abbrev=0 --match gdb-*or1k-release) -echo " or1k release: '$OR1K_RELEASE'" -# Find update release -UPSTREAM_RELEASE=$(echo $OR1K_RELEASE | sed -e's/-or1k-/-/') -echo "upstream release: '$UPSTREAM_RELEASE'" -# Find our relationship to the upstream gdb release -GIT_REV=$(git describe --long --match ${UPSTREAM_RELEASE} | sed -e"s/^${UPSTREAM_RELEASE}-//" -e's/-/_/') -echo " or1k git delta: '$GIT_REV'" - -( -mkdir build -cd build -../configure \ - --target=or1k-elf \ - --prefix=$PREFIX \ - \ - --disable-itcl \ - --disable-tk \ - --disable-tcl \ - --disable-winsup \ - --disable-gdbtk \ - --disable-libgui \ - --disable-rda \ - --disable-sid \ - --disable-sim \ - --disable-or1ksim \ - --with-sysroot \ - --disable-newlib \ - --disable-libgloss \ - --disable-gas \ - --disable-ld \ - --disable-binutils \ - --disable-gprof \ - --with-system-zlib \ - \ - --disable-shared \ - --enable-static \ - -make -j$CPU_COUNT -make install -) - -$PREFIX/bin/or1k-elf-gdb --version -echo $($PREFIX/bin/or1k-elf-gdb --version 2>&1 | head -1 | sed -e's/.* //' -e"s/\$/_$GIT_REV/") diff --git a/or1k/gdb/meta.yaml b/or1k/gdb/meta.yaml deleted file mode 100644 index 70f86eb9..00000000 --- a/or1k/gdb/meta.yaml +++ /dev/null @@ -1,30 +0,0 @@ -package: - name: gdb-or1k-elf - version: git - -source: - git_url: https://github.com/openrisc/binutils-gdb.git - git_rev: gdb-7.11-or1k-release - -build: - detect_binary_files_with_prefix: True - number: 0 - script_env: - - CI - - TRAVIS - -requirements: - build: - - system # [not win] - - binutils-or1k-elf - - gcc-lm32-elf-nostdc - -test: - commands: - - or1k-elf-gdb --version - - or1k-elf-gdb --version 2>&1 | grep -q 7.11 - -about: - home: https://www.gnu.org/software/gdb/ - license: GPL - summary: 'GDB, the GNU Project debugger, allows you to see what is going on "inside" another program while it executes -- or what another program was doing at the moment it crashed.' From e810b7148f6b4327493c477a38986bedd48fb265 Mon Sep 17 00:00:00 2001 From: Tim 'mithro' Ansell Date: Tue, 18 Sep 2018 16:28:41 -0700 Subject: [PATCH 06/36] gcc: Move to common packages. --- .gitignore | 2 + empty.tar.bz2 | Bin 0 -> 609 bytes find-git-cache.py | 54 +++++++ gcc/newlib/build.sh | 146 +++++++++++++++++++ gcc/newlib/empty.tar.bz2 | 1 + gcc/newlib/meta.yaml | 82 +++++++++++ gcc/newlib/prescript.or1k.sh | 1 + {lm32/gcc-newlib => gcc/newlib}/run_test.sh | 8 +- {lm32/gcc-nostdc => gcc/newlib}/stdint.patch | 0 gcc/nostdc/build.sh | 107 ++++++++++++++ gcc/nostdc/empty.tar.bz2 | 1 + gcc/nostdc/meta.yaml | 74 ++++++++++ gcc/nostdc/prescript.or1k.sh | 54 +++++++ {lm32/gcc-nostdc => gcc/nostdc}/run_test.sh | 19 ++- lm32/gcc-newlib/build.sh | 95 ------------ lm32/gcc-newlib/download-extra-sources.py | 1 - lm32/gcc-newlib/meta.yaml | 54 ------- lm32/gcc-newlib/reload1.patch | 11 -- lm32/gcc-newlib/stdint.patch | 1 - lm32/gcc-nostdc/build.sh | 71 --------- lm32/gcc-nostdc/meta.yaml | 45 ------ lm32/gcc-nostdc/reload1.patch | 11 -- or1k/gcc-newlib/build.sh | 124 ---------------- or1k/gcc-newlib/download-extra-sources.py | 1 - or1k/gcc-newlib/find-git-cache.py | 1 - or1k/gcc-newlib/meta.yaml | 51 ------- or1k/gcc-newlib/reload1.patch | 11 -- or1k/gcc-newlib/run_test.sh | 88 ----------- or1k/gcc-nostdc/build.sh | 96 ------------ or1k/gcc-nostdc/find-git-cache.py | 1 - or1k/gcc-nostdc/meta.yaml | 43 ------ or1k/gcc-nostdc/reload1.patch | 11 -- or1k/gcc-nostdc/run_test.sh | 145 ------------------ 33 files changed, 541 insertions(+), 869 deletions(-) create mode 100644 empty.tar.bz2 create mode 100755 find-git-cache.py create mode 100644 gcc/newlib/build.sh create mode 120000 gcc/newlib/empty.tar.bz2 create mode 100644 gcc/newlib/meta.yaml create mode 120000 gcc/newlib/prescript.or1k.sh rename {lm32/gcc-newlib => gcc/newlib}/run_test.sh (92%) rename {lm32/gcc-nostdc => gcc/newlib}/stdint.patch (100%) create mode 100644 gcc/nostdc/build.sh create mode 120000 gcc/nostdc/empty.tar.bz2 create mode 100644 gcc/nostdc/meta.yaml create mode 100755 gcc/nostdc/prescript.or1k.sh rename {lm32/gcc-nostdc => gcc/nostdc}/run_test.sh (88%) delete mode 100644 lm32/gcc-newlib/build.sh delete mode 120000 lm32/gcc-newlib/download-extra-sources.py delete mode 100644 lm32/gcc-newlib/meta.yaml delete mode 100644 lm32/gcc-newlib/reload1.patch delete mode 120000 lm32/gcc-newlib/stdint.patch delete mode 100644 lm32/gcc-nostdc/build.sh delete mode 100644 lm32/gcc-nostdc/meta.yaml delete mode 100644 lm32/gcc-nostdc/reload1.patch delete mode 100644 or1k/gcc-newlib/build.sh delete mode 120000 or1k/gcc-newlib/download-extra-sources.py delete mode 120000 or1k/gcc-newlib/find-git-cache.py delete mode 100644 or1k/gcc-newlib/meta.yaml delete mode 100644 or1k/gcc-newlib/reload1.patch delete mode 100644 or1k/gcc-newlib/run_test.sh delete mode 100644 or1k/gcc-nostdc/build.sh delete mode 120000 or1k/gcc-nostdc/find-git-cache.py delete mode 100644 or1k/gcc-nostdc/meta.yaml delete mode 100644 or1k/gcc-nostdc/reload1.patch delete mode 100644 or1k/gcc-nostdc/run_test.sh diff --git a/.gitignore b/.gitignore index 7534b887..19bef4a5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ Miniconda3-latest-Linux-x86_64.sh recipe_append.yaml +gcc/nostdc/conda_build_config.*.yaml +gcc/newlib/conda_build_config.*.yaml diff --git a/empty.tar.bz2 b/empty.tar.bz2 new file mode 100644 index 0000000000000000000000000000000000000000..a06fc2290cea7070677c2367dc4e073440893cf3 GIT binary patch literal 609 zcmV-n0-pUsT4*^jL0KkKS@zAv7ytnA|ANR60svY6|JXnF-oStF-{C+200=+<{MKE` zv_#U68jyN`G|lVv>QMh|D~oBsBse32IGX6cHJ26k-Je z)I@`lM!R%eh@xkVfOrKE!`7{>ff$ESu(1w|jH+OxXnhYKeo#UhlA?Z=jaj5UF?J(% z{+&J0HQR@%SOkHZq5%`Vg!rxtJ_4xD|_$+(5-9>!XccEF#R%T#Zu&4lD--AX8)94xoauvB5Gq4Ftk&&Wi%( vxyqsa2x2aaidNycBS^+nv}qWH=|z^Cp*T$u$rGLd1N>dd6yZWc+cy+o-ckfH literal 0 HcmV?d00001 diff --git a/find-git-cache.py b/find-git-cache.py new file mode 100755 index 00000000..5f5d7664 --- /dev/null +++ b/find-git-cache.py @@ -0,0 +1,54 @@ +from __future__ import print_function + +import contextlib +import io +import os + +from conda_build import source +from conda_build.config import get_or_merge_config +from conda_build.metadata import MetaData +from conda_build.variants import get_package_variants, set_language_env_vars + + +def mirror_dir(metadata, data_type=None): + meta = [x for x in metadata.get_section('source') if x['folder'] == 'gcc'][0] + if not data_type: + return meta + + if data_type == 'git_url': + git_url = meta['git_url'] + git_dn = git_url.split('://')[-1].replace('/', os.sep) + if git_dn.startswith(os.sep): + git_dn = git_dn[1:] + git_dn = git_dn.replace(':', '_') + return os.path.join(metadata.config.git_cache, git_dn) + else: + return meta[data_type] + + +def main(recipe_dir=None, data_type=None, variant=None): + # Get the extra_source section of the metadata. + if recipe_dir is None: + recipe_dir = os.environ["RECIPE_DIR"] + assert recipe_dir is not None, recipe_dir + + if variant: + extra = {'variant_config_files': '%s/conda_build_config.%s.yaml' % (recipe_dir, variant)} + else: + extra = {} + + f = io.StringIO() + with contextlib.redirect_stdout(f): + config = get_or_merge_config(None, **extra) + variants = get_package_variants(recipe_dir, config) + assert len(variants) == 1 + metadata = MetaData(recipe_dir, config=config, variant=variants[0]) + try: + print(mirror_dir(metadata, data_type)) + except KeyError: + pass + + +if __name__ == "__main__": + import sys + main(*sys.argv[1:]) diff --git a/gcc/newlib/build.sh b/gcc/newlib/build.sh new file mode 100644 index 00000000..7b644029 --- /dev/null +++ b/gcc/newlib/build.sh @@ -0,0 +1,146 @@ +#!/bin/bash + +# gcc newlib build + +set -e +if [ x"$TOOLCHAIN_ARCH" = x ]; then + export | grep toolchain + exit 1 +else + echo "TOOLCHAIN_ARCH: '$TOOLCHAIN_ARCH'" +fi + +if [ x"$TRAVIS" = xtrue ]; then + CPU_COUNT=2 +fi +echo +echo +echo "============================================================" +echo "CFLAGS='$CFLAGS'" +echo "CXXFLAGS='$CXXFLAGS'" +echo "CPPFLAGS='$CPPFLAGS'" +echo "DEBUG_CXXFLAGS='$DEBUG_CXXFLAGS'" +echo "DEBUG_CPPFLAGS='$DEBUG_CPPFLAGS'" +echo "LDFLAGS='$LDFLAGS'" +echo "------------------------------------------------------------" +export CFLAGS="$(echo $CFLAGS) -w" +export CXXFLAGS="$(echo $CXXFLAGS | sed -e's/-std=c++17 //') -w" +export CPPFLAGS="$(echo $CPPFLAGS | sed -e's/-std=c++17 //')" +export DEBUG_CXXFLAGS="$(echo $DEBUG_CXXFLAGS | sed -e's/-std=c++17 //') -w" +export DEBUG_CPPFLAGS="$(echo $DEBUG_CPPFLAGS | sed -e's/-std=c++17 //')" +echo "CFLAGS='$CFLAGS'" +echo "CXXFLAGS='$CXXFLAGS'" +echo "CPPFLAGS='$CPPFLAGS'" +echo "DEBUG_CXXFLAGS='$DEBUG_CXXFLAGS'" +echo "DEBUG_CPPFLAGS='$DEBUG_CPPFLAGS'" +echo "LDFLAGS='$LDFLAGS'" +echo "------------------------------------------------------------" +export +echo "============================================================" +echo +echo +echo "Start directory ============================================" +echo $PWD +ls -l $PWD +echo "------------------------------------------------------------" +ls -l $PWD/* +echo "============================================================" +echo +echo +echo "Source directory ===========================================" +echo $SRC_DIR +ls -l $SRC_DIR +echo "------------------------------------------------------------" +ls -l $SRC_DIR/* +echo "============================================================" +echo +echo + +TARGET=${TOOLCHAIN_ARCH}-elf +GCC=$TARGET-newlib-gcc + +# Check binutils +$TARGET-as --version + +# Check the "nostdc" gcc is already installed +echo -n "---?" +which $TARGET-gcc +ls -l $(which $TARGET-gcc) +file $(which $TARGET-gcc) +echo "---" +$TARGET-gcc --version 2>&1 +echo "---" + +GCC_STAGE1_VERSION=$($TARGET-gcc --version 2>&1 | head -1 | sed -e"s/$TARGET-gcc (GCC) //") +GCC_STAGE2_VERSION=$(echo $PKG_VERSION | sed -e's/-.*//') +if [ "$GCC_STAGE1_VERSION" != "$GCC_STAGE2_VERSION" ]; then + echo + echo "nostdc version: $GCC_STAGE1_VERSION" + echo " this version: $GCC_STAGE2_VERSION" + echo + echo "Stage 1 compiler (nostdc) not the same version as us!" + echo + exit 1 +fi + +set -x + +rm -rf libstdc++-v3 +cd .. + +mkdir -p build-newlib +cd build-newlib +$SRC_DIR/newlib/configure \ + --prefix=$PREFIX \ + --target=$TARGET \ + --disable-newlib-supplied-syscalls \ + +make -j$CPU_COUNT +make install +cd .. + +mkdir -p build-gcc +cd build-gcc + +#export LDFLAGS=-static +$SRC_DIR/gcc/configure \ + \ + --program-prefix=$TARGET-newlib- \ + \ + --prefix=$PREFIX \ + \ + --with-gmp=$CONDA_PREFIX \ + --with-mpfr=$CONDA_PREFIX \ + --with-mpc=$CONDA_PREFIX \ + --with-isl=$CONDA_PREFIX \ + --with-cloog=$CONDA_PREFIX \ + \ + --target=$TARGET \ + --with-pkgversion=$PKG_VERSION \ + --enable-languages="c,c++" \ + --with-newlib \ + --enable-libgcc \ + \ + --disable-nls \ + + + +make -j$CPU_COUNT +make install-strip + +# Install aliases for the binutil tools +for BINUTIL in $(ls $PREFIX/bin/$TARGET-* | grep /$TARGET-); do + NEWLIB_BINUTIL="$(echo $BINUTIL | sed -e"s_/$TARGET-_/$TARGET-newlib-_" -e's/newlib-newlib/newlib/')" + + if [ ! -e "$NEWLIB_BINUTIL" ]; then + ln -sv "$BINUTIL" "$NEWLIB_BINUTIL" + fi +done +ls -l $PREFIX/bin/$TARGET-newlib-* + +cd .. + +VERSION_DIR="$(echo $SRC_DIR | sed -e's-/work/.*-/work/-')" + +$PREFIX/bin/$TARGET-newlib-gcc --version +echo $($PREFIX/bin/$TARGET-newlib-gcc --version 2>&1 | head -1 | sed -e"s/$TARGET-gcc (GCC) //") diff --git a/gcc/newlib/empty.tar.bz2 b/gcc/newlib/empty.tar.bz2 new file mode 120000 index 00000000..bd0e266d --- /dev/null +++ b/gcc/newlib/empty.tar.bz2 @@ -0,0 +1 @@ +../../empty.tar.bz2 \ No newline at end of file diff --git a/gcc/newlib/meta.yaml b/gcc/newlib/meta.yaml new file mode 100644 index 00000000..bfd6df7b --- /dev/null +++ b/gcc/newlib/meta.yaml @@ -0,0 +1,82 @@ +package: + name: gcc-{{ environ.get('TOOLCHAIN_ARCH') }}-elf-newlib +{% if environ.get('TOOLCHAIN_ARCH') == "or1k" %} + version: 5.4.0+{{ gcc_git_rev }} +{% else %} + version: 5.4.0 +{% endif %} + +source: +{% if environ.get('TOOLCHAIN_ARCH') == "or1k" %} + - git_url: https://github.com/openrisc/or1k-gcc.git + git_rev: or1k-5.4.0 + folder: gcc +{% elif environ.get('TOOLCHAIN_ARCH') %} + - url: ftp://ftp.gnu.org/gnu/gcc/gcc-5.4.0/gcc-5.4.0.tar.bz2 + fn: gcc-5.4.0.tar.bz2 + sha256: 608df76dec2d34de6558249d8af4cbee21eceddbcb580d666f7a5a583ca3303a + folder: gcc + patches: + - stdint.patch +{% else %} + - url: empty.tar.bz2 + folder: other +{% endif %} + - url: ftp://sourceware.org/pub/newlib/newlib-2.5.0.20170228.tar.gz + fn: newlib-2.5.0.20170228.tar.gz + sha256: 29923e9696b091dc2f880018e747c8cf282a557d2cdb60f760d9ec6a1f97337d + folder: newlib + +build: +{% if environ.get('GIT_DESCRIBE_NUMBER', "0") != "0" %} + # y==GIT_DESCRIBE_NUMBER, z==DATESTR, x==GIT_DESCRIBE_HASH + # + # number: 10693001803050325 + # 1yyyy00zzzzzzzzzz + number: {{ '1%04i00%s'|format(environ.get('GIT_DESCRIBE_NUMBER')|int, environ.get('DATESTR')) }} + # string: 0693.1803050325.g588ce0e3 + # yyyy.zzzzzzzzzz.gxxxxxxxx + string: {{ '%04i'|format(environ.get('GIT_DESCRIBE_NUMBER')|int) }}.{{ environ.get('DATESTR') }}.{{ environ.get('GIT_DESCRIBE_HASH', 'unknown') }} +{% else %} + # z==DATESTR + # + # number: 1803050325 + # zzzzzzzzzz + number: {{ environ.get('DATESTR') }} + # string: 0693.1803050325.g588ce0e3 + # yyyy.zzzzzzzzzz.gxxxxxxxx + string: {{ environ.get('DATESTR') }} +{% endif %} + script_env: + - CI + - TRAVIS + - TOOLCHAIN_ARCH + +requirements: + build: + - {{ compiler('c') }} + - {{ compiler('cxx') }} + host: + # These are taken from the output of the configure scripts + - gmp >=4.3.2 + - mpfr >=2.4.2 + - mpc >=0.8.1 + - isl + - cloog + # Arch specific + - binutils-{{ environ.get('TOOLCHAIN_ARCH') }}-elf + - gcc-{{ environ.get('TOOLCHAIN_ARCH') }}-elf-nostdc + run: + - binutils-{{ environ.get('TOOLCHAIN_ARCH') }}-elf + - gcc-{{ environ.get('TOOLCHAIN_ARCH') }}-elf-nostdc + {% for package in resolved_packages('host') %} + - {{ package }} + {% endfor %} + {% for package in resolved_packages('build') %} + - {{ package }} + {% endfor %} + +about: + home: https://gcc.gnu.org/ + license: GPL + summary: 'The GNU Compiler Collection includes front ends for C, C++, Objective-C, Fortran, Java, Ada, and Go, as well as libraries for these languages (libstdc++, libgcj,...).' diff --git a/gcc/newlib/prescript.or1k.sh b/gcc/newlib/prescript.or1k.sh new file mode 120000 index 00000000..090a2750 --- /dev/null +++ b/gcc/newlib/prescript.or1k.sh @@ -0,0 +1 @@ +../nostdc/prescript.or1k.sh \ No newline at end of file diff --git a/lm32/gcc-newlib/run_test.sh b/gcc/newlib/run_test.sh similarity index 92% rename from lm32/gcc-newlib/run_test.sh rename to gcc/newlib/run_test.sh index fec670cd..a5583595 100644 --- a/lm32/gcc-newlib/run_test.sh +++ b/gcc/newlib/run_test.sh @@ -1,11 +1,11 @@ #!/bin/bash -# lm32 gcc newlib run test +# gcc newlib run test set +x set +e -TARGET=lm32-elf +TARGET=${TOOLCHAIN_ARCH}-elf GCC=$TARGET-newlib-gcc OBJDUMP=$TARGET-objdump @@ -50,6 +50,8 @@ int main() { puts("Hello world!\n"); } EOF + +echo "Compiling main" $GCC -g main.c -o main -Wl,-Map=output.map SUCCESS=$? if [ $SUCCESS -ne 0 ]; then @@ -72,7 +74,7 @@ echo "-------------------------------------------" echo $TARGET-objdump -f ./main -if ! $TARGET-objdump -f ./main | grep -q 'architecture: lm32'; then +if ! $TARGET-objdump -f ./main | grep -q "architecture: ${TOOLCHAIN_ARCH}"; then echo "Compiled binary output not correct architecture!" exit 1 fi diff --git a/lm32/gcc-nostdc/stdint.patch b/gcc/newlib/stdint.patch similarity index 100% rename from lm32/gcc-nostdc/stdint.patch rename to gcc/newlib/stdint.patch diff --git a/gcc/nostdc/build.sh b/gcc/nostdc/build.sh new file mode 100644 index 00000000..ad1e2e4a --- /dev/null +++ b/gcc/nostdc/build.sh @@ -0,0 +1,107 @@ +#!/bin/bash + +# gcc bare metal build + +set -e + +if [ x"$TRAVIS" = xtrue ]; then + CPU_COUNT=2 +fi +echo +echo +echo "============================================================" +echo "CFLAGS='$CFLAGS'" +echo "CXXFLAGS='$CXXFLAGS'" +echo "CPPFLAGS='$CPPFLAGS'" +echo "DEBUG_CXXFLAGS='$DEBUG_CXXFLAGS'" +echo "DEBUG_CPPFLAGS='$DEBUG_CPPFLAGS'" +echo "LDFLAGS='$LDFLAGS'" +echo "------------------------------------------------------------" +export CFLAGS="$(echo $CFLAGS) -w" +export CXXFLAGS="$(echo $CXXFLAGS | sed -e's/-std=c++17 //') -w" +export CPPFLAGS="$(echo $CPPFLAGS | sed -e's/-std=c++17 //')" +export DEBUG_CXXFLAGS="$(echo $DEBUG_CXXFLAGS | sed -e's/-std=c++17 //') -w" +export DEBUG_CPPFLAGS="$(echo $DEBUG_CPPFLAGS | sed -e's/-std=c++17 //')" +echo "CFLAGS='$CFLAGS'" +echo "CXXFLAGS='$CXXFLAGS'" +echo "CPPFLAGS='$CPPFLAGS'" +echo "DEBUG_CXXFLAGS='$DEBUG_CXXFLAGS'" +echo "DEBUG_CPPFLAGS='$DEBUG_CPPFLAGS'" +echo "LDFLAGS='$LDFLAGS'" +echo "------------------------------------------------------------" +export +echo "============================================================" +echo +echo +echo "Start directory ============================================" +echo $PWD +ls -l $PWD +echo "------------------------------------------------------------" +ls -l $PWD/* +echo "============================================================" +echo +echo +echo "Source directory ===========================================" +echo $SRC_DIR +ls -l $SRC_DIR +echo "------------------------------------------------------------" +ls -l $SRC_DIR/* +echo "============================================================" +echo +echo + +TARGET=${TOOLCHAIN_ARCH}-elf +GCC=$TARGET-gcc + +# Check binutils +$TARGET-as --version + +set -x + +rm -rf libstdc++-v3 +cd .. + + +mkdir -p build-gcc +cd build-gcc + +# --without-headers - Tells GCC not to rely on any C library (standard or runtime) being present for the target. +#CFLAGS="$CFLAGS -Wno-literal-suffix" +#export LDFLAGS=-static +$SRC_DIR/gcc/configure \ + --prefix=$PREFIX \ + \ + --with-gmp=$CONDA_PREFIX \ + --with-mpfr=$CONDA_PREFIX \ + --with-mpc=$CONDA_PREFIX \ + --with-isl=$CONDA_PREFIX \ + --with-cloog=$CONDA_PREFIX \ + \ + --target=$TARGET \ + --with-pkgversion=$PKG_VERSION \ + --without-headers \ + --enable-languages="c" \ + --enable-threads=single \ + \ + --disable-nls \ + --disable-libatomic \ + --disable-libgcc \ + --disable-libgomp \ + --disable-libmudflap \ + --disable-libquadmath \ + --disable-libssp \ + --disable-multilib \ + --disable-nls \ + --disable-shared \ + --disable-tls \ + \ + + +make -j$CPU_COUNT +make install-strip +cd .. + +VERSION_DIR="$(echo $SRC_DIR | sed -e's-/work/.*-/work/-')" + +$PREFIX/bin/$TARGET-gcc --version +echo $($PREFIX/bin/$TARGET-gcc --version 2>&1 | head -1 | sed -e"s/$TARGET-gcc (GCC) //") diff --git a/gcc/nostdc/empty.tar.bz2 b/gcc/nostdc/empty.tar.bz2 new file mode 120000 index 00000000..bd0e266d --- /dev/null +++ b/gcc/nostdc/empty.tar.bz2 @@ -0,0 +1 @@ +../../empty.tar.bz2 \ No newline at end of file diff --git a/gcc/nostdc/meta.yaml b/gcc/nostdc/meta.yaml new file mode 100644 index 00000000..83fde450 --- /dev/null +++ b/gcc/nostdc/meta.yaml @@ -0,0 +1,74 @@ +package: + name: gcc-{{ environ.get('TOOLCHAIN_ARCH') }}-elf-nostdc +{% if environ.get('TOOLCHAIN_ARCH') == "or1k" %} + version: 5.4.0+{{ gcc_git_rev }} +{% else %} + version: 5.4.0 +{% endif %} + +source: +{% if environ.get('TOOLCHAIN_ARCH') == "or1k" %} + - git_url: https://github.com/openrisc/or1k-gcc.git + git_rev: or1k-5.4.0 + folder: gcc +{% elif environ.get('TOOLCHAIN_ARCH') %} + - url: ftp://ftp.gnu.org/gnu/gcc/gcc-5.4.0/gcc-5.4.0.tar.bz2 + fn: gcc-5.4.0.tar.bz2 + sha256: 608df76dec2d34de6558249d8af4cbee21eceddbcb580d666f7a5a583ca3303a + folder: gcc +{% else %} + - url: empty.tar.bz2 + folder: other +{% endif %} + +build: +{% if environ.get('GIT_DESCRIBE_NUMBER', "0") != "0" %} + # y==GIT_DESCRIBE_NUMBER, z==DATESTR, x==GIT_DESCRIBE_HASH + # + # number: 10693001803050325 + # 1yyyy00zzzzzzzzzz + number: {{ '1%04i00%s'|format(environ.get('GIT_DESCRIBE_NUMBER')|int, environ.get('DATESTR')) }} + # string: 0693.1803050325.g588ce0e3 + # yyyy.zzzzzzzzzz.gxxxxxxxx + string: {{ '%04i'|format(environ.get('GIT_DESCRIBE_NUMBER')|int) }}.{{ environ.get('DATESTR') }}.{{ environ.get('GIT_DESCRIBE_HASH', 'unknown') }} +{% else %} + # z==DATESTR + # + # number: 1803050325 + # zzzzzzzzzz + number: {{ environ.get('DATESTR') }} + # string: 0693.1803050325.g588ce0e3 + # yyyy.zzzzzzzzzz.gxxxxxxxx + string: {{ environ.get('DATESTR') }} +{% endif %} + script_env: + - CI + - TRAVIS + - TOOLCHAIN_ARCH + +requirements: + build: + - {{ compiler('c') }} + - {{ compiler('cxx') }} + host: + # These are taken from the output of the configure scripts + - gmp >=4.3.2 + - mpfr >=2.4.2 + - mpc >=0.8.1 + - isl + - cloog + # Arch specific + - binutils-{{ environ.get('TOOLCHAIN_ARCH') }}-elf + run: + - binutils-{{ environ.get('TOOLCHAIN_ARCH') }}-elf + {% for package in resolved_packages('host') %} + - {{ package }} + {% endfor %} + {% for package in resolved_packages('build') %} + - {{ package }} + {% endfor %} + +about: + home: https://gcc.gnu.org/ + license: GPL + summary: 'The GNU Compiler Collection includes front ends for C, C++, Objective-C, Fortran, Java, Ada, and Go, as well as libraries for these languages (libstdc++, libgcj,...).' diff --git a/gcc/nostdc/prescript.or1k.sh b/gcc/nostdc/prescript.or1k.sh new file mode 100755 index 00000000..fc8795ce --- /dev/null +++ b/gcc/nostdc/prescript.or1k.sh @@ -0,0 +1,54 @@ +#!/bin/bash + +if ! which conda ; then + echo "No conda in path?" + exit 1 +fi + +if [ $TOOLCHAIN_ARCH != "or1k" ]; then + echo "Only valid for or1k config." + exit 1 +fi + +if [ -z "$CONDA_PATH" ]; then + CONDA_PATH=~/conda/ +fi + +TOP_DIR=$PWD +echo "Top dir: $TOP_DIR" +EXTRA_YAML_FILE=$TOP_DIR/gcc/nostdc/conda_build_config.$TOOLCHAIN_ARCH.yaml + +OR1K_GIT_DIR="$($CONDA_PATH/bin/python $TOP_DIR/find-git-cache.py gcc/nostdc git_url)" +OR1K_GIT_REV="$($CONDA_PATH/bin/python $TOP_DIR/find-git-cache.py gcc/nostdc git_rev)" +if [ -d $OR1K_GIT_DIR ]; then + echo "OR1K_GIT_DIR: $OR1K_GIT_DIR" + echo "OR1K_GIT_REV: $OR1K_GIT_REV" +else + echo "Could not find git directory! ($OR1K_GIT_DIR)" + exit 1 +fi +pushd $OR1K_GIT_DIR >/dev/null +git remote -v +if ! git remote -v | grep -q upstream; then + git remote add upstream git://gcc.gnu.org/git/gcc.git +fi +git fetch upstream +git fetch upstream --tags + +git fetch +git fetch --tags + +echo > $EXTRA_YAML_FILE + +# Find our current or1k release +OR1K_RELEASE=$(git describe --abbrev=0 --match or1k-*-* $OR1K_GIT_REV) +echo "or1k_release: $OR1K_RELEASE" >> $EXTRA_YAML_FILE +GCC_RELEASE=$(echo $OR1K_RELEASE | sed -e's/^or1k-/gcc-/' -e's/\./_/g' -e's/-[0-9]\+$/-release/') +GCC_RELEASE_FIXED=$(echo $GCC_RELEASE | sed -e's/_/./g') +echo "gcc_release: $GCC_RELEASE_FIXED" >> $EXTRA_YAML_FILE +GCC_GIT_REV=$(git describe --tags --long --match ${GCC_RELEASE} $OR1K_GIT_REV | sed -e"s/^${GCC_RELEASE}-//" -e's/-/_/') +echo "gcc_git_rev: $GCC_GIT_REV" >> $EXTRA_YAML_FILE + +more $EXTRA_YAML_FILE + +popd >/dev/null diff --git a/lm32/gcc-nostdc/run_test.sh b/gcc/nostdc/run_test.sh similarity index 88% rename from lm32/gcc-nostdc/run_test.sh rename to gcc/nostdc/run_test.sh index 70b2ea8b..3be01711 100644 --- a/lm32/gcc-nostdc/run_test.sh +++ b/gcc/nostdc/run_test.sh @@ -1,9 +1,11 @@ #!/bin/bash +# no C library gcc run test + set +x set +e -TARGET=lm32-elf +TARGET=${TOOLCHAIN_ARCH}-elf GCC=$TARGET-gcc OBJDUMP=$TARGET-objdump @@ -13,18 +15,24 @@ GCC_PKG_VERSION=$(echo $PKG_VERSION | sed -e's/-.*//') GCC_RUN_VERSION=$($GCC --version 2>&1 | head -1 | sed -e"s/$GCC (GCC) //") if [ "$GCC_PKG_VERSION" != "$GCC_RUN_VERSION" ]; then + echo + echo " package version: $GCC_PKG_VERSION ($PKG_VERSION)" + echo "installed version: $GCC_RUN_VERSION ($($GCC --version 2>&1 | head -1))" + echo echo "Compiler doesn't have correct version!" - echo " package version: $GCC_PKG_VERSION" - echo "installed version: $GCC_RUN_VERSION" + echo exit 1 fi # Check the compiler was build for the right machine GCC_TARGET=$($GCC -dumpmachine) if [ "$GCC_TARGET" != "$TARGET" ]; then - echo "Compiler doesn't have correct target!" + echo echo " package target: $TARGET" echo "installed target: $GCC_TARGET" + echo + echo "Compiler doesn't have correct target!" + echo exit 1 fi @@ -60,7 +68,8 @@ echo "Info about main.o" file main.o $TARGET-objdump -f ./main.o -if ! $TARGET-objdump -f ./main.o | grep -q 'architecture: lm32'; then +$TARGET-objdump -f ./main.o +if ! $TARGET-objdump -f ./main.o | grep -q "architecture: ${TOOLCHAIN_ARCH}"; then echo "Compiled binary output not correct architecture!" exit 1 fi diff --git a/lm32/gcc-newlib/build.sh b/lm32/gcc-newlib/build.sh deleted file mode 100644 index ce161224..00000000 --- a/lm32/gcc-newlib/build.sh +++ /dev/null @@ -1,95 +0,0 @@ -#!/bin/bash - -# lm32 gcc newlib build - -set -e - -if [ x"$TRAVIS" = xtrue ]; then - CPU_COUNT=2 - unset CFLAGS - unset CXXFLAGS - unset CPPFLAGS - unset DEBUG_CXXFLAGS - unset DEBUG_CPPFLAGS - unset LDFLAGS -fi - -TARGET=lm32-elf -GCC=$TARGET-newlib-gcc - -CONDA_PYTHON=$(conda info --root)/bin/python -${CONDA_PYTHON} ${RECIPE_DIR}/download-extra-sources.py - -# Check binutils -$TARGET-as --version - -# Check the "nostdc" gcc is already installed -GCC_STAGE1_VERSION=$($TARGET-gcc --version 2>&1 | head -1 | sed -e"s/$TARGET-gcc (GCC) //") -GCC_STAGE2_VERSION=$(echo $PKG_VERSION | sed -e's/-.*//') -if [ "$GCC_STAGE1_VERSION" != "$GCC_STAGE2_VERSION" ]; then - echo - echo "nostdc version: $GCC_STAGE1_VERSION" - echo " this version: $GCC_STAGE2_VERSION" - echo - echo "Stage 1 compiler (nostdc) not the same version as us!" - echo - exit 1 -fi - -set -x - -echo $PWD -rm -rf libstdc++-v3 -cd .. -ls -l - -mkdir -p build-newlib -cd build-newlib -../newlib*/configure \ - --prefix=$PREFIX \ - --target=$TARGET \ - --disable-newlib-supplied-syscalls \ - -make -j$CPU_COUNT -make install -cd .. - -mkdir -p build-gcc -cd build-gcc -#export LDFLAGS=-static -$SRC_DIR/configure \ - \ - --program-prefix=$TARGET-newlib- \ - \ - --prefix=$PREFIX \ - --with-gmp=$PREFIX \ - --with-mpfr=$PREFIX \ - --with-mpc=$PREFIX \ - --with-isl=$PREFIX \ - --with-cloog=$PREFIX \ - \ - --target=$TARGET \ - --enable-languages="c,c++" \ - --with-newlib \ - --enable-libgcc \ - - -make -j$CPU_COUNT -make install-strip - -# Install aliases for the binutil tools -for BINUTIL in $(ls $PREFIX/bin/$TARGET-* | grep /$TARGET-); do - NEWLIB_BINUTIL="$(echo $BINUTIL | sed -e"s_/$TARGET-_/$TARGET-newlib-_" -e's/newlib-newlib/newlib/')" - - if [ ! -e "$NEWLIB_BINUTIL" ]; then - ln -sv "$BINUTIL" "$NEWLIB_BINUTIL" - fi -done -ls -l $PREFIX/bin/$TARGET-newlib-* - -cd .. - -VERSION_DIR="$(echo $SRC_DIR | sed -e's-/work/.*-/work/-')" - -$PREFIX/bin/$GCC --version -echo $($PREFIX/bin/$GCC --version 2>&1 | head -1 | sed -e"s/$GCC (GCC) //") diff --git a/lm32/gcc-newlib/download-extra-sources.py b/lm32/gcc-newlib/download-extra-sources.py deleted file mode 120000 index 9f5f9824..00000000 --- a/lm32/gcc-newlib/download-extra-sources.py +++ /dev/null @@ -1 +0,0 @@ -../../conda-multisrc-example/download-extra-sources.py \ No newline at end of file diff --git a/lm32/gcc-newlib/meta.yaml b/lm32/gcc-newlib/meta.yaml deleted file mode 100644 index bddddbed..00000000 --- a/lm32/gcc-newlib/meta.yaml +++ /dev/null @@ -1,54 +0,0 @@ -package: - name: gcc-lm32-elf-newlib - version: 5.4.0 - -source: - fn: gcc-5.4.0.tar.bz2 - url: ftp://ftp.gnu.org/gnu/gcc/gcc-5.4.0/gcc-5.4.0.tar.bz2 - sha256: 608df76dec2d34de6558249d8af4cbee21eceddbcb580d666f7a5a583ca3303a - patches: - - stdint.patch - - reload1.patch - -extra: - sources: - newlib: - fn: newlib-2.5.0.20170228.tar.gz - url: ftp://sourceware.org/pub/newlib/newlib-2.5.0.20170228.tar.gz - sha256: 29923e9696b091dc2f880018e747c8cf282a557d2cdb60f760d9ec6a1f97337d - -build: - detect_binary_files_with_prefix: False - number: 1 - script_env: - - CI - - TRAVIS - -requirements: - build: - - gcc_linux-64 - - gxx_linux-64 - - libgcc-ng - # These are taken from the output of the configure scripts - - gmp >=4.3.2 - - mpfr >=2.4.2 - - mpc >=0.8.1 - - isl - - cloog - # Arch specific - - binutils-lm32-elf - - gcc-lm32-elf-nostdc - run: - - gmp >=4.3.2 - - mpfr >=2.4.2 - - mpc >=0.8.1 - - isl - - cloog - # Arch specific - - binutils-lm32-elf - - gcc-lm32-elf-nostdc - -about: - home: https://gcc.gnu.org/ - license: GPL - summary: 'The GNU Compiler Collection includes front ends for C, C++, Objective-C, Fortran, Java, Ada, and Go, as well as libraries for these languages (libstdc++, libgcj,...).' diff --git a/lm32/gcc-newlib/reload1.patch b/lm32/gcc-newlib/reload1.patch deleted file mode 100644 index f16ca2d0..00000000 --- a/lm32/gcc-newlib/reload1.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/gcc/reload1.c 2018-01-18 05:48:44.640984629 -0800 -+++ b/gcc/reload1.c 2018-01-18 05:50:14.951908013 -0800 -@@ -467,7 +467,7 @@ - - while (memory_address_p (QImode, tem)) - { -- spill_indirect_levels++; -+ spill_indirect_levels += 1; - tem = gen_rtx_MEM (Pmode, tem); - } - diff --git a/lm32/gcc-newlib/stdint.patch b/lm32/gcc-newlib/stdint.patch deleted file mode 120000 index 4e7bf926..00000000 --- a/lm32/gcc-newlib/stdint.patch +++ /dev/null @@ -1 +0,0 @@ -../gcc-nostdc/stdint.patch \ No newline at end of file diff --git a/lm32/gcc-nostdc/build.sh b/lm32/gcc-nostdc/build.sh deleted file mode 100644 index 828a1adb..00000000 --- a/lm32/gcc-nostdc/build.sh +++ /dev/null @@ -1,71 +0,0 @@ -#!/bin/bash - -# lm32 gcc bare metal build - -set -e - -if [ x"$TRAVIS" = xtrue ]; then - CPU_COUNT=2 - unset CFLAGS - unset CXXFLAGS - unset CPPFLAGS - unset DEBUG_CXXFLAGS - unset DEBUG_CPPFLAGS - unset LDFLAGS -fi - -TARGET=lm32-elf - -CONDA_PYTHON=$(conda info --root)/bin/python - -# Check binutils -$TARGET-as --version - - -set -x - -echo $PWD -rm -rf libstdc++-v3 -cd .. -ls -l - -mkdir -p build-gcc -cd build-gcc - -# --without-headers - Tells GCC not to rely on any C library (standard or runtime) being present for the target. -CFLAGS=-Wno-literal-suffix -#export LDFLAGS=-static -$SRC_DIR/configure \ - --prefix=$PREFIX \ - --with-gmp=$PREFIX \ - --with-mpfr=$PREFIX \ - --with-mpc=$PREFIX \ - --with-isl=$PREFIX \ - --with-cloog=$PREFIX \ - \ - --target=$TARGET \ - --without-headers \ - --enable-languages="c" \ - --enable-threads=single \ - \ - --disable-libatomic \ - --disable-libgcc \ - --disable-libgomp \ - --disable-libmudflap \ - --disable-libquadmath \ - --disable-libssp \ - --disable-multilib \ - --disable-nls \ - --disable-shared \ - --disable-tls \ - \ - - -make -j$CPU_COUNT -make install-strip -cd .. - -VERSION_DIR="$(echo $SRC_DIR | sed -e's-/work/.*-/work/-')" - -$PREFIX/bin/$TARGET-gcc --version -echo $($PREFIX/bin/$TARGET-gcc --version 2>&1 | head -1 | sed -e"s/$TARGET-gcc (GCC) //") diff --git a/lm32/gcc-nostdc/meta.yaml b/lm32/gcc-nostdc/meta.yaml deleted file mode 100644 index 7762c4e1..00000000 --- a/lm32/gcc-nostdc/meta.yaml +++ /dev/null @@ -1,45 +0,0 @@ -package: - name: gcc-lm32-elf-nostdc - version: 5.4.0 - -source: - fn: gcc-5.4.0.tar.bz2 - url: ftp://ftp.gnu.org/gnu/gcc/gcc-5.4.0/gcc-5.4.0.tar.bz2 - sha256: 608df76dec2d34de6558249d8af4cbee21eceddbcb580d666f7a5a583ca3303a - patches: - - stdint.patch - - reload1.patch - -build: - detect_binary_files_with_prefix: False - number: 1 - script_env: - - CI - - TRAVIS - -requirements: - build: - - gcc_linux-64 - - gxx_linux-64 - - libgcc-ng - # These are taken from the output of the configure scripts - - gmp >=4.3.2 - - mpfr >=2.4.2 - - mpc >=0.8.1 - - isl - - cloog - # Arch specific - - binutils-lm32-elf - run: - - gmp >=4.3.2 - - mpfr >=2.4.2 - - mpc >=0.8.1 - - isl - - cloog - # Arch specific - - binutils-lm32-elf - -about: - home: https://gcc.gnu.org/ - license: GPL - summary: 'The GNU Compiler Collection includes front ends for C, C++, Objective-C, Fortran, Java, Ada, and Go, as well as libraries for these languages (libstdc++, libgcj,...).' diff --git a/lm32/gcc-nostdc/reload1.patch b/lm32/gcc-nostdc/reload1.patch deleted file mode 100644 index f16ca2d0..00000000 --- a/lm32/gcc-nostdc/reload1.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/gcc/reload1.c 2018-01-18 05:48:44.640984629 -0800 -+++ b/gcc/reload1.c 2018-01-18 05:50:14.951908013 -0800 -@@ -467,7 +467,7 @@ - - while (memory_address_p (QImode, tem)) - { -- spill_indirect_levels++; -+ spill_indirect_levels += 1; - tem = gen_rtx_MEM (Pmode, tem); - } - diff --git a/or1k/gcc-newlib/build.sh b/or1k/gcc-newlib/build.sh deleted file mode 100644 index 3b870338..00000000 --- a/or1k/gcc-newlib/build.sh +++ /dev/null @@ -1,124 +0,0 @@ -#!/bin/bash - -# or1k gcc newlib build - -set -e - -if [ x"$TRAVIS" = xtrue ]; then - CPU_COUNT=2 - unset CFLAGS - unset CXXFLAGS - unset CPPFLAGS - unset DEBUG_CXXFLAGS - unset DEBUG_CPPFLAGS - unset LDFLAGS -fi - -TARGET=or1k-elf -GCC=$TARGET-newlib-gcc - -CONDA_PYTHON=$(conda info --root)/bin/python -${CONDA_PYTHON} ${RECIPE_DIR}/download-extra-sources.py - -set -x - -# Check binutils -$TARGET-as --version - -# Fetch upstream gcc so we can get a git-describe delta -echo $SRC_DIR -echo $PWD - -( - export GIT_DIR=$(${CONDA_PYTHON} ${RECIPE_DIR}/find-git-cache.py) - git remote -v - if ! git remote -v | grep -q upstream; then - git remote add upstream git://gcc.gnu.org/git/gcc.git - fi - git fetch upstream - git fetch upstream --tags -) - -git fetch -git fetch --tags - -set +x - -# Find our current or1k release -OR1K_RELEASE=$(git describe --abbrev=0 --match or1k-*-*) -echo " or1k release: '$OR1K_RELEASE'" -UPSTREAM_RELEASE=$(echo $OR1K_RELEASE | sed -e's/^or1k-/gcc-/' -e's/\./_/g' -e's/-[0-9]\+$/-release/') -echo "upstream release: '$UPSTREAM_RELEASE'" -GIT_REV=$(git describe --tags --long --match ${UPSTREAM_RELEASE} | sed -e"s/^${UPSTREAM_RELEASE}-//" -e's/-/_/') -echo " or1k git delta: '$GIT_REV'" - -# Check the "nostdc" gcc is already installed -GCC_STAGE1_VERSION=$($TARGET-gcc --version 2>&1 | head -1 | sed -e"s/$TARGET-gcc (GCC) //") -GCC_STAGE2_VERSION=$(echo $UPSTREAM_RELEASE | sed -e's/^gcc-//' -e's/_/./g' -e's/-.*//') -if [ "$GCC_STAGE1_VERSION" != "$GCC_STAGE2_VERSION" ]; then - echo - echo "nostdc version: $GCC_STAGE1_VERSION" - echo " this version: $GCC_STAGE2_VERSION" - echo - echo "Stage 1 compiler (nostdc) not the same version as us!" - echo - exit 1 -fi - -set -x - -echo $PWD -rm -rf libstdc++-v3 -cd .. -ls -l - -mkdir -p build-newlib -cd build-newlib -../newlib*/configure \ - --prefix=$PREFIX \ - --target=$TARGET \ - --disable-newlib-supplied-syscalls \ - -make -j$CPU_COUNT -make install -cd .. - -mkdir -p build-gcc -cd build-gcc -#export LDFLAGS=-static -$SRC_DIR/configure \ - \ - --program-prefix=$TARGET-newlib- \ - \ - --prefix=$PREFIX \ - --with-gmp=$PREFIX \ - --with-mpfr=$PREFIX \ - --with-mpc=$PREFIX \ - --with-isl=$PREFIX \ - --with-cloog=$PREFIX \ - \ - --target=$TARGET \ - --enable-languages="c,c++" \ - --with-newlib \ - --enable-libgcc \ - - -make -j$CPU_COUNT -make install-strip - -# Install aliases for the binutil tools -for BINUTIL in $(ls $PREFIX/bin/$TARGET-* | grep /$TARGET-); do - NEWLIB_BINUTIL="$(echo $BINUTIL | sed -e"s_/$TARGET-_/$TARGET-newlib-_" -e's/newlib-newlib/newlib/')" - - if [ ! -e "$NEWLIB_BINUTIL" ]; then - ln -sv "$BINUTIL" "$NEWLIB_BINUTIL" - fi -done -ls -l $PREFIX/bin/$TARGET-newlib-* - -cd .. - -VERSION_DIR="$(echo $SRC_DIR | sed -e's-/work/.*-/work/-')" - -$PREFIX/bin/$GCC --version -echo $($PREFIX/bin/$GCC --version 2>&1 | head -1 | sed -e's/.* //' -e"s/\$/_$GIT_REV/") diff --git a/or1k/gcc-newlib/download-extra-sources.py b/or1k/gcc-newlib/download-extra-sources.py deleted file mode 120000 index 9f5f9824..00000000 --- a/or1k/gcc-newlib/download-extra-sources.py +++ /dev/null @@ -1 +0,0 @@ -../../conda-multisrc-example/download-extra-sources.py \ No newline at end of file diff --git a/or1k/gcc-newlib/find-git-cache.py b/or1k/gcc-newlib/find-git-cache.py deleted file mode 120000 index 6ca5ca16..00000000 --- a/or1k/gcc-newlib/find-git-cache.py +++ /dev/null @@ -1 +0,0 @@ -../../conda-multisrc-example/find-git-cache.py \ No newline at end of file diff --git a/or1k/gcc-newlib/meta.yaml b/or1k/gcc-newlib/meta.yaml deleted file mode 100644 index 7b31f942..00000000 --- a/or1k/gcc-newlib/meta.yaml +++ /dev/null @@ -1,51 +0,0 @@ -package: - name: gcc-or1k-elf-newlib - version: git - -source: - git_url: https://github.com/openrisc/or1k-gcc.git - git_rev: or1k-5.4.0 - patches: - - reload1.patch - -extra: - sources: - newlib: - git_url: https://github.com/openrisc/newlib.git - git_rev: v2.4.0 - -build: - detect_binary_files_with_prefix: False - number: 1 - script_env: - - CI - - TRAVIS - -requirements: - build: - - gcc_linux-64 - - gxx_linux-64 - - libgcc-ng - # These are taken from the output of the configure scripts - - gmp >=4.3.2 - - mpfr >=2.4.2 - - mpc >=0.8.1 - - isl - - cloog - # Arch specific - - binutils-or1k-elf - - gcc-or1k-elf-nostdc - run: - - gmp >=4.3.2 - - mpfr >=2.4.2 - - mpc >=0.8.1 - - isl - - cloog - # Arch specific - - binutils-or1k-elf - - gcc-or1k-elf-nostdc - -about: - home: https://gcc.gnu.org/ - license: GPL - summary: 'The GNU Compiler Collection includes front ends for C, C++, Objective-C, Fortran, Java, Ada, and Go, as well as libraries for these languages (libstdc++, libgcj,...).' diff --git a/or1k/gcc-newlib/reload1.patch b/or1k/gcc-newlib/reload1.patch deleted file mode 100644 index f16ca2d0..00000000 --- a/or1k/gcc-newlib/reload1.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/gcc/reload1.c 2018-01-18 05:48:44.640984629 -0800 -+++ b/gcc/reload1.c 2018-01-18 05:50:14.951908013 -0800 -@@ -467,7 +467,7 @@ - - while (memory_address_p (QImode, tem)) - { -- spill_indirect_levels++; -+ spill_indirect_levels += 1; - tem = gen_rtx_MEM (Pmode, tem); - } - diff --git a/or1k/gcc-newlib/run_test.sh b/or1k/gcc-newlib/run_test.sh deleted file mode 100644 index 2a38cbf1..00000000 --- a/or1k/gcc-newlib/run_test.sh +++ /dev/null @@ -1,88 +0,0 @@ -#!/bin/bash - -# or1k gcc newlib run test - -set +x -set +e - -TARGET=or1k-elf -GCC=$TARGET-newlib-gcc -OBJDUMP=$TARGET-objdump - - -# Check the compiler version matches -GCC_PKG_VERSION=$(echo $PKG_VERSION | sed -e's/-.*//' -e"s/_.*$//") -GCC_RUN_VERSION=$($GCC --version 2>&1 | head -1 | sed -e"s/$GCC (GCC) //") - -if [ "$GCC_PKG_VERSION" != "$GCC_RUN_VERSION" ]; then - echo - echo " package version: $GCC_PKG_VERSION ($PKG_VERSION)" - echo "installed version: $GCC_RUN_VERSION ($($GCC --version 2>&1 | head -1))" - echo - echo "Compiler doesn't have correct version!" - echo - exit 1 -fi - -# Check the compiler was build for the right machine -GCC_TARGET=$($GCC -dumpmachine) -if [ "$GCC_TARGET" != "$TARGET" ]; then - echo - echo " package target: $TARGET" - echo "installed target: $GCC_TARGET" - echo - echo "Compiler doesn't have correct target!" - echo - exit 1 -fi - -# Check the compiler can build a simple C app which requires the standard -# library. - -echo "===========================================" - -echo "Compile and link a 'bare metal' binary with stdlib" - -cat > main.c < - -int main() { - puts("Hello world!\n"); -} -EOF -$GCC -g main.c -o main -Wl,-Map=output.map -SUCCESS=$? -if [ $SUCCESS -ne 0 ]; then - echo "Compiler didn't exit successfully." - exit 1 -fi - -if [ ! -e main ]; then - echo "Compiler didn't make a binary output file!" - exit 1 -fi - -file main -echo -echo "output.map" -echo "-------------------------------------------" -cat output.map \ - | sed -e's-[^ ]\+/bin/-[BIN]/-g' -e's-[^ ]\+/work/-[WORK]/-g' -echo "-------------------------------------------" -echo - -$TARGET-objdump -f ./main -if ! $TARGET-objdump -f ./main | grep -q 'architecture: or1k'; then - echo "Compiled binary output not correct architecture!" - exit 1 -fi - -$TARGET-objdump -g ./main 2>&1 \ - | grep DW_AT_name \ - | grep newlib \ - | sed -e's-[^ ]\+/bin/-[BIN]/-g' -e's-[^ ]\+/work/-[WORK]/-g' -SUCCESS=$? -if [ $SUCCESS -ne 0 ]; then - echo "Compiled binary not linked against newlib!" - exit 1 -fi diff --git a/or1k/gcc-nostdc/build.sh b/or1k/gcc-nostdc/build.sh deleted file mode 100644 index 517bc971..00000000 --- a/or1k/gcc-nostdc/build.sh +++ /dev/null @@ -1,96 +0,0 @@ -#!/bin/bash - -# or1k gcc bare metal build - -set -e - -if [ x"$TRAVIS" = xtrue ]; then - CPU_COUNT=2 - unset CFLAGS - unset CXXFLAGS - unset CPPFLAGS - unset DEBUG_CXXFLAGS - unset DEBUG_CPPFLAGS - unset LDFLAGS -fi - -TARGET=or1k-elf - -CONDA_PYTHON=$(conda info --root)/bin/python - -# Check binutils -$TARGET-as --version - -# Fetch upstream gcc so we can get a git-describe delta -echo $SRC_DIR -echo $PWD - -( - export GIT_DIR=$(${CONDA_PYTHON} ${RECIPE_DIR}/find-git-cache.py) - git remote -v - if ! git remote -v | grep -q upstream; then - git remote add upstream git://gcc.gnu.org/git/gcc.git - fi - git fetch upstream - git fetch upstream --tags -) - -git fetch -git fetch --tags - -set +x - -# Find our current or1k release -OR1K_RELEASE=$(git describe --abbrev=0 --match or1k-*-*) -echo " or1k release: '$OR1K_RELEASE'" -UPSTREAM_RELEASE=$(echo $OR1K_RELEASE | sed -e's/^or1k-/gcc-/' -e's/\./_/g' -e's/-[0-9]\+$/-release/') -echo "upstream release: '$UPSTREAM_RELEASE'" -GIT_REV=$(git describe --tags --long --match ${UPSTREAM_RELEASE} | sed -e"s/^${UPSTREAM_RELEASE}-//" -e's/-/_/') -echo " or1k git delta: '$GIT_REV'" - -set -x - -echo $PWD -rm -rf libstdc++-v3 -cd .. -ls -l - -mkdir -p build-gcc -cd build-gcc - -# --without-headers - Tells GCC not to rely on any C library (standard or runtime) being present for the target. -#export LDFLAGS=-static -$SRC_DIR/configure \ - --prefix=$PREFIX \ - --with-gmp=$PREFIX \ - --with-mpfr=$PREFIX \ - --with-mpc=$PREFIX \ - --with-isl=$PREFIX \ - --with-cloog=$PREFIX \ - \ - --target=$TARGET \ - --without-headers \ - --enable-languages="c" \ - --enable-threads=single \ - \ - --disable-libatomic \ - --disable-libgcc \ - --disable-libgomp \ - --disable-libmudflap \ - --disable-libquadmath \ - --disable-libssp \ - --disable-multilib \ - --disable-nls \ - --disable-shared \ - --disable-tls \ - \ - - -make -j$CPU_COUNT -make install-strip -cd .. - -VERSION_DIR="$(echo $SRC_DIR | sed -e's-/work/.*-/work/-')" - -$PREFIX/bin/$TARGET-gcc --version -echo $($PREFIX/bin/$TARGET-gcc --version 2>&1 | head -1 | sed -e"s/$TARGET-gcc (GCC) //" -e"s/\$/_$GIT_REV/") diff --git a/or1k/gcc-nostdc/find-git-cache.py b/or1k/gcc-nostdc/find-git-cache.py deleted file mode 120000 index 6ca5ca16..00000000 --- a/or1k/gcc-nostdc/find-git-cache.py +++ /dev/null @@ -1 +0,0 @@ -../../conda-multisrc-example/find-git-cache.py \ No newline at end of file diff --git a/or1k/gcc-nostdc/meta.yaml b/or1k/gcc-nostdc/meta.yaml deleted file mode 100644 index 51dc8eef..00000000 --- a/or1k/gcc-nostdc/meta.yaml +++ /dev/null @@ -1,43 +0,0 @@ -package: - name: gcc-or1k-elf-nostdc - version: git - -source: - git_url: https://github.com/openrisc/or1k-gcc.git - git_rev: or1k-5.4.0 - patches: - - reload1.patch - -build: - detect_binary_files_with_prefix: False - number: 1 - script_env: - - CI - - TRAVIS - -requirements: - build: - - gcc_linux-64 - - gxx_linux-64 - - libgcc-ng - # These are taken from the output of the configure scripts - - gmp >=4.3.2 - - mpfr >=2.4.2 - - mpc >=0.8.1 - - isl - - cloog - # Arch specific - - binutils-or1k-elf - run: - - gmp >=4.3.2 - - mpfr >=2.4.2 - - mpc >=0.8.1 - - isl - - cloog - # Arch specific - - binutils-or1k-elf - -about: - home: https://gcc.gnu.org/ - license: GPL - summary: 'The GNU Compiler Collection includes front ends for C, C++, Objective-C, Fortran, Java, Ada, and Go, as well as libraries for these languages (libstdc++, libgcj,...).' diff --git a/or1k/gcc-nostdc/reload1.patch b/or1k/gcc-nostdc/reload1.patch deleted file mode 100644 index f16ca2d0..00000000 --- a/or1k/gcc-nostdc/reload1.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/gcc/reload1.c 2018-01-18 05:48:44.640984629 -0800 -+++ b/gcc/reload1.c 2018-01-18 05:50:14.951908013 -0800 -@@ -467,7 +467,7 @@ - - while (memory_address_p (QImode, tem)) - { -- spill_indirect_levels++; -+ spill_indirect_levels += 1; - tem = gen_rtx_MEM (Pmode, tem); - } - diff --git a/or1k/gcc-nostdc/run_test.sh b/or1k/gcc-nostdc/run_test.sh deleted file mode 100644 index 246c7731..00000000 --- a/or1k/gcc-nostdc/run_test.sh +++ /dev/null @@ -1,145 +0,0 @@ -#!/bin/bash - -set +x -set +e - -TARGET=or1k-elf -GCC=$TARGET-gcc -OBJDUMP=$TARGET-objdump - - -# Check the compiler version matches -GCC_PKG_VERSION=$(echo $PKG_VERSION | sed -e's/_.*//') -GCC_RUN_VERSION=$($GCC --version 2>&1 | head -1 | sed -e"s/$GCC (GCC) //") - -if [ "$GCC_PKG_VERSION" != "$GCC_RUN_VERSION" ]; then - echo "Compiler doesn't have correct version!" - echo " package version: $GCC_PKG_VERSION" - echo "installed version: $GCC_RUN_VERSION" - exit 1 -fi - -# Check the compiler was build for the right machine -GCC_TARGET=$($GCC -dumpmachine) -if [ "$GCC_TARGET" != "$TARGET" ]; then - echo "Compiler doesn't have correct target!" - echo " package target: $TARGET" - echo "installed target: $GCC_TARGET" - exit 1 -fi - -# Check the compiler can build a simple C app which requires the standard -# library. - -echo "===========================================" - -echo "Compile and link a 'bare metal' binary" - -cat > main.c < main.ld < stdio1.c < -int main() { - puts("Hello world\n"); - return 0; -} -EOF - -echo "Compiling stdio1 (should fail!)" -$GCC -c stdio1.c -o stdio1.o -SUCCESS=$? -if [ $SUCCESS -eq 0 ]; then - echo "Compiler has standard library!" - exit 1 -fi - -echo "===========================================" - -echo "Don't include the header and try to link.." -cat > stdio2.c < stdio2.ld < Date: Tue, 18 Sep 2018 16:29:04 -0700 Subject: [PATCH 07/36] arachne-pnr: Only run simple tests. The full tests sometimes run travis out of memory. --- arachne-pnr/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arachne-pnr/build.sh b/arachne-pnr/build.sh index b0e72f1d..6afadf81 100644 --- a/arachne-pnr/build.sh +++ b/arachne-pnr/build.sh @@ -22,5 +22,5 @@ ls -l $ICEBOX echo "--------------------------------------" make V=1 -j$CPU_COUNT -make test +make simpletest make install From 00dc5c031ab496e89beebaaca115849ed262493c Mon Sep 17 00:00:00 2001 From: Tim 'mithro' Ansell Date: Tue, 18 Sep 2018 16:30:05 -0700 Subject: [PATCH 08/36] travis: Update to new TOOLCHAIN_ARCH method. --- .travis.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.travis.yml b/.travis.yml index a28de69e..a0f914cb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -36,19 +36,19 @@ install: env: # lm32 toolchain - - PACKAGE=lm32/binutils CONDA_BUILD_VERSION=2.1.17 - - PACKAGE=lm32/gcc-nostdc CONDA_BUILD_VERSION=2.1.17 - - PACKAGE=lm32/gcc-newlib CONDA_BUILD_VERSION=2.1.17 - - PACKAGE=lm32/gdb CONDA_BUILD_VERSION=2.1.17 + - PACKAGE=binutils TOOLCHAIN_ARCH=lm32 + - PACKAGE=gcc/nostdc TOOLCHAIN_ARCH=lm32 + - PACKAGE=gcc/newlib TOOLCHAIN_ARCH=lm32 + - PACKAGE=gdb TOOLCHAIN_ARCH=lm32 # or1k toolchain - - PACKAGE=or1k/binutils CONDA_BUILD_VERSION=2.1.17 - - PACKAGE=or1k/gcc-nostdc CONDA_BUILD_VERSION=2.1.17 - - PACKAGE=or1k/gcc-newlib CONDA_BUILD_VERSION=2.1.17 - - PACKAGE=or1k/gdb CONDA_BUILD_VERSION=2.1.17 + - PACKAGE=binutils TOOLCHAIN_ARCH=or1k + - PACKAGE=gcc/nostdc TOOLCHAIN_ARCH=or1k + - PACKAGE=gcc/newlib TOOLCHAIN_ARCH=or1k + - PACKAGE=gdb TOOLCHAIN_ARCH=or1k # riscv32 toolchain - - PACKAGE=riscv32/binutils CONDA_BUILD_VERSION=2.1.17 + - PACKAGE=binutils TOOLCHAIN_ARCH=riscv32 # sh2 toolchain - - PACKAGE=sh2/binutils CONDA_BUILD_VERSION=2.1.17 + - PACKAGE=binutils TOOLCHAIN_ARCH=sh2 # fx2 toolchain - PACKAGE=sdcc CONDA_BUILD_VERSION=2.1.17 # tools From e8e31d215476f7ad3f129c2a4a41528d44aa4db1 Mon Sep 17 00:00:00 2001 From: Tim 'mithro' Ansell Date: Tue, 18 Sep 2018 16:30:21 -0700 Subject: [PATCH 09/36] travis: Make output even less verbose. --- .travis-output.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.travis-output.py b/.travis-output.py index 17a3ff21..b9c47bfc 100755 --- a/.travis-output.py +++ b/.travis-output.py @@ -27,6 +27,12 @@ def output_line(line_bits, last_skip): skip = True if "setting rpath" in sline: skip = True + if "fprintf" in sline: + skip = True + if " from " in sline: + skip = True + if "if (" in sline: + skip = True if "Entering directory" in sline: skip = False From eeb606ca55bc0ff1a781569c2c769bb8f42a41bd Mon Sep 17 00:00:00 2001 From: Tim 'mithro' Ansell Date: Tue, 18 Sep 2018 16:33:26 -0700 Subject: [PATCH 10/36] sdcc: Move to new template system. --- .travis.yml | 2 +- sdcc/build.sh | 5 ----- sdcc/meta.yaml | 9 ++++++++- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index a0f914cb..f3c6449e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -50,7 +50,7 @@ env: # sh2 toolchain - PACKAGE=binutils TOOLCHAIN_ARCH=sh2 # fx2 toolchain - - PACKAGE=sdcc CONDA_BUILD_VERSION=2.1.17 + - PACKAGE=sdcc # tools - PACKAGE=openocd CONDA_BUILD_VERSION=2.1.17 - PACKAGE=flterm CONDA_BUILD_VERSION=2.1.17 diff --git a/sdcc/build.sh b/sdcc/build.sh index aa33e017..3232f513 100644 --- a/sdcc/build.sh +++ b/sdcc/build.sh @@ -18,8 +18,3 @@ CXXFLAGS=-I$PREFIX/include \ make -j$CPU_COUNT make install - -sdcc --version | head -1 | sed -e's/SDCC : [^ ]\+ \([0-9.]\+\) #\([0-9]\+\) .*/\1.\2/' > ../__conda_version__.txt -touch .buildstamp -TZ=UTC date +%Y%m%d_%H%M%S -r .buildstamp > ../__conda_buildstr__.txt -TZ=UTC date +%Y%m%d%H%M%S -r .buildstamp > ../__conda_buildnum__.txt diff --git a/sdcc/meta.yaml b/sdcc/meta.yaml index 94933775..bdb5bad1 100644 --- a/sdcc/meta.yaml +++ b/sdcc/meta.yaml @@ -8,7 +8,14 @@ source: sha256: e85dceb11e01ffefb545ec389da91265130c91953589392dddd2e5ec0b7ca374 build: - number: 0 + # z==DATESTR + # + # number: 1803050325 + # zzzzzzzzzz + number: {{ environ.get('DATESTR') }} + # string: 0693.1803050325.g588ce0e3 + # yyyy.zzzzzzzzzz.gxxxxxxxx + string: {{ environ.get('DATESTR') }} script_env: - CI - TRAVIS From 8d0a08f98c23900ddcd751b85d0bcab42f278ebf Mon Sep 17 00:00:00 2001 From: Tim 'mithro' Ansell Date: Tue, 18 Sep 2018 16:34:46 -0700 Subject: [PATCH 11/36] openocd: Move to new template method. --- .travis.yml | 2 +- openocd/build.sh | 5 ----- openocd/meta.yaml | 11 +++++++++-- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index f3c6449e..5e4c64e2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -52,7 +52,7 @@ env: # fx2 toolchain - PACKAGE=sdcc # tools - - PACKAGE=openocd CONDA_BUILD_VERSION=2.1.17 + - PACKAGE=openocd - PACKAGE=flterm CONDA_BUILD_VERSION=2.1.17 # verilog tools - PACKAGE=arachne-pnr diff --git a/openocd/build.sh b/openocd/build.sh index 60cf9637..f8de3c90 100644 --- a/openocd/build.sh +++ b/openocd/build.sh @@ -45,8 +45,3 @@ ls -l ./src/openocd du -h ./src/openocd make install - -./src/openocd --version -./src/openocd --version 2>&1 | head -1 | sed -e's/+dev-[0]\+/_/' -e's/-/_/g' -e's/.* 0\./0./' -e's/ .*//' -e's/_dirty//' > ../__conda_version__.txt -./src/openocd --version 2>&1 | head -1 | sed -e's/[^(]*(//' -e's/)//' -e's/://g' -e's/-//g' -es'/[0-9][0-9][0-9][0-9]$/_\0/' > ../__conda_buildstr__.txt -TZ=UTC date +%Y%m%d%H%M%S > ../__conda_buildnum__.txt diff --git a/openocd/meta.yaml b/openocd/meta.yaml index b9ee9f28..f5afb9cf 100644 --- a/openocd/meta.yaml +++ b/openocd/meta.yaml @@ -1,6 +1,6 @@ package: name: openocd - version: git + version: {{ GIT_DESCRIBE_TAG }} source: git_rev: master @@ -18,7 +18,14 @@ source: - spartan7-idcodes.patch build: - number: 0 + # y==GIT_DESCRIBE_NUMBER, z==DATESTR, x==GIT_DESCRIBE_HASH + # + # number: 10693001803050325 + # 1yyyy00zzzzzzzzzz + number: {{ '1%04i00%s'|format(environ.get('GIT_DESCRIBE_NUMBER')|int, environ.get('DATESTR')) }} + # string: 0693.1803050325.g588ce0e3 + # yyyy.zzzzzzzzzz.gxxxxxxxx + string: {{ '%04i'|format(environ.get('GIT_DESCRIBE_NUMBER')|int) }}.{{ environ.get('DATESTR') }}.{{ environ.get('GIT_DESCRIBE_HASH', 'unknown') }} script_env: - CI - TRAVIS From f5b45eb2f24a92664b853aa1c6c2ebad8b20e0bc Mon Sep 17 00:00:00 2001 From: Tim 'mithro' Ansell Date: Tue, 18 Sep 2018 16:35:25 -0700 Subject: [PATCH 12/36] flterm: Convert to new template method. --- .travis.yml | 2 +- flterm/build.sh | 5 ----- flterm/meta.yaml | 11 +++++++++-- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index 5e4c64e2..331957d3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -53,7 +53,7 @@ env: - PACKAGE=sdcc # tools - PACKAGE=openocd - - PACKAGE=flterm CONDA_BUILD_VERSION=2.1.17 + - PACKAGE=flterm # verilog tools - PACKAGE=arachne-pnr - PACKAGE=icestorm diff --git a/flterm/build.sh b/flterm/build.sh index 96fb1935..04537cc9 100644 --- a/flterm/build.sh +++ b/flterm/build.sh @@ -9,8 +9,3 @@ set -e make CC="gcc -I." make PREFIX=$PREFIX install - -git describe | sed -e's/-/_/g' -e's/^v//' > ./__conda_version__.txt -touch .buildstamp -TZ=UTC date +%Y%m%d_%H%M%S -r .buildstamp > ../__conda_buildstr__.txt -TZ=UTC date +%Y%m%d%H%M%S -r .buildstamp > ../__conda_buildnum__.txt diff --git a/flterm/meta.yaml b/flterm/meta.yaml index 4163880c..3cb48ad9 100644 --- a/flterm/meta.yaml +++ b/flterm/meta.yaml @@ -1,12 +1,19 @@ package: name: flterm - version: git + version: {{ GIT_DESCRIBE_TAG }} source: git_url: https://github.com/timvideos/flterm.git build: - number: 0 + # y==GIT_DESCRIBE_NUMBER, z==DATESTR, x==GIT_DESCRIBE_HASH + # + # number: 10693001803050325 + # 1yyyy00zzzzzzzzzz + number: {{ '1%04i00%s'|format(environ.get('GIT_DESCRIBE_NUMBER')|int, environ.get('DATESTR')) }} + # string: 0693.1803050325.g588ce0e3 + # yyyy.zzzzzzzzzz.gxxxxxxxx + string: {{ '%04i'|format(environ.get('GIT_DESCRIBE_NUMBER')|int) }}.{{ environ.get('DATESTR') }}.{{ environ.get('GIT_DESCRIBE_HASH', 'unknown') }} script_env: - CI - TRAVIS From f3e2dce225640952d0a98f87e62a4a541274757d Mon Sep 17 00:00:00 2001 From: Tim 'mithro' Ansell Date: Tue, 18 Sep 2018 16:36:19 -0700 Subject: [PATCH 13/36] verilator: Move to new template method. --- .travis.yml | 2 +- verilator/build.sh | 5 ----- verilator/meta.yaml | 11 +++++++++-- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index 331957d3..ed420a92 100644 --- a/.travis.yml +++ b/.travis.yml @@ -59,7 +59,7 @@ env: - PACKAGE=icestorm - PACKAGE=iverilog - PACKAGE=nextpnr - - PACKAGE=verilator CONDA_BUILD_VERSION=2.1.17 + - PACKAGE=verilator - PACKAGE=vtr CONDA_CHANNELS=conda-forge - PACKAGE=yosys diff --git a/verilator/build.sh b/verilator/build.sh index 582e4e36..77e826e2 100644 --- a/verilator/build.sh +++ b/verilator/build.sh @@ -15,8 +15,3 @@ autoconf make make install - -git describe | sed -e's/-/_/g' -e's/^verilator_3_/3./' > ./__conda_version__.txt -touch .buildstamp -TZ=UTC date +%Y%m%d_%H%M%S -r .buildstamp > ../__conda_buildstr__.txt -TZ=UTC date +%Y%m%d%H%M%S -r .buildstamp > ../__conda_buildnum__.txt diff --git a/verilator/meta.yaml b/verilator/meta.yaml index a1f1f0fc..c496bf71 100644 --- a/verilator/meta.yaml +++ b/verilator/meta.yaml @@ -1,6 +1,6 @@ package: name: verilator - version: git + version: {{ GIT_DESCRIBE_TAG }} source: git_rev: master @@ -8,7 +8,14 @@ source: build: detect_binary_files_with_prefix: True - number: 1 + # y==GIT_DESCRIBE_NUMBER, z==DATESTR, x==GIT_DESCRIBE_HASH + # + # number: 10693001803050325 + # 1yyyy00zzzzzzzzzz + number: {{ '1%04i00%s'|format(environ.get('GIT_DESCRIBE_NUMBER')|int, environ.get('DATESTR')) }} + # string: 0693.1803050325.g588ce0e3 + # yyyy.zzzzzzzzzz.gxxxxxxxx + string: {{ '%04i'|format(environ.get('GIT_DESCRIBE_NUMBER')|int) }}.{{ environ.get('DATESTR') }}.{{ environ.get('GIT_DESCRIBE_HASH', 'unknown') }} script_env: - CI - TRAVIS From ae42778b9b413729487e50f9c5f8eeda184935bd Mon Sep 17 00:00:00 2001 From: Tim 'mithro' Ansell Date: Tue, 18 Sep 2018 17:45:35 -0700 Subject: [PATCH 14/36] arachne-pnr: Use the conda compiler. --- arachne-pnr/meta.yaml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/arachne-pnr/meta.yaml b/arachne-pnr/meta.yaml index ce949d6d..8f93304c 100644 --- a/arachne-pnr/meta.yaml +++ b/arachne-pnr/meta.yaml @@ -15,10 +15,10 @@ build: requirements: build: + - {{ compiler('c') }} + - {{ compiler('cxx') }} - bison - flex - - gcc_linux-64 - - gxx_linux-64 - icestorm - iverilog - libffi @@ -29,11 +29,12 @@ requirements: - yosys run: - icestorm - - readline - - bison - - tk - - libffi - - flex + {% for package in resolved_packages('host') %} + - {{ package }} + {% endfor %} + {% for package in resolved_packages('build') %} + - {{ package }} + {% endfor %} about: home: http://www.clifford.at/arachne-pnr/ From df7309d7cdbf3d0d479f85e866f469241ccfbdba Mon Sep 17 00:00:00 2001 From: Tim 'mithro' Ansell Date: Tue, 18 Sep 2018 17:47:33 -0700 Subject: [PATCH 15/36] flterm: Use conda compiler. --- flterm/meta.yaml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/flterm/meta.yaml b/flterm/meta.yaml index 3cb48ad9..123ca4ea 100644 --- a/flterm/meta.yaml +++ b/flterm/meta.yaml @@ -18,6 +18,18 @@ build: - CI - TRAVIS +requirements: + build: + - {{ compiler('c') }} + - {{ compiler('cxx') }} + run: + {% for package in resolved_packages('host') %} + - {{ package }} + {% endfor %} + {% for package in resolved_packages('build') %} + - {{ package }} + {% endfor %} + test: commands: - flterm --help From 7002f41b6f5bc6cb7b2d55e1e6c6dfdf9d6228a7 Mon Sep 17 00:00:00 2001 From: Tim 'mithro' Ansell Date: Tue, 18 Sep 2018 17:54:49 -0700 Subject: [PATCH 16/36] sdcc: Use conda compiler. --- sdcc/meta.yaml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/sdcc/meta.yaml b/sdcc/meta.yaml index bdb5bad1..c65d9f51 100644 --- a/sdcc/meta.yaml +++ b/sdcc/meta.yaml @@ -22,11 +22,19 @@ build: requirements: build: + - {{ compiler('c') }} + - {{ compiler('cxx') }} + host: - ncurses - boost run: - - ncurses - - boost + - libboost + {% for package in resolved_packages('host') %} + - {{ package }} + {% endfor %} + {% for package in resolved_packages('build') %} + - {{ package }} + {% endfor %} about: home: http://sdcc.sourceforge.net/ From bec4733a2dbf3c2e89a5ffb8b92ea98f8ca752ec Mon Sep 17 00:00:00 2001 From: Tim 'mithro' Ansell Date: Tue, 18 Sep 2018 18:08:32 -0700 Subject: [PATCH 17/36] verilator: Use conda compiler. --- verilator/build.sh | 2 +- verilator/meta.yaml | 17 ++++++++++++++++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/verilator/build.sh b/verilator/build.sh index 77e826e2..41594104 100644 --- a/verilator/build.sh +++ b/verilator/build.sh @@ -13,5 +13,5 @@ autoconf ./configure \ --prefix=$PREFIX \ -make +make -j$CPU_COUNT make install diff --git a/verilator/meta.yaml b/verilator/meta.yaml index c496bf71..72255aa3 100644 --- a/verilator/meta.yaml +++ b/verilator/meta.yaml @@ -4,7 +4,7 @@ package: source: git_rev: master - git_url: http://git.veripool.org/git/verilator + git_url: http://git.veripool.org/git/verilator build: detect_binary_files_with_prefix: True @@ -20,6 +20,21 @@ build: - CI - TRAVIS +requirements: + build: + - {{ compiler('c') }} + - {{ compiler('cxx') }} + host: + - bison + - flex + run: + {% for package in resolved_packages('host') %} + - {{ package }} + {% endfor %} + {% for package in resolved_packages('build') %} + - {{ package }} + {% endfor %} + test: commands: From 8a247d7a00448a6f153d30984f4645c154940287 Mon Sep 17 00:00:00 2001 From: Tim 'mithro' Ansell Date: Tue, 18 Sep 2018 18:15:08 -0700 Subject: [PATCH 18/36] iverilog: Use conda compiler. --- iverilog/meta.yaml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/iverilog/meta.yaml b/iverilog/meta.yaml index bc861e51..04b440c1 100644 --- a/iverilog/meta.yaml +++ b/iverilog/meta.yaml @@ -18,11 +18,16 @@ build: requirements: build: - readline - - gcc_linux-64 - - gxx_linux-64 + - {{ compiler('c') }} + - {{ compiler('cxx') }} - gperf run: - - readline + {% for package in resolved_packages('host') %} + - {{ package }} + {% endfor %} + {% for package in resolved_packages('build') %} + - {{ package }} + {% endfor %} test: files: @@ -37,8 +42,3 @@ about: license: GPLv2 license_file: COPYING summary: 'Icarus Verilog (iverilog) is a Verilog simulation and synthesis tool. It operates as a compiler, compiling source code written in Verilog (IEEE-1364) into some target format. For batch simulation, the compiler can generate an intermediate form called vvp assembly. This intermediate form is executed by the ``vvp'' command. For synthesis, the compiler generates netlists in the desired format.' - -extra: - maintainers: - - Tim 'mithro' Ansell - - HDMI2USB Project - https://hdmi2usb.tv From 50a2c04a410c0c0e653713f25a5975076f5c123e Mon Sep 17 00:00:00 2001 From: Tim 'mithro' Ansell Date: Tue, 18 Sep 2018 18:17:08 -0700 Subject: [PATCH 19/36] travis: Disable caching. Currently travis runs out of disk space on or1k builds. --- .travis.yml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index ed420a92..bb53d4a5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,13 +1,5 @@ language: c -cache: - ccache: true - directories: - - /tmp/really-really-really-really-really-really-really-really-really-really-really-really-really-long-path/conda/conda-bld/git_cache - - /tmp/really-really-really-really-really-really-really-really-really-really-really-really-really-long-path/conda/conda-bld/src_cache -before_cache: - - ./.travis/before_cache.sh - #dist: trusty sudo: false addons: From d1afcd06bf9f7a2e10d36344d993faa81b1fbd41 Mon Sep 17 00:00:00 2001 From: Tim 'mithro' Ansell Date: Tue, 18 Sep 2018 18:32:57 -0700 Subject: [PATCH 20/36] gcc: Extract the pkg-version version. --- gcc/newlib/run_test.sh | 2 +- gcc/nostdc/run_test.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gcc/newlib/run_test.sh b/gcc/newlib/run_test.sh index a5583595..1574b0af 100644 --- a/gcc/newlib/run_test.sh +++ b/gcc/newlib/run_test.sh @@ -12,7 +12,7 @@ OBJDUMP=$TARGET-objdump # Check the compiler version matches GCC_PKG_VERSION=$(echo $PKG_VERSION | sed -e's/-.*//') -GCC_RUN_VERSION=$($GCC --version 2>&1 | head -1 | sed -e"s/$GCC (GCC) //") +GCC_RUN_VERSION=$($GCC --version 2>&1 | head -1 | sed -e"s/$GCC (//" -e"s/).*//") if [ "$GCC_PKG_VERSION" != "$GCC_RUN_VERSION" ]; then echo diff --git a/gcc/nostdc/run_test.sh b/gcc/nostdc/run_test.sh index 3be01711..64ab41a0 100644 --- a/gcc/nostdc/run_test.sh +++ b/gcc/nostdc/run_test.sh @@ -12,7 +12,7 @@ OBJDUMP=$TARGET-objdump # Check the compiler version matches GCC_PKG_VERSION=$(echo $PKG_VERSION | sed -e's/-.*//') -GCC_RUN_VERSION=$($GCC --version 2>&1 | head -1 | sed -e"s/$GCC (GCC) //") +GCC_RUN_VERSION=$($GCC --version 2>&1 | head -1 | sed -e"s/$GCC (//" -e"s/).*//") if [ "$GCC_PKG_VERSION" != "$GCC_RUN_VERSION" ]; then echo From cb05c30288488512ca148d5c27ec42761522435b Mon Sep 17 00:00:00 2001 From: Tim 'mithro' Ansell Date: Tue, 18 Sep 2018 18:26:13 -0700 Subject: [PATCH 21/36] gcc/nostdc: Cleanup git repository after git version. --- gcc/nostdc/prescript.or1k.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gcc/nostdc/prescript.or1k.sh b/gcc/nostdc/prescript.or1k.sh index fc8795ce..d0ec2662 100755 --- a/gcc/nostdc/prescript.or1k.sh +++ b/gcc/nostdc/prescript.or1k.sh @@ -51,4 +51,9 @@ echo "gcc_git_rev: $GCC_GIT_REV" >> $EXTRA_YAML_FILE more $EXTRA_YAML_FILE +echo "-------------------" +du -h . +echo "-------------------" + + popd >/dev/null From 2c3760d0f73a055be2466471ed48c04d582142bf Mon Sep 17 00:00:00 2001 From: Tim 'mithro' Ansell Date: Tue, 18 Sep 2018 21:47:25 -0700 Subject: [PATCH 22/36] gcc: Dump more information about the compiler. --- gcc/newlib/run_test.sh | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/gcc/newlib/run_test.sh b/gcc/newlib/run_test.sh index 1574b0af..1ff1f6da 100644 --- a/gcc/newlib/run_test.sh +++ b/gcc/newlib/run_test.sh @@ -38,7 +38,20 @@ fi # Check the compiler can build a simple C app which requires the standard # library. - +echo "===========================================" +$GCC --version +$GCC --target-help +$GCC -dumpspecs +$GCC -dumpversion +$GCC -dumpmachine +$GCC -print-search-dirs +$GCC -print-libgcc-file-name +$GCC -print-multiarch +$GCC -print-multi-directory +$GCC -print-multi-lib +$GCC -print-multi-os-directory +$GCC -print-sysroot +$GCC -print-sysroot-headers-suffix echo "===========================================" echo "Compile and link a 'bare metal' binary with stdlib" From 7fa57ca7e8a712631b02b4ded0517b12a69731ce Mon Sep 17 00:00:00 2001 From: Tim 'mithro' Ansell Date: Wed, 19 Sep 2018 10:32:27 -0700 Subject: [PATCH 23/36] binutils/gcc-newlib: Enable sysroot. --- binutils/build.sh | 5 +++++ gcc/newlib/build.sh | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/binutils/build.sh b/binutils/build.sh index c1645207..48df4848 100644 --- a/binutils/build.sh +++ b/binutils/build.sh @@ -17,7 +17,12 @@ mkdir build cd build ../configure \ --target=${TOOLCHAIN_ARCH}-elf \ + \ --prefix=$PREFIX \ + \ + --with-sysroot \ + --disable-nls \ + --disable-werror \ --enable-deterministic-archives \ make -j$CPU_COUNT diff --git a/gcc/newlib/build.sh b/gcc/newlib/build.sh index 7b644029..236be86f 100644 --- a/gcc/newlib/build.sh +++ b/gcc/newlib/build.sh @@ -91,7 +91,7 @@ cd .. mkdir -p build-newlib cd build-newlib $SRC_DIR/newlib/configure \ - --prefix=$PREFIX \ + --prefix=$PREFIX/$TARGET/sysroot \ --target=$TARGET \ --disable-newlib-supplied-syscalls \ @@ -108,6 +108,7 @@ $SRC_DIR/gcc/configure \ --program-prefix=$TARGET-newlib- \ \ --prefix=$PREFIX \ + --with-sysroot=$PREFIX/$TARGET/sysroot \ \ --with-gmp=$CONDA_PREFIX \ --with-mpfr=$CONDA_PREFIX \ From d6f9b915088c8d295ee2fe079ca10262c81ecc58 Mon Sep 17 00:00:00 2001 From: Tim 'mithro' Ansell Date: Wed, 19 Sep 2018 21:25:42 -0700 Subject: [PATCH 24/36] gcc: More attempts at making newlib work. --- binutils/build.sh | 5 ++--- gcc/newlib/build.sh | 28 +++++++++++++++++++++------- gcc/newlib/run_test.sh | 1 + gcc/nostdc/build.sh | 13 +++++++++---- gcc/nostdc/run_test.sh | 16 ++++++++++++++++ 5 files changed, 49 insertions(+), 14 deletions(-) diff --git a/binutils/build.sh b/binutils/build.sh index 48df4848..72abd0b7 100644 --- a/binutils/build.sh +++ b/binutils/build.sh @@ -18,12 +18,11 @@ cd build ../configure \ --target=${TOOLCHAIN_ARCH}-elf \ \ - --prefix=$PREFIX \ + --prefix=/ \ \ - --with-sysroot \ --disable-nls \ --disable-werror \ --enable-deterministic-archives \ make -j$CPU_COUNT -make install-strip +make DESTDIR=${PREFIX} install-strip diff --git a/gcc/newlib/build.sh b/gcc/newlib/build.sh index 236be86f..c74a310a 100644 --- a/gcc/newlib/build.sh +++ b/gcc/newlib/build.sh @@ -91,12 +91,16 @@ cd .. mkdir -p build-newlib cd build-newlib $SRC_DIR/newlib/configure \ - --prefix=$PREFIX/$TARGET/sysroot \ + --prefix=/usr \ + \ --target=$TARGET \ --disable-newlib-supplied-syscalls \ + \ + --enable-multilib \ + \ make -j$CPU_COUNT -make install +make DESTDIR=$PREFIX/$TARGET/sysroot install cd .. mkdir -p build-gcc @@ -108,7 +112,6 @@ $SRC_DIR/gcc/configure \ --program-prefix=$TARGET-newlib- \ \ --prefix=$PREFIX \ - --with-sysroot=$PREFIX/$TARGET/sysroot \ \ --with-gmp=$CONDA_PREFIX \ --with-mpfr=$CONDA_PREFIX \ @@ -118,16 +121,27 @@ $SRC_DIR/gcc/configure \ \ --target=$TARGET \ --with-pkgversion=$PKG_VERSION \ - --enable-languages="c,c++" \ + --enable-languages="c" \ + --enable-threads=single \ + --enable-multilib \ + \ --with-newlib \ - --enable-libgcc \ \ --disable-nls \ - + --disable-libatomic \ + --enable-libgcc \ + --disable-libgomp \ + --disable-libmudflap \ + --disable-libquadmath \ + --disable-libssp \ + --disable-nls \ + --disable-shared \ + --disable-tls \ + \ make -j$CPU_COUNT -make install-strip +make DESTDIR=$PREFIX install-strip # Install aliases for the binutil tools for BINUTIL in $(ls $PREFIX/bin/$TARGET-* | grep /$TARGET-); do diff --git a/gcc/newlib/run_test.sh b/gcc/newlib/run_test.sh index 1ff1f6da..4a308243 100644 --- a/gcc/newlib/run_test.sh +++ b/gcc/newlib/run_test.sh @@ -39,6 +39,7 @@ fi # Check the compiler can build a simple C app which requires the standard # library. echo "===========================================" +set -x $GCC --version $GCC --target-help $GCC -dumpspecs diff --git a/gcc/nostdc/build.sh b/gcc/nostdc/build.sh index ad1e2e4a..5ae43b1b 100644 --- a/gcc/nostdc/build.sh +++ b/gcc/nostdc/build.sh @@ -68,8 +68,12 @@ cd build-gcc # --without-headers - Tells GCC not to rely on any C library (standard or runtime) being present for the target. #CFLAGS="$CFLAGS -Wno-literal-suffix" #export LDFLAGS=-static +mkdir -p $PREFIX/$TARGET/sysroot/usr/include + $SRC_DIR/gcc/configure \ - --prefix=$PREFIX \ + \ + --prefix=/ \ + --with-sysroot=$PREFIX/$TARGET/sysroot \ \ --with-gmp=$CONDA_PREFIX \ --with-mpfr=$CONDA_PREFIX \ @@ -79,9 +83,11 @@ $SRC_DIR/gcc/configure \ \ --target=$TARGET \ --with-pkgversion=$PKG_VERSION \ - --without-headers \ --enable-languages="c" \ --enable-threads=single \ + --enable-multilib \ + \ + --without-headers \ \ --disable-nls \ --disable-libatomic \ @@ -90,7 +96,6 @@ $SRC_DIR/gcc/configure \ --disable-libmudflap \ --disable-libquadmath \ --disable-libssp \ - --disable-multilib \ --disable-nls \ --disable-shared \ --disable-tls \ @@ -98,7 +103,7 @@ $SRC_DIR/gcc/configure \ make -j$CPU_COUNT -make install-strip +make DESTDIR=$PREFIX install-strip cd .. VERSION_DIR="$(echo $SRC_DIR | sed -e's-/work/.*-/work/-')" diff --git a/gcc/nostdc/run_test.sh b/gcc/nostdc/run_test.sh index 64ab41a0..e8cea11c 100644 --- a/gcc/nostdc/run_test.sh +++ b/gcc/nostdc/run_test.sh @@ -38,6 +38,22 @@ fi # Check the compiler can build a simple C app which requires the standard # library. +echo "===========================================" +set -x +$GCC --version +$GCC --target-help +$GCC -dumpspecs +$GCC -dumpversion +$GCC -dumpmachine +$GCC -print-search-dirs +$GCC -print-libgcc-file-name +$GCC -print-multiarch +$GCC -print-multi-directory +$GCC -print-multi-lib +$GCC -print-multi-os-directory +$GCC -print-sysroot +$GCC -print-sysroot-headers-suffix +echo "===========================================" echo "===========================================" From 73ed8b4498c5bb71b086c7a2bd350341613fff7e Mon Sep 17 00:00:00 2001 From: Tim 'mithro' Ansell Date: Fri, 21 Sep 2018 06:33:19 -0700 Subject: [PATCH 25/36] all: s/DATESTR/DATE_STR+DATE_NUM/ --- .travis/common.sh | 13 +++++-------- arachne-pnr/meta.yaml | 10 ++++++++-- conda-env.sh | 13 +++++-------- flterm/meta.yaml | 10 +++++----- gcc/newlib/meta.yaml | 18 ++++++++---------- gcc/nostdc/meta.yaml | 18 ++++++++---------- iceprog/meta.yaml | 10 ++++++++-- icestorm/meta.yaml | 10 +++++----- iverilog/meta.yaml | 10 ++++++++-- nextpnr/meta.yaml | 10 +++++----- openocd/meta.yaml | 10 +++++----- sdcc/meta.yaml | 8 +++----- verilator/meta.yaml | 10 +++++----- vtr/meta.yaml | 10 +++++----- yosys/meta.yaml | 10 +++++----- 15 files changed, 88 insertions(+), 82 deletions(-) diff --git a/.travis/common.sh b/.travis/common.sh index 1ee9b81e..89c33885 100644 --- a/.travis/common.sh +++ b/.travis/common.sh @@ -13,14 +13,11 @@ export -f travis_nanoseconds export -f travis_fold export -f travis_time_start export -f travis_time_finish -if [ -z "$DATESTR" ]; then - if [ x"$CONDA_BUILD_VERSION" = x"2.1.17" ]; then - export DATESTR="$(date -u +%Y%m%d%H%M%S)" - echo "Setting long date string of $DATESTR" - else - export DATESTR="$(date -u +%y%m%d%H%M)" - echo "Setting short date string of $DATESTR" - fi +if [ -z "$DATE_STR" ]; then + export DATE_NUM="$(date -u +%y%m%d%H%M)" + export DATE_STR="$(date -u +%Y%m%d_%H%M%S)" + echo "Setting date number to $DATE_NUM" + echo "Setting date string to $DATE_STR" fi function start_section() { diff --git a/arachne-pnr/meta.yaml b/arachne-pnr/meta.yaml index 8f93304c..b85b6989 100644 --- a/arachne-pnr/meta.yaml +++ b/arachne-pnr/meta.yaml @@ -7,8 +7,14 @@ source: git_rev: master build: - number: {{ '1%04i00%s'|format(GIT_DESCRIBE_NUMBER|int, os.environ.get('DATESTR')) }} - string: {{ GIT_DESCRIBE_NUMBER }}.{{ os.environ.get('DATESTR') }}.{{ GIT_DESCRIBE_HASH }} + # y==GIT_DESCRIBE_NUMBER, z==DATE_NUM, x==GIT_DESCRIBE_HASH + # + # number: 10693001803050325 + # 1yyyy00zzzzzzzzzz + number: {{ '1%04i00%s'|format(GIT_DESCRIBE_NUMBER|int, os.environ.get('DATE_NUM')) }} + # string: 0693.20180305_0325.g588ce0e3 + # yyyy.zzzzzzzz_zzzz.gxxxxxxxx + string: {{ '%04i'|format(GIT_DESCRIBE_NUMBER|int) }}.{{ os.environ.get('DATE_STR') }}.{{ GIT_DESCRIBE_HASH }} script_env: - CI - TRAVIS diff --git a/conda-env.sh b/conda-env.sh index 1206a167..4fd48b75 100755 --- a/conda-env.sh +++ b/conda-env.sh @@ -11,14 +11,11 @@ fi # also set similarly at test time. export PYTHONWARNINGS=ignore::UserWarning:conda_build.environ -if [ -z "$DATESTR" ]; then - if [ -z "$DATESHORT" ]; then - export DATESTR=$(date -u +%Y%m%d%H%M%S) - echo "Setting long date string of $DATESTR" - else - export DATESTR=$(date -u +%y%m%d%H%M) - echo "Setting short date string of $DATESTR" - fi +if [ -z "$DATE_STR" ]; then + export DATE_NUM="$(date -u +%y%m%d%H%M)" + export DATE_STR="$(date -u +%Y%m%d_%H%M%S)" + echo "Setting date number to $DATE_NUM" + echo "Setting date string to $DATE_STR" fi if [ -z "$GITREV" ]; then export GITREV="$(git describe --long)" diff --git a/flterm/meta.yaml b/flterm/meta.yaml index 123ca4ea..68212001 100644 --- a/flterm/meta.yaml +++ b/flterm/meta.yaml @@ -6,14 +6,14 @@ source: git_url: https://github.com/timvideos/flterm.git build: - # y==GIT_DESCRIBE_NUMBER, z==DATESTR, x==GIT_DESCRIBE_HASH + # y==GIT_DESCRIBE_NUMBER, z==DATE_NUM, x==GIT_DESCRIBE_HASH # # number: 10693001803050325 # 1yyyy00zzzzzzzzzz - number: {{ '1%04i00%s'|format(environ.get('GIT_DESCRIBE_NUMBER')|int, environ.get('DATESTR')) }} - # string: 0693.1803050325.g588ce0e3 - # yyyy.zzzzzzzzzz.gxxxxxxxx - string: {{ '%04i'|format(environ.get('GIT_DESCRIBE_NUMBER')|int) }}.{{ environ.get('DATESTR') }}.{{ environ.get('GIT_DESCRIBE_HASH', 'unknown') }} + number: {{ '1%04i00%s'|format(GIT_DESCRIBE_NUMBER|int, os.environ.get('DATE_NUM')) }} + # string: 0693.20180305_0325.g588ce0e3 + # yyyy.zzzzzzzz_zzzz.gxxxxxxxx + string: {{ '%04i'|format(GIT_DESCRIBE_NUMBER|int) }}.{{ os.environ.get('DATE_STR') }}.{{ GIT_DESCRIBE_HASH }} script_env: - CI - TRAVIS diff --git a/gcc/newlib/meta.yaml b/gcc/newlib/meta.yaml index bfd6df7b..57746495 100644 --- a/gcc/newlib/meta.yaml +++ b/gcc/newlib/meta.yaml @@ -29,23 +29,21 @@ source: build: {% if environ.get('GIT_DESCRIBE_NUMBER', "0") != "0" %} - # y==GIT_DESCRIBE_NUMBER, z==DATESTR, x==GIT_DESCRIBE_HASH + # y==GIT_DESCRIBE_NUMBER, z==DATE_NUM, x==GIT_DESCRIBE_HASH # # number: 10693001803050325 # 1yyyy00zzzzzzzzzz - number: {{ '1%04i00%s'|format(environ.get('GIT_DESCRIBE_NUMBER')|int, environ.get('DATESTR')) }} - # string: 0693.1803050325.g588ce0e3 - # yyyy.zzzzzzzzzz.gxxxxxxxx - string: {{ '%04i'|format(environ.get('GIT_DESCRIBE_NUMBER')|int) }}.{{ environ.get('DATESTR') }}.{{ environ.get('GIT_DESCRIBE_HASH', 'unknown') }} + number: {{ '1%04i00%s'|format(GIT_DESCRIBE_NUMBER|int, os.environ.get('DATE_NUM')) }} + # string: 0693.20180305_0325.g588ce0e3 + # yyyy.zzzzzzzz_zzzz.gxxxxxxxx + string: {{ '%04i'|format(GIT_DESCRIBE_NUMBER|int) }}.{{ os.environ.get('DATE_STR') }}.{{ GIT_DESCRIBE_HASH }} {% else %} # z==DATESTR # # number: 1803050325 - # zzzzzzzzzz - number: {{ environ.get('DATESTR') }} - # string: 0693.1803050325.g588ce0e3 - # yyyy.zzzzzzzzzz.gxxxxxxxx - string: {{ environ.get('DATESTR') }} + number: {{ environ.get('DATE_NUM') }} + # string: 20180305_0325 + string: {{ environ.get('DATE_STR') }} {% endif %} script_env: - CI diff --git a/gcc/nostdc/meta.yaml b/gcc/nostdc/meta.yaml index 83fde450..d55966a6 100644 --- a/gcc/nostdc/meta.yaml +++ b/gcc/nostdc/meta.yaml @@ -23,23 +23,21 @@ source: build: {% if environ.get('GIT_DESCRIBE_NUMBER', "0") != "0" %} - # y==GIT_DESCRIBE_NUMBER, z==DATESTR, x==GIT_DESCRIBE_HASH + # y==GIT_DESCRIBE_NUMBER, z==DATE_NUM, x==GIT_DESCRIBE_HASH # # number: 10693001803050325 # 1yyyy00zzzzzzzzzz - number: {{ '1%04i00%s'|format(environ.get('GIT_DESCRIBE_NUMBER')|int, environ.get('DATESTR')) }} - # string: 0693.1803050325.g588ce0e3 - # yyyy.zzzzzzzzzz.gxxxxxxxx - string: {{ '%04i'|format(environ.get('GIT_DESCRIBE_NUMBER')|int) }}.{{ environ.get('DATESTR') }}.{{ environ.get('GIT_DESCRIBE_HASH', 'unknown') }} + number: {{ '1%04i00%s'|format(GIT_DESCRIBE_NUMBER|int, os.environ.get('DATE_NUM')) }} + # string: 0693.20180305_0325.g588ce0e3 + # yyyy.zzzzzzzz_zzzz.gxxxxxxxx + string: {{ '%04i'|format(GIT_DESCRIBE_NUMBER|int) }}.{{ os.environ.get('DATE_STR') }}.{{ GIT_DESCRIBE_HASH }} {% else %} # z==DATESTR # # number: 1803050325 - # zzzzzzzzzz - number: {{ environ.get('DATESTR') }} - # string: 0693.1803050325.g588ce0e3 - # yyyy.zzzzzzzzzz.gxxxxxxxx - string: {{ environ.get('DATESTR') }} + number: {{ environ.get('DATE_NUM') }} + # string: 20180305_0325 + string: {{ environ.get('DATE_STR') }} {% endif %} script_env: - CI diff --git a/iceprog/meta.yaml b/iceprog/meta.yaml index 4f848758..7f451b85 100644 --- a/iceprog/meta.yaml +++ b/iceprog/meta.yaml @@ -9,8 +9,14 @@ source: - iceprog-only.patch build: - number: {{ '1%04i00%s'|format(GIT_DESCRIBE_NUMBER|int, os.environ.get('DATESTR')) }} - string: {{ '%04i'|format(GIT_DESCRIBE_NUMBER|int) }}.{{ os.environ.get('DATESTR') }}.{{ GIT_DESCRIBE_HASH }} + # y==GIT_DESCRIBE_NUMBER, z==DATE_NUM, x==GIT_DESCRIBE_HASH + # + # number: 10693001803050325 + # 1yyyy00zzzzzzzzzz + number: {{ '1%04i00%s'|format(GIT_DESCRIBE_NUMBER|int, os.environ.get('DATE_NUM')) }} + # string: 0693.20180305_0325.g588ce0e3 + # yyyy.zzzzzzzz_zzzz.gxxxxxxxx + string: {{ '%04i'|format(GIT_DESCRIBE_NUMBER|int) }}.{{ os.environ.get('DATE_STR') }}.{{ GIT_DESCRIBE_HASH }} script_env: - CI - TRAVIS diff --git a/icestorm/meta.yaml b/icestorm/meta.yaml index 61c37069..65adfb2a 100644 --- a/icestorm/meta.yaml +++ b/icestorm/meta.yaml @@ -9,14 +9,14 @@ source: - noiceprog.patch build: - # y==GIT_DESCRIBE_NUMBER, z==DATESTR, x==GIT_DESCRIBE_HASH + # y==GIT_DESCRIBE_NUMBER, z==DATE_NUM, x==GIT_DESCRIBE_HASH # # number: 10693001803050325 # 1yyyy00zzzzzzzzzz - number: {{ '1%04i00%s'|format(GIT_DESCRIBE_NUMBER|int, os.environ.get('DATESTR')) }} - # string: 0693.1803050325.g588ce0e3 - # yyyy.zzzzzzzzzz.gxxxxxxxx - string: {{ '%04i'|format(GIT_DESCRIBE_NUMBER|int) }}.{{ os.environ.get('DATESTR') }}.{{ GIT_DESCRIBE_HASH }} + number: {{ '1%04i00%s'|format(GIT_DESCRIBE_NUMBER|int, os.environ.get('DATE_NUM')) }} + # string: 0693.20180305_0325.g588ce0e3 + # yyyy.zzzzzzzz_zzzz.gxxxxxxxx + string: {{ '%04i'|format(GIT_DESCRIBE_NUMBER|int) }}.{{ os.environ.get('DATE_STR') }}.{{ GIT_DESCRIBE_HASH }} script_env: - CI - TRAVIS diff --git a/iverilog/meta.yaml b/iverilog/meta.yaml index 04b440c1..216d8a3d 100644 --- a/iverilog/meta.yaml +++ b/iverilog/meta.yaml @@ -9,8 +9,14 @@ source: - fix-vvp-path.patch build: - number: {{ '1%04i00%s'|format(GIT_DESCRIBE_NUMBER|int, os.environ.get('DATESTR')) }} - string: {{ '%04i'|format(GIT_DESCRIBE_NUMBER|int) }}.{{ os.environ.get('DATESTR') }}.{{ GIT_DESCRIBE_HASH }} + # y==GIT_DESCRIBE_NUMBER, z==DATE_NUM, x==GIT_DESCRIBE_HASH + # + # number: 10693001803050325 + # 1yyyy00zzzzzzzzzz + number: {{ '1%04i00%s'|format(GIT_DESCRIBE_NUMBER|int, os.environ.get('DATE_NUM')) }} + # string: 0693.20180305_0325.g588ce0e3 + # yyyy.zzzzzzzz_zzzz.gxxxxxxxx + string: {{ '%04i'|format(GIT_DESCRIBE_NUMBER|int) }}.{{ os.environ.get('DATE_STR') }}.{{ GIT_DESCRIBE_HASH }} script_env: - CI - TRAVIS diff --git a/nextpnr/meta.yaml b/nextpnr/meta.yaml index 80ce37e1..d8882122 100644 --- a/nextpnr/meta.yaml +++ b/nextpnr/meta.yaml @@ -7,14 +7,14 @@ source: git_rev: master build: - # y==GIT_DESCRIBE_NUMBER, z==DATESTR, x==GIT_DESCRIBE_HASH + # y==GIT_DESCRIBE_NUMBER, z==DATE_NUM, x==GIT_DESCRIBE_HASH # # number: 10693001803050325 # 1yyyy00zzzzzzzzzz - number: {{ '1%04i00%s'|format(GIT_DESCRIBE_NUMBER|int, os.environ.get('DATESTR')) }} - # string: 0693.1803050325.g588ce0e3 - # yyyy.zzzzzzzzzz.gxxxxxxxx - string: {{ '%04i'|format(GIT_DESCRIBE_NUMBER|int) }}.{{ os.environ.get('DATESTR') }}.{{ GIT_DESCRIBE_HASH }} + number: {{ '1%04i00%s'|format(GIT_DESCRIBE_NUMBER|int, os.environ.get('DATE_NUM')) }} + # string: 0693.20180305_0325.g588ce0e3 + # yyyy.zzzzzzzz_zzzz.gxxxxxxxx + string: {{ '%04i'|format(GIT_DESCRIBE_NUMBER|int) }}.{{ os.environ.get('DATE_STR') }}.{{ GIT_DESCRIBE_HASH }} script_env: - CI - TRAVIS diff --git a/openocd/meta.yaml b/openocd/meta.yaml index f5afb9cf..bf67de8b 100644 --- a/openocd/meta.yaml +++ b/openocd/meta.yaml @@ -18,14 +18,14 @@ source: - spartan7-idcodes.patch build: - # y==GIT_DESCRIBE_NUMBER, z==DATESTR, x==GIT_DESCRIBE_HASH + # y==GIT_DESCRIBE_NUMBER, z==DATE_NUM, x==GIT_DESCRIBE_HASH # # number: 10693001803050325 # 1yyyy00zzzzzzzzzz - number: {{ '1%04i00%s'|format(environ.get('GIT_DESCRIBE_NUMBER')|int, environ.get('DATESTR')) }} - # string: 0693.1803050325.g588ce0e3 - # yyyy.zzzzzzzzzz.gxxxxxxxx - string: {{ '%04i'|format(environ.get('GIT_DESCRIBE_NUMBER')|int) }}.{{ environ.get('DATESTR') }}.{{ environ.get('GIT_DESCRIBE_HASH', 'unknown') }} + number: {{ '1%04i00%s'|format(GIT_DESCRIBE_NUMBER|int, os.environ.get('DATE_NUM')) }} + # string: 0693.20180305_0325.g588ce0e3 + # yyyy.zzzzzzzz_zzzz.gxxxxxxxx + string: {{ '%04i'|format(GIT_DESCRIBE_NUMBER|int) }}.{{ os.environ.get('DATE_STR') }}.{{ GIT_DESCRIBE_HASH }} script_env: - CI - TRAVIS diff --git a/sdcc/meta.yaml b/sdcc/meta.yaml index c65d9f51..a767f058 100644 --- a/sdcc/meta.yaml +++ b/sdcc/meta.yaml @@ -11,11 +11,9 @@ build: # z==DATESTR # # number: 1803050325 - # zzzzzzzzzz - number: {{ environ.get('DATESTR') }} - # string: 0693.1803050325.g588ce0e3 - # yyyy.zzzzzzzzzz.gxxxxxxxx - string: {{ environ.get('DATESTR') }} + number: {{ environ.get('DATE_NUM') }} + # string: 20180305_0325 + string: {{ environ.get('DATE_STR') }} script_env: - CI - TRAVIS diff --git a/verilator/meta.yaml b/verilator/meta.yaml index 72255aa3..9b1137d4 100644 --- a/verilator/meta.yaml +++ b/verilator/meta.yaml @@ -8,14 +8,14 @@ source: build: detect_binary_files_with_prefix: True - # y==GIT_DESCRIBE_NUMBER, z==DATESTR, x==GIT_DESCRIBE_HASH + # y==GIT_DESCRIBE_NUMBER, z==DATE_NUM, x==GIT_DESCRIBE_HASH # # number: 10693001803050325 # 1yyyy00zzzzzzzzzz - number: {{ '1%04i00%s'|format(environ.get('GIT_DESCRIBE_NUMBER')|int, environ.get('DATESTR')) }} - # string: 0693.1803050325.g588ce0e3 - # yyyy.zzzzzzzzzz.gxxxxxxxx - string: {{ '%04i'|format(environ.get('GIT_DESCRIBE_NUMBER')|int) }}.{{ environ.get('DATESTR') }}.{{ environ.get('GIT_DESCRIBE_HASH', 'unknown') }} + number: {{ '1%04i00%s'|format(GIT_DESCRIBE_NUMBER|int, os.environ.get('DATE_NUM')) }} + # string: 0693.20180305_0325.g588ce0e3 + # yyyy.zzzzzzzz_zzzz.gxxxxxxxx + string: {{ '%04i'|format(GIT_DESCRIBE_NUMBER|int) }}.{{ os.environ.get('DATE_STR') }}.{{ GIT_DESCRIBE_HASH }} script_env: - CI - TRAVIS diff --git a/vtr/meta.yaml b/vtr/meta.yaml index cec3cb2c..694a4ace 100644 --- a/vtr/meta.yaml +++ b/vtr/meta.yaml @@ -7,14 +7,14 @@ source: git_rev: symbiflow build: - # y==GIT_DESCRIBE_NUMBER, z==DATESTR, x==GIT_DESCRIBE_HASH + # y==GIT_DESCRIBE_NUMBER, z==DATE_NUM, x==GIT_DESCRIBE_HASH # # number: 10693001803050325 # 1yyyy00zzzzzzzzzz - number: {{ '1%04i00%s'|format(GIT_DESCRIBE_NUMBER|int, os.environ.get('DATESTR')) }} - # string: 0693.1803050325.g588ce0e3 - # yyyy.zzzzzzzzzz.gxxxxxxxx - string: {{ '%04i'|format(GIT_DESCRIBE_NUMBER|int) }}.{{ os.environ.get('DATESTR') }}.{{ GIT_DESCRIBE_HASH }} + number: {{ '1%04i00%s'|format(GIT_DESCRIBE_NUMBER|int, os.environ.get('DATE_NUM')) }} + # string: 0693.20180305_0325.g588ce0e3 + # yyyy.zzzzzzzz_zzzz.gxxxxxxxx + string: {{ '%04i'|format(GIT_DESCRIBE_NUMBER|int) }}.{{ os.environ.get('DATE_STR') }}.{{ GIT_DESCRIBE_HASH }} script_env: - CI - TRAVIS diff --git a/yosys/meta.yaml b/yosys/meta.yaml index e50aa54d..94a2a65c 100644 --- a/yosys/meta.yaml +++ b/yosys/meta.yaml @@ -9,14 +9,14 @@ source: - makefile-conda-config.patch build: - # y==GIT_DESCRIBE_NUMBER, z==DATESTR, x==GIT_DESCRIBE_HASH + # y==GIT_DESCRIBE_NUMBER, z==DATE_NUM, x==GIT_DESCRIBE_HASH # # number: 10693001803050325 # 1yyyy00zzzzzzzzzz - number: {{ '1%04i00%s'|format(GIT_DESCRIBE_NUMBER|int, os.environ.get('DATESTR')) }} - # string: 0693.1803050325.g588ce0e3 - # yyyy.zzzzzzzzzz.gxxxxxxxx - string: {{ '%04i'|format(GIT_DESCRIBE_NUMBER|int) }}.{{ os.environ.get('DATESTR') }}.{{ GIT_DESCRIBE_HASH }} + number: {{ '1%04i00%s'|format(GIT_DESCRIBE_NUMBER|int, os.environ.get('DATE_NUM')) }} + # string: 0693.20180305_0325.g588ce0e3 + # yyyy.zzzzzzzz_zzzz.gxxxxxxxx + string: {{ '%04i'|format(GIT_DESCRIBE_NUMBER|int) }}.{{ os.environ.get('DATE_STR') }}.{{ GIT_DESCRIBE_HASH }} script_env: - CI - TRAVIS From fd3096ae3b4c6736a0915d0df4e90e0ccc43f330 Mon Sep 17 00:00:00 2001 From: Tim 'mithro' Ansell Date: Fri, 21 Sep 2018 06:36:54 -0700 Subject: [PATCH 26/36] gcc: Check the PKG_VERSION environment. --- gcc/newlib/build.sh | 9 ++++++++- gcc/nostdc/build.sh | 15 ++++++++++++++- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/gcc/newlib/build.sh b/gcc/newlib/build.sh index c74a310a..460e6e62 100644 --- a/gcc/newlib/build.sh +++ b/gcc/newlib/build.sh @@ -9,6 +9,13 @@ if [ x"$TOOLCHAIN_ARCH" = x ]; then else echo "TOOLCHAIN_ARCH: '$TOOLCHAIN_ARCH'" fi +if [ x"$PKG_VERSION" = x ]; then + export | grep version + export | grep VERSION + exit 1 +else + echo "PKG_VERSION: '$PKG_VERSION'" +fi if [ x"$TRAVIS" = xtrue ]; then CPU_COUNT=2 @@ -83,7 +90,7 @@ if [ "$GCC_STAGE1_VERSION" != "$GCC_STAGE2_VERSION" ]; then exit 1 fi -set -x +#set -x rm -rf libstdc++-v3 cd .. diff --git a/gcc/nostdc/build.sh b/gcc/nostdc/build.sh index 5ae43b1b..909eeeca 100644 --- a/gcc/nostdc/build.sh +++ b/gcc/nostdc/build.sh @@ -3,6 +3,19 @@ # gcc bare metal build set -e +if [ x"$TOOLCHAIN_ARCH" = x ]; then + export | grep toolchain + exit 1 +else + echo "TOOLCHAIN_ARCH: '$TOOLCHAIN_ARCH'" +fi +if [ x"$PKG_VERSION" = x ]; then + export | grep version + export | grep VERSION + exit 1 +else + echo "PKG_VERSION: '$PKG_VERSION'" +fi if [ x"$TRAVIS" = xtrue ]; then CPU_COUNT=2 @@ -56,7 +69,7 @@ GCC=$TARGET-gcc # Check binutils $TARGET-as --version -set -x +#set -x rm -rf libstdc++-v3 cd .. From f0c8ed0fd3a39a9ea2e2ce4c0d50a061adf42067 Mon Sep 17 00:00:00 2001 From: Tim 'mithro' Ansell Date: Fri, 21 Sep 2018 07:04:50 -0700 Subject: [PATCH 27/36] conda: Pin to python3.6 for now. --- conda-get.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/conda-get.sh b/conda-get.sh index 6a0d7134..27273f70 100755 --- a/conda-get.sh +++ b/conda-get.sh @@ -11,13 +11,13 @@ if [ ! -d $CONDA_PATH -o ! -z "$CI" ]; then ./Miniconda3-latest-Linux-x86_64.sh -p $CONDA_PATH -b -f fi export PATH=$CONDA_PATH/bin:$PATH + +echo "python==3.6" > $CONDA_PATH/conda-meta/pinned + conda update -y conda -if [ ! -z "$CONDA_BUILD_VERSION" ]; then - conda install -y conda-build==$CONDA_BUILD_VERSION - echo "conda-build==$CONDA_BUILD_VERSION" > $CONDA_PATH/conda-meta/pinned -else - conda install -y conda-build - conda install -y conda-verify -fi + +conda install -y conda-build +conda install -y conda-verify + conda install -y anaconda-client conda install -y jinja2 From adcc49e24ff2439b54f387d7ad0907dfc5f378a4 Mon Sep 17 00:00:00 2001 From: Tim 'mithro' Ansell Date: Fri, 21 Sep 2018 07:18:44 -0700 Subject: [PATCH 28/36] conda: Pin conda-build version? --- conda-get.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/conda-get.sh b/conda-get.sh index 27273f70..e7413982 100755 --- a/conda-get.sh +++ b/conda-get.sh @@ -13,7 +13,9 @@ fi export PATH=$CONDA_PATH/bin:$PATH echo "python==3.6" > $CONDA_PATH/conda-meta/pinned +echo "conda-build==3.14.0" >> $CONDA_PATH/conda-meta/pinned +conda install -y python conda update -y conda conda install -y conda-build From c08b336634b75560eaa5e155a228839ace750a10 Mon Sep 17 00:00:00 2001 From: Tim 'mithro' Ansell Date: Fri, 21 Sep 2018 09:13:42 -0700 Subject: [PATCH 29/36] travis: Output info from common script. --- .travis/common.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.travis/common.sh b/.travis/common.sh index 89c33885..352df927 100644 --- a/.travis/common.sh +++ b/.travis/common.sh @@ -43,7 +43,7 @@ export PYTHONWARNINGS=ignore::UserWarning:conda_build.environ export BASE_PATH="/tmp/really-really-really-really-really-really-really-really-really-really-really-really-really-long-path" export CONDA_PATH="$BASE_PATH/conda" mkdir -p "$BASE_PATH" -export PATH="$PATH:$CONDA_PATH/bin" +export PATH="$CONDA_PATH/bin:$PATH" export GITREV="$(git describe --long 2>/dev/null || echo "unknown")" export CONDA_BUILD_ARGS=$PACKAGE @@ -51,3 +51,8 @@ if [ -f "$PACKAGE/conda_build_config.$TOOLCHAIN_ARCH.yaml" ]; then export CONDA_BUILD_ARGS="$CONDA_BUILD_ARGS -m $PACKAGE/conda_build_config.$TOOLCHAIN_ARCH.yaml" fi export CONDA_OUT="$(conda render $CONDA_BUILD_ARGS --output 2> /dev/null | tail -n 1 | sed -e's/-[0-9]\+\.tar/*.tar/' -e's/-git//')" + +echo " GITREV: $GITREV" +echo " CONDA_PATH: $CONDA_PATH" +echo "CONDA_BUILD_ARGS: $CONDA_BUILD_ARGS" +echo " CONDA_OUT: $CONDA_OUT" From 909093c3ab23be195484938f1505cc47977d705a Mon Sep 17 00:00:00 2001 From: Tim 'mithro' Ansell Date: Fri, 21 Sep 2018 09:24:47 -0700 Subject: [PATCH 30/36] Use long DATE_NUM so sorting works. --- .travis/common.sh | 2 +- conda-env.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis/common.sh b/.travis/common.sh index 352df927..4a719efc 100644 --- a/.travis/common.sh +++ b/.travis/common.sh @@ -14,7 +14,7 @@ export -f travis_fold export -f travis_time_start export -f travis_time_finish if [ -z "$DATE_STR" ]; then - export DATE_NUM="$(date -u +%y%m%d%H%M)" + export DATE_NUM="$(date -u +%Y%m%d%H%M%S)" export DATE_STR="$(date -u +%Y%m%d_%H%M%S)" echo "Setting date number to $DATE_NUM" echo "Setting date string to $DATE_STR" diff --git a/conda-env.sh b/conda-env.sh index 4fd48b75..ee1a1a0c 100755 --- a/conda-env.sh +++ b/conda-env.sh @@ -12,7 +12,7 @@ fi export PYTHONWARNINGS=ignore::UserWarning:conda_build.environ if [ -z "$DATE_STR" ]; then - export DATE_NUM="$(date -u +%y%m%d%H%M)" + export DATE_NUM="$(date -u +%Y%m%d%H%M%S)" export DATE_STR="$(date -u +%Y%m%d_%H%M%S)" echo "Setting date number to $DATE_NUM" echo "Setting date string to $DATE_STR" From 64707c08895a2bac84e4e708c785f6024c6c9bcc Mon Sep 17 00:00:00 2001 From: Tim 'mithro' Ansell Date: Fri, 21 Sep 2018 10:10:05 -0700 Subject: [PATCH 31/36] gcc: Use underscore like previously. --- gcc/newlib/meta.yaml | 2 +- gcc/nostdc/meta.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gcc/newlib/meta.yaml b/gcc/newlib/meta.yaml index 57746495..72f1e1e4 100644 --- a/gcc/newlib/meta.yaml +++ b/gcc/newlib/meta.yaml @@ -1,7 +1,7 @@ package: name: gcc-{{ environ.get('TOOLCHAIN_ARCH') }}-elf-newlib {% if environ.get('TOOLCHAIN_ARCH') == "or1k" %} - version: 5.4.0+{{ gcc_git_rev }} + version: 5.4.0_{{ gcc_git_rev }} {% else %} version: 5.4.0 {% endif %} diff --git a/gcc/nostdc/meta.yaml b/gcc/nostdc/meta.yaml index d55966a6..c5baf4e7 100644 --- a/gcc/nostdc/meta.yaml +++ b/gcc/nostdc/meta.yaml @@ -1,7 +1,7 @@ package: name: gcc-{{ environ.get('TOOLCHAIN_ARCH') }}-elf-nostdc {% if environ.get('TOOLCHAIN_ARCH') == "or1k" %} - version: 5.4.0+{{ gcc_git_rev }} + version: 5.4.0_{{ gcc_git_rev }} {% else %} version: 5.4.0 {% endif %} From 62d4651dde96f0b106c081e9ed20445670955302 Mon Sep 17 00:00:00 2001 From: Tim 'mithro' Ansell Date: Fri, 21 Sep 2018 10:47:24 -0700 Subject: [PATCH 32/36] gcc/newlib: Read new nostdc version. --- gcc/newlib/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/newlib/build.sh b/gcc/newlib/build.sh index 460e6e62..3d21f5be 100644 --- a/gcc/newlib/build.sh +++ b/gcc/newlib/build.sh @@ -78,7 +78,7 @@ echo "---" $TARGET-gcc --version 2>&1 echo "---" -GCC_STAGE1_VERSION=$($TARGET-gcc --version 2>&1 | head -1 | sed -e"s/$TARGET-gcc (GCC) //") +GCC_STAGE1_VERSION=$($TARGET-gcc --version 2>&1 | head -1 | sed -e"s/$TARGET-gcc (//" -e"s/).*//") GCC_STAGE2_VERSION=$(echo $PKG_VERSION | sed -e's/-.*//') if [ "$GCC_STAGE1_VERSION" != "$GCC_STAGE2_VERSION" ]; then echo From de705ac40298300acc82d5703e77ccf6110a3a86 Mon Sep 17 00:00:00 2001 From: Tim 'mithro' Ansell Date: Fri, 21 Sep 2018 15:09:09 -0700 Subject: [PATCH 33/36] gcc: More debugging in the prescript. --- gcc/nostdc/prescript.or1k.sh | 38 ++++++++++++++++++++++++------------ 1 file changed, 25 insertions(+), 13 deletions(-) diff --git a/gcc/nostdc/prescript.or1k.sh b/gcc/nostdc/prescript.or1k.sh index d0ec2662..8272ef7d 100755 --- a/gcc/nostdc/prescript.or1k.sh +++ b/gcc/nostdc/prescript.or1k.sh @@ -1,22 +1,27 @@ #!/bin/bash -if ! which conda ; then - echo "No conda in path?" +if [ $TOOLCHAIN_ARCH != "or1k" ]; then + echo "Only valid for or1k config." exit 1 fi -if [ $TOOLCHAIN_ARCH != "or1k" ]; then - echo "Only valid for or1k config." +if [ -z "$PACKAGE" ]; then + echo "Must provide $PACKAGE environment variable." exit 1 fi if [ -z "$CONDA_PATH" ]; then CONDA_PATH=~/conda/ + export PATH=$CONDA_PATH:$PATH +fi +if ! which conda ; then + echo "No conda in path?" + exit 1 fi TOP_DIR=$PWD echo "Top dir: $TOP_DIR" -EXTRA_YAML_FILE=$TOP_DIR/gcc/nostdc/conda_build_config.$TOOLCHAIN_ARCH.yaml +EXTRA_YAML_FILE=$TOP_DIR/$PACKAGE/conda_build_config.$TOOLCHAIN_ARCH.yaml OR1K_GIT_DIR="$($CONDA_PATH/bin/python $TOP_DIR/find-git-cache.py gcc/nostdc git_url)" OR1K_GIT_REV="$($CONDA_PATH/bin/python $TOP_DIR/find-git-cache.py gcc/nostdc git_rev)" @@ -28,6 +33,12 @@ else exit 1 fi pushd $OR1K_GIT_DIR >/dev/null + +echo "-------------------" +du -h -s . +df -h +echo "-------------------" + git remote -v if ! git remote -v | grep -q upstream; then git remote add upstream git://gcc.gnu.org/git/gcc.git @@ -38,22 +49,23 @@ git fetch upstream --tags git fetch git fetch --tags -echo > $EXTRA_YAML_FILE - # Find our current or1k release OR1K_RELEASE=$(git describe --abbrev=0 --match or1k-*-* $OR1K_GIT_REV) -echo "or1k_release: $OR1K_RELEASE" >> $EXTRA_YAML_FILE GCC_RELEASE=$(echo $OR1K_RELEASE | sed -e's/^or1k-/gcc-/' -e's/\./_/g' -e's/-[0-9]\+$/-release/') GCC_RELEASE_FIXED=$(echo $GCC_RELEASE | sed -e's/_/./g') -echo "gcc_release: $GCC_RELEASE_FIXED" >> $EXTRA_YAML_FILE GCC_GIT_REV=$(git describe --tags --long --match ${GCC_RELEASE} $OR1K_GIT_REV | sed -e"s/^${GCC_RELEASE}-//" -e's/-/_/') -echo "gcc_git_rev: $GCC_GIT_REV" >> $EXTRA_YAML_FILE -more $EXTRA_YAML_FILE +cat > $EXTRA_YAML_FILE </dev/null From 412f1435c56778cebaeff9e61146dc5b647874a8 Mon Sep 17 00:00:00 2001 From: Tim 'mithro' Ansell Date: Sat, 22 Sep 2018 13:38:31 +0200 Subject: [PATCH 34/36] gcc: More debug. --- gcc/newlib/build.sh | 11 ++++++----- gcc/newlib/run_test.sh | 4 +++- gcc/nostdc/build.sh | 1 - gcc/nostdc/run_test.sh | 7 +++---- 4 files changed, 12 insertions(+), 11 deletions(-) diff --git a/gcc/newlib/build.sh b/gcc/newlib/build.sh index 3d21f5be..5d6af6ef 100644 --- a/gcc/newlib/build.sh +++ b/gcc/newlib/build.sh @@ -98,28 +98,29 @@ cd .. mkdir -p build-newlib cd build-newlib $SRC_DIR/newlib/configure \ - --prefix=/usr \ - \ --target=$TARGET \ + \ + --prefix=/ \ + \ --disable-newlib-supplied-syscalls \ \ --enable-multilib \ \ make -j$CPU_COUNT -make DESTDIR=$PREFIX/$TARGET/sysroot install +make DESTDIR=$PREFIX install cd .. mkdir -p build-gcc cd build-gcc #export LDFLAGS=-static +# --prefix=$PREFIX \ $SRC_DIR/gcc/configure \ \ + --prefix=/ \ --program-prefix=$TARGET-newlib- \ \ - --prefix=$PREFIX \ - \ --with-gmp=$CONDA_PREFIX \ --with-mpfr=$CONDA_PREFIX \ --with-mpc=$CONDA_PREFIX \ diff --git a/gcc/newlib/run_test.sh b/gcc/newlib/run_test.sh index 4a308243..ddfe2d78 100644 --- a/gcc/newlib/run_test.sh +++ b/gcc/newlib/run_test.sh @@ -52,7 +52,9 @@ $GCC -print-multi-directory $GCC -print-multi-lib $GCC -print-multi-os-directory $GCC -print-sysroot +find $($GCC -print-sysroot) $GCC -print-sysroot-headers-suffix +#$TARGET-cpp -Wp,-v echo "===========================================" echo "Compile and link a 'bare metal' binary with stdlib" @@ -66,7 +68,7 @@ int main() { EOF echo "Compiling main" -$GCC -g main.c -o main -Wl,-Map=output.map +$GCC -v -g main.c -o main -Wl,-Map=output.map SUCCESS=$? if [ $SUCCESS -ne 0 ]; then echo "Compiler didn't exit successfully." diff --git a/gcc/nostdc/build.sh b/gcc/nostdc/build.sh index 909eeeca..52fa3566 100644 --- a/gcc/nostdc/build.sh +++ b/gcc/nostdc/build.sh @@ -86,7 +86,6 @@ mkdir -p $PREFIX/$TARGET/sysroot/usr/include $SRC_DIR/gcc/configure \ \ --prefix=/ \ - --with-sysroot=$PREFIX/$TARGET/sysroot \ \ --with-gmp=$CONDA_PREFIX \ --with-mpfr=$CONDA_PREFIX \ diff --git a/gcc/nostdc/run_test.sh b/gcc/nostdc/run_test.sh index e8cea11c..d981ecf8 100644 --- a/gcc/nostdc/run_test.sh +++ b/gcc/nostdc/run_test.sh @@ -52,9 +52,8 @@ $GCC -print-multi-directory $GCC -print-multi-lib $GCC -print-multi-os-directory $GCC -print-sysroot -$GCC -print-sysroot-headers-suffix -echo "===========================================" - +find $($GCC -print-sysroot) +#$TARGET-cpp -Wp,-v echo "===========================================" echo "Compile and link a 'bare metal' binary" @@ -68,7 +67,7 @@ int main() { EOF echo "Compiling main" -$GCC -c main.c -o main.o +$GCC -v -c main.c -o main.o SUCCESS=$? if [ $SUCCESS -ne 0 ]; then echo "Compiler didn't exit successfully." From c507c86ad36dd511f182cb4887a8dcf4bd7532ea Mon Sep 17 00:00:00 2001 From: Tim 'mithro' Ansell Date: Sat, 22 Sep 2018 14:19:00 +0200 Subject: [PATCH 35/36] gcc: Patch nostdc with stdint. --- gcc/nostdc/meta.yaml | 2 ++ gcc/nostdc/stdint.patch | 1 + 2 files changed, 3 insertions(+) create mode 120000 gcc/nostdc/stdint.patch diff --git a/gcc/nostdc/meta.yaml b/gcc/nostdc/meta.yaml index c5baf4e7..f1069ef9 100644 --- a/gcc/nostdc/meta.yaml +++ b/gcc/nostdc/meta.yaml @@ -16,6 +16,8 @@ source: fn: gcc-5.4.0.tar.bz2 sha256: 608df76dec2d34de6558249d8af4cbee21eceddbcb580d666f7a5a583ca3303a folder: gcc + patches: + - stdint.patch {% else %} - url: empty.tar.bz2 folder: other diff --git a/gcc/nostdc/stdint.patch b/gcc/nostdc/stdint.patch new file mode 120000 index 00000000..b80c0a9b --- /dev/null +++ b/gcc/nostdc/stdint.patch @@ -0,0 +1 @@ +../newlib/stdint.patch \ No newline at end of file From aaa30acdeb622b0a7b141139c50c7ff7db4e878f Mon Sep 17 00:00:00 2001 From: Tim 'mithro' Ansell Date: Sun, 23 Sep 2018 12:16:43 +0200 Subject: [PATCH 36/36] travis: Don't produce config.log output after failure. --- .travis/after_failure.sh | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.travis/after_failure.sh b/.travis/after_failure.sh index f511ce10..8258bb60 100755 --- a/.travis/after_failure.sh +++ b/.travis/after_failure.sh @@ -16,15 +16,15 @@ end_section "failure.tail" $SPACER -COUNT=0 -for i in $(find $BASE_PATH -name config.log); do - start_section "failure.log.$COUNT" "${RED}Failure output $i...${NC}" - cat $i - end_section "failure.log.$COUNT" - COUNT=$((COUNT+1)) -done - -$SPACER +#COUNT=0 +#for i in $(find $BASE_PATH -name config.log); do +# start_section "failure.log.$COUNT" "${RED}Failure output $i...${NC}" +# cat $i +# end_section "failure.log.$COUNT" +# COUNT=$((COUNT+1)) +#done +# +#$SPACER start_section "failure.log.full" "${RED}Failure output.log...${NC}" cat /tmp/output.log