Skip to content

Commit

Permalink
Upgrade toolchain
Browse files Browse the repository at this point in the history
- Upgrade GCC to 13.2.0
- Upgrade newlib to 4.4.0
- Buildsystem improvements
  • Loading branch information
fjtrujy committed Jan 23, 2024
1 parent 30ce261 commit 79cc010
Show file tree
Hide file tree
Showing 6 changed files with 139 additions and 30 deletions.
14 changes: 14 additions & 0 deletions config/psptoolchain-allegrex-config .sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash

PSPTOOLCHAIN_ALLEGREX_BINUTILS_REPO_URL="https://github.com/pspdev/binutils-gdb.git"
PSPTOOLCHAIN_ALLEGREX_BINUTILS_DEFAULT_REPO_REF="allegrex-v2.37.0"
PSPTOOLCHAIN_ALLEGREX_GCC_REPO_URL="https://github.com/pspdev/gcc.git"
PSPTOOLCHAIN_ALLEGREX_GCC_DEFAULT_REPO_REF="allegrex-v13.2.0"
PSPTOOLCHAIN_ALLEGREX_NEWLIB_REPO_URL="https://github.com/pspdev/newlib.git"
PSPTOOLCHAIN_ALLEGREX_NEWLIB_DEFAULT_REPO_REF="allegrex-v4.4.0"
PSPTOOLCHAIN_ALLEGREX_PTHREAD_EMBEDDED_REPO_URL="https://github.com/pspdev/pthread-embedded.git"
PSPTOOLCHAIN_ALLEGREX_PTHREAD_EMBEDDED_DEFAULT_REPO_REF="platform_agnostic"

if test -f "$PSPDEV_CONFIG_OVERRIDE"; then
source "$PSPDEV_CONFIG_OVERRIDE"
fi
31 changes: 25 additions & 6 deletions scripts/001-binutils.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,33 @@
#!/bin/bash
# binutils.sh by Francisco Javier Trujillo Mata ([email protected])
# 001-binutils.sh by pspdev developers

## Exit with code 1 when any command executed returns a non-zero exit code.
onerr()
{
exit 1;
}
trap onerr ERR

## Read information from the configuration file.
source "$(dirname "$0")/../config/psptoolchain-allegrex-config.sh"

## Download the source code.
REPO_URL="https://github.com/pspdev/binutils-gdb.git"
REPO_FOLDER="binutils-gdb"
BRANCH_NAME="allegrex-v2.37.0"
REPO_URL="$PSPTOOLCHAIN_ALLEGREX_BINUTILS_REPO_URL"
REPO_REF="$PSPTOOLCHAIN_ALLEGREX_BINUTILS_DEFAULT_REPO_REF"
REPO_FOLDER="$(s="$REPO_URL"; s=${s##*/}; printf "%s" "${s%.*}")"

# Checking if a specific Git reference has been passed in parameter $1
if test -n "$1"; then
REPO_REF="$1"
printf 'Using specified repo reference %s\n' "$REPO_REF"
fi

if test ! -d "$REPO_FOLDER"; then
git clone --depth 1 -b $BRANCH_NAME $REPO_URL $REPO_FOLDER && cd $REPO_FOLDER || { exit 1; }
git clone --depth 1 -b "$REPO_REF" "$REPO_URL" "$REPO_FOLDER"
else
cd $REPO_FOLDER && git fetch origin && git reset --hard origin/${BRANCH_NAME} || { exit 1; }
git -C "$REPO_FOLDER" fetch origin
git -C "$REPO_FOLDER" reset --hard "origin/$REPO_REF"
git -C "$REPO_FOLDER" checkout "$REPO_REF"
fi

TARGET="psp"
Expand Down
31 changes: 25 additions & 6 deletions scripts/002-gcc-stage1.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,33 @@
#!/bin/bash
# gcc-stage1.sh by Francisco Javier Trujillo Mata ([email protected])
# 002-gcc-stage1.sh by pspdev developers

## Exit with code 1 when any command executed returns a non-zero exit code.
onerr()
{
exit 1;
}
trap onerr ERR

## Read information from the configuration file.
source "$(dirname "$0")/../config/psptoolchain-allegrex-config.sh"

## Download the source code.
REPO_URL="https://github.com/pspdev/gcc.git"
REPO_FOLDER="gcc"
BRANCH_NAME="allegrex-v11.2.0"
REPO_URL="$PSPTOOLCHAIN_ALLEGREX_GCC_REPO_URL"
REPO_REF="$PSPTOOLCHAIN_ALLEGREX_GCC_DEFAULT_REPO_REF"
REPO_FOLDER="$(s="$REPO_URL"; s=${s##*/}; printf "%s" "${s%.*}")"

# Checking if a specific Git reference has been passed in parameter $1
if test -n "$1"; then
REPO_REF="$1"
printf 'Using specified repo reference %s\n' "$REPO_REF"
fi

if test ! -d "$REPO_FOLDER"; then
git clone --depth 1 -b $BRANCH_NAME $REPO_URL $REPO_FOLDER && cd $REPO_FOLDER || { exit 1; }
git clone --depth 1 -b "$REPO_REF" "$REPO_URL" "$REPO_FOLDER"
else
cd $REPO_FOLDER && git fetch origin && git reset --hard origin/${BRANCH_NAME} || { exit 1; }
git -C "$REPO_FOLDER" fetch origin
git -C "$REPO_FOLDER" reset --hard "origin/$REPO_REF"
git -C "$REPO_FOLDER" checkout "$REPO_REF"
fi

TARGET="psp"
Expand Down
31 changes: 25 additions & 6 deletions scripts/003-newlib.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,33 @@
#!/bin/bash
# newlib.sh by Francisco Javier Trujillo Mata ([email protected])
# 003-newlib.sh by pspdev developers

## Exit with code 1 when any command executed returns a non-zero exit code.
onerr()
{
exit 1;
}
trap onerr ERR

## Read information from the configuration file.
source "$(dirname "$0")/../config/psptoolchain-allegrex-config.sh"

## Download the source code.
REPO_URL="https://github.com/pspdev/newlib.git"
REPO_FOLDER="newlib"
BRANCH_NAME="allegrex-v4.3.0"
REPO_URL="$PSPTOOLCHAIN_ALLEGREX_NEWLIB_REPO_URL"
REPO_REF="$PSPTOOLCHAIN_ALLEGREX_NEWLIB_DEFAULT_REPO_REF"
REPO_FOLDER="$(s="$REPO_URL"; s=${s##*/}; printf "%s" "${s%.*}")"

# Checking if a specific Git reference has been passed in parameter $1
if test -n "$1"; then
REPO_REF="$1"
printf 'Using specified repo reference %s\n' "$REPO_REF"
fi

if test ! -d "$REPO_FOLDER"; then
git clone --depth 1 -b $BRANCH_NAME $REPO_URL && cd $REPO_FOLDER || { exit 1; }
git clone --depth 1 -b "$REPO_REF" "$REPO_URL" "$REPO_FOLDER"
else
cd $REPO_FOLDER && git fetch origin && git reset --hard origin/${BRANCH_NAME} && git checkout ${BRANCH_NAME} || { exit 1; }
git -C "$REPO_FOLDER" fetch origin
git -C "$REPO_FOLDER" reset --hard "origin/$REPO_REF"
git -C "$REPO_FOLDER" checkout "$REPO_REF"
fi

TARGET="psp"
Expand Down
31 changes: 25 additions & 6 deletions scripts/004-pthread-embedded.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,33 @@
#!/bin/bash
# pthread-embedded.sh by Francisco Javier Trujillo Mata ([email protected])
# 004-pthread-embeedded.sh by pspdev developers

## Exit with code 1 when any command executed returns a non-zero exit code.
onerr()
{
exit 1;
}
trap onerr ERR

## Read information from the configuration file.
source "$(dirname "$0")/../config/psptoolchain-allegrex-config.sh"

## Download the source code.
REPO_URL="https://github.com/pspdev/pthread-embedded.git"
REPO_FOLDER="pthread-embedded"
BRANCH_NAME="psp"
REPO_URL="$PSPTOOLCHAIN_ALLEGREX_PTHREAD_EMBEDDED_REPO_URL"
REPO_REF="$PSPTOOLCHAIN_ALLEGREX_PTHREAD_EMBEDDED_DEFAULT_REPO_REF"
REPO_FOLDER="$(s="$REPO_URL"; s=${s##*/}; printf "%s" "${s%.*}")"

# Checking if a specific Git reference has been passed in parameter $1
if test -n "$1"; then
REPO_REF="$1"
printf 'Using specified repo reference %s\n' "$REPO_REF"
fi

if test ! -d "$REPO_FOLDER"; then
git clone --depth 1 -b $BRANCH_NAME $REPO_URL && cd $REPO_FOLDER || { exit 1; }
git clone --depth 1 -b "$REPO_REF" "$REPO_URL" "$REPO_FOLDER"
else
cd $REPO_FOLDER && git fetch origin && git reset --hard origin/${BRANCH_NAME} && git checkout ${BRANCH_NAME} || { exit 1; }
git -C "$REPO_FOLDER" fetch origin
git -C "$REPO_FOLDER" reset --hard "origin/$REPO_REF"
git -C "$REPO_FOLDER" checkout "$REPO_REF"
fi

TARGET="psp"
Expand Down
31 changes: 25 additions & 6 deletions scripts/005-gcc-stage2.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,33 @@
#!/bin/bash
# gcc-stage2.sh by Francisco Javier Trujillo Mata ([email protected])
# 005-gcc-stage2.sh by pspdev developers

## Exit with code 1 when any command executed returns a non-zero exit code.
onerr()
{
exit 1;
}
trap onerr ERR

## Read information from the configuration file.
source "$(dirname "$0")/../config/psptoolchain-allegrex-config.sh"

## Download the source code.
REPO_URL="https://github.com/pspdev/gcc.git"
REPO_FOLDER="gcc"
BRANCH_NAME="allegrex-v11.2.0"
REPO_URL="$PSPTOOLCHAIN_ALLEGREX_GCC_REPO_URL"
REPO_REF="$PSPTOOLCHAIN_ALLEGREX_GCC_DEFAULT_REPO_REF"
REPO_FOLDER="$(s="$REPO_URL"; s=${s##*/}; printf "%s" "${s%.*}")"

# Checking if a specific Git reference has been passed in parameter $1
if test -n "$1"; then
REPO_REF="$1"
printf 'Using specified repo reference %s\n' "$REPO_REF"
fi

if test ! -d "$REPO_FOLDER"; then
git clone --depth 1 -b $BRANCH_NAME $REPO_URL && cd $REPO_FOLDER || { exit 1; }
git clone --depth 1 -b "$REPO_REF" "$REPO_URL" "$REPO_FOLDER"
else
cd $REPO_FOLDER && git fetch origin && git reset --hard origin/${BRANCH_NAME} || { exit 1; }
git -C "$REPO_FOLDER" fetch origin
git -C "$REPO_FOLDER" reset --hard "origin/$REPO_REF"
git -C "$REPO_FOLDER" checkout "$REPO_REF"
fi

TARGET="psp"
Expand Down

0 comments on commit 79cc010

Please sign in to comment.