Skip to content

Commit

Permalink
scripts: Use new toolchains based on crosstool-ng
Browse files Browse the repository at this point in the history
This switches to toolchains from
antmicro's conda channel.

The new toolchains are built using
`crosstool-ng` and contain both
binutils and the compiler itself.
  • Loading branch information
mateusz-holenko committed Oct 31, 2019
1 parent 08b7bdc commit 50c54ef
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 29 deletions.
6 changes: 3 additions & 3 deletions scripts/build-linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@ if [ "$FIRMWARE" != "linux" ]; then
fi

# Install a baremetal toolchain with the newlib standard library
if ! ${CPU_ARCH}-elf-newlib --version > /dev/null 2>&1; then
conda install gcc-${CPU_ARCH}-elf-newlib
if ! ${CPU_ARCH}-elf-newlib-gcc --version > /dev/null 2>&1; then
conda install toolchain-${CPU_ARCH}-elf-newlib
fi
# Install a Linux userspace toolchain with the musl standard library
if ! ${CPU_ARCH}-linux-musl-gcc --version > /dev/null 2>&1; then
conda install gcc-${CPU_ARCH}-linux-musl
conda install toolchain-${CPU_ARCH}-linux-musl
fi

if [ ${CPU} = mor1kx ]; then
Expand Down
2 changes: 1 addition & 1 deletion scripts/build-micropython.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ fi

# Install a toolchain with the newlib standard library
if ! ${CPU_ARCH}-elf-newlib-gcc --version > /dev/null 2>&1; then
conda install gcc-${CPU_ARCH}-elf-newlib
conda install toolchain-${CPU_ARCH}-elf-newlib
fi

# Get micropython is needed
Expand Down
6 changes: 1 addition & 5 deletions scripts/build-pack.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,12 @@ echo " - openocd=$OPENOCD_VERSION" >> $ENV_FILE
# Some conda packages are not there yet (namely x86_64 and lm32 with musl),
# so we comment these out.
for ARCH in or1k riscv32 lm32 x86_64; do
if [[ "$ARCH" == "x86_64" ]]; then
echo -n "#" >> $ENV_FILE
fi
echo " - binutils-$ARCH-elf=$BINUTILS_VERSION" >> $ENV_FILE
for FLAVOR in elf-nostdc elf-newlib linux-musl; do
if [[ "$ARCH" == "x86_64" || ( "$ARCH" == "lm32"
&& "$FLAVOR" == "linux-musl" ) ]]; then
echo -n "#" >> $ENV_FILE
fi
echo " - gcc-$ARCH-$FLAVOR=$GCC_VERSION" >> $ENV_FILE
echo " - toolchain-$ARCH-$FLAVOR=$GCC_VERSION" >> $ENV_FILE
done
done

Expand Down
12 changes: 3 additions & 9 deletions scripts/download-env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -312,15 +312,9 @@ echo "---------------------------------------"

# binutils for the target
echo
echo "Installing binutils for ${CPU_ARCH} (assembler, linker, and other tools)"
conda install -y $CONDA_FLAGS binutils-${CPU_ARCH}-elf=$BINUTILS_VERSION
check_version ${CPU_ARCH}-elf-ld $BINUTILS_VERSION

# gcc for the target
echo
echo "Installing gcc for ${CPU_ARCH} ('bare metal' C cross compiler)"
conda install -y $CONDA_FLAGS gcc-${CPU_ARCH}-elf-nostdc=$GCC_VERSION
check_version ${CPU_ARCH}-elf-gcc $GCC_VERSION
echo "Installing toolchain for ${CPU_ARCH} (assembler, linker, compiler and other tools)"
conda install -y $CONDA_FLAGS toolchain-${CPU_ARCH}-elf-nostdc=$TOOLCHAIN_VERSION
check_version ${CPU_ARCH}-elf-gcc $TOOLCHAIN_VERSION

# gdb for the target
#echo
Expand Down
10 changes: 1 addition & 9 deletions scripts/enter-env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -305,17 +305,9 @@ echo ""
echo "Checking C compiler toolchain"
echo "---------------------------------------"

# binutils for the target



check_version ${CPU_ARCH}-elf-ld $BINUTILS_VERSION || return 1

# gcc for the target



check_version ${CPU_ARCH}-elf-gcc $GCC_VERSION || return 1
check_version ${CPU_ARCH}-elf-gcc $TOOLCHAIN_VERSION || return 1

# gdb for the target
#
Expand Down
3 changes: 1 addition & 2 deletions scripts/settings.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ HEXFILE_VERSION=0.1
CMAKE_VERSION=3.14.4

# Conda package versions
BINUTILS_VERSION=2.32
GCC_VERSION=9.1.0
TOOLCHAIN_VERSION=9.1.0
SDCC_VERSION=3.5.0
OPENOCD_VERSION=0.10.0

Expand Down
1 change: 1 addition & 0 deletions scripts/setup-helpers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ function install_conda {
conda update -q conda
fix_conda
conda config --system --add channels timvideos
conda config --system --prepend channels antmicro
conda info
}

Expand Down

0 comments on commit 50c54ef

Please sign in to comment.