Skip to content

Commit

Permalink
Dont mix gcc stage 1 and stage 2
Browse files Browse the repository at this point in the history
  • Loading branch information
fjtrujy committed May 28, 2024
1 parent a92f3d5 commit cf148d5
Show file tree
Hide file tree
Showing 5 changed files with 64 additions and 37 deletions.
14 changes: 7 additions & 7 deletions scripts/001-binutils.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
# 001-binutils.sh by pspdev developers
# binutils by pspdev developers

## Exit with code 1 when any command executed returns a non-zero exit code.
onerr()
Expand Down Expand Up @@ -52,7 +52,7 @@ fi
PROC_NR=$(getconf _NPROCESSORS_ONLN)

## Create and enter the toolchain/build directory
rm -rf build-$TARGET && mkdir build-$TARGET && cd build-$TARGET || { exit 1; }
rm -rf build-$TARGET && mkdir build-$TARGET && cd build-$TARGET

## Build GDB without python support when built with a GitHub Action
## This makes the pre-build executable work on more systems
Expand All @@ -71,10 +71,10 @@ fi
--disable-initfini-array \
--with-python="$WITH_PYTHON" \
--disable-werror \
$TARG_XTRA_OPTS || { exit 1; }
$TARG_XTRA_OPTS

## Compile and install.
make --quiet -j $PROC_NR clean || { exit 1; }
make --quiet -j $PROC_NR || { exit 1; }
make --quiet -j $PROC_NR install-strip || { exit 1; }
make --quiet -j $PROC_NR clean || { exit 1; }
make --quiet -j $PROC_NR clean
make --quiet -j $PROC_NR all
make --quiet -j $PROC_NR install-strip
make --quiet -j $PROC_NR clean
34 changes: 24 additions & 10 deletions scripts/002-gcc-stage1.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
# 002-gcc-stage1.sh by pspdev developers
# gcc-stage1 by pspdev developers

## Exit with code 1 when any command executed returns a non-zero exit code.
onerr()
Expand All @@ -8,6 +8,16 @@ onerr()
}
trap onerr ERR

## Create a temporal folder where to build the phase 1 of the toolchain.
TMP_TOOLCHAIN_BUILD_DIR=$(pwd)/tmp_toolchain_build
rm -rf $TMP_TOOLCHAIN_BUILD_DIR && mkdir $TMP_TOOLCHAIN_BUILD_DIR
## Copy toolchain content ($PSPDEV) to the temporal folder.
cp -r $PSPDEV/* $TMP_TOOLCHAIN_BUILD_DIR

## Add the toolchain to the PATH.
export PATH="$TMP_TOOLCHAIN_BUILD_DIR/bin:$PATH"


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

Expand Down Expand Up @@ -51,24 +61,28 @@ if [ "$(uname -s)" = "Darwin" ]; then
fi

## Create and enter the toolchain/build directory
rm -rf mkdir build-$TARGET-stage1 && mkdir build-$TARGET-stage1 && cd build-$TARGET-stage1 || { exit 1; }
rm -rf build-$TARGET-stage1 && mkdir build-$TARGET-stage1 && cd build-$TARGET-stage1

## Configure the build.
../configure \
--quiet \
--prefix="$PSPDEV" \
--prefix="$TMP_TOOLCHAIN_BUILD_DIR" \
--target="$TARGET" \
--enable-languages="c" \
--with-float=hard \
--with-headers=no \
--without-newlib \
--disable-libatomic \
--disable-libgcc \
--disable-shared \
--disable-threads \
--disable-libssp \
--disable-multilib \
$TARG_XTRA_OPTS || { exit 1; }
--disable-libgomp \
--disable-libmudflap \
--disable-libquadmath \
$TARG_XTRA_OPTS

## Compile and install.
make --quiet -j $PROC_NR clean || { exit 1; }
make --quiet -j $PROC_NR all || { exit 1; }
make --quiet -j $PROC_NR install-strip || { exit 1; }
make --quiet -j $PROC_NR clean || { exit 1; }
make --quiet -j $PROC_NR clean
make --quiet -j $PROC_NR all-gcc
make --quiet -j $PROC_NR install-gcc
make --quiet -j $PROC_NR clean
22 changes: 15 additions & 7 deletions scripts/003-newlib.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
# 003-newlib.sh by pspdev developers
# newlib by pspdev developers

## Exit with code 1 when any command executed returns a non-zero exit code.
onerr()
Expand All @@ -8,6 +8,11 @@ onerr()
}
trap onerr ERR

## Create a temporal folder where to build the phase 1 of the toolchain.
TMP_TOOLCHAIN_BUILD_DIR=$(pwd)/tmp_toolchain_build
## Add the toolchain to the PATH.
export PATH="$TMP_TOOLCHAIN_BUILD_DIR/bin:$PATH"

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

Expand Down Expand Up @@ -38,7 +43,7 @@ TARGET="psp"
PROC_NR=$(getconf _NPROCESSORS_ONLN)

# Create and enter the toolchain/build directory
rm -rf build-$TARGET && mkdir build-$TARGET && cd build-$TARGET || { exit 1; }
rm -rf build-$TARGET && mkdir build-$TARGET && cd build-$TARGET

# Configure the build.
../configure \
Expand All @@ -49,10 +54,13 @@ rm -rf build-$TARGET && mkdir build-$TARGET && cd build-$TARGET || { exit 1; }
--enable-newlib-io-c99-formats \
--enable-newlib-iconv \
--enable-newlib-iconv-encodings=us_ascii,utf8,utf16,ucs_2_internal,ucs_4_internal,iso_8859_1 \
$TARG_XTRA_OPTS || { exit 1; }
$TARG_XTRA_OPTS

## Compile and install.
make --quiet -j $PROC_NR clean || { exit 1; }
make --quiet -j $PROC_NR all || { exit 1; }
make --quiet -j $PROC_NR install-strip || { exit 1; }
make --quiet -j $PROC_NR clean || { exit 1; }
make --quiet -j $PROC_NR clean
make --quiet -j $PROC_NR all
make --quiet -j $PROC_NR install-strip
make --quiet -j $PROC_NR clean

## Copy contents of the toolchain to the temporal folder.
cp -r $PSPDEV/* $TMP_TOOLCHAIN_BUILD_DIR
17 changes: 11 additions & 6 deletions scripts/004-pthread-embedded.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
# 004-pthread-embeedded.sh by pspdev developers
# pthread-embeedded by pspdev developers

## Exit with code 1 when any command executed returns a non-zero exit code.
onerr()
Expand All @@ -8,6 +8,11 @@ onerr()
}
trap onerr ERR

## Temporal folder where to build the phase 1 of the toolchain.
TMP_TOOLCHAIN_BUILD_DIR=$(pwd)/tmp_toolchain_build
## Add the toolchain to the PATH.
export PATH="$TMP_TOOLCHAIN_BUILD_DIR/bin:$PATH"

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

Expand Down Expand Up @@ -37,10 +42,10 @@ TARGET="psp"
## Determine the maximum number of processes that Make can work with.
PROC_NR=$(getconf _NPROCESSORS_ONLN)

cd platform/psp || { exit 1; }
cd platform/psp

## Compile and install.
make --quiet -j $PROC_NR clean || { exit 1; }
make --quiet -j $PROC_NR all || { exit 1; }
make --quiet -j $PROC_NR install || { exit 1; }
make --quiet -j $PROC_NR clean || { exit 1; }
make --quiet -j $PROC_NR clean
make --quiet -j $PROC_NR all
make --quiet -j $PROC_NR install
make --quiet -j $PROC_NR clean
14 changes: 7 additions & 7 deletions scripts/005-gcc-stage2.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
# 005-gcc-stage2.sh by pspdev developers
# gcc-stage2 by pspdev developers

## Exit with code 1 when any command executed returns a non-zero exit code.
onerr()
Expand Down Expand Up @@ -51,7 +51,7 @@ if [ "$(uname -s)" = "Darwin" ]; then
fi

## Create and enter the toolchain/build directory
rm -rf build-$TARGET-stage2 && mkdir build-$TARGET-stage2 && cd build-$TARGET-stage2 || { exit 1; }
rm -rf build-$TARGET-stage2 && mkdir build-$TARGET-stage2 && cd build-$TARGET-stage2

## Configure the build.
../configure \
Expand All @@ -65,10 +65,10 @@ rm -rf build-$TARGET-stage2 && mkdir build-$TARGET-stage2 && cd build-$TARGET-st
--disable-multilib \
--enable-threads=posix \
MAKEINFO=missing \
$TARG_XTRA_OPTS || { exit 1; }
$TARG_XTRA_OPTS

## Compile and install.
make --quiet -j $PROC_NR clean || { exit 1; }
make --quiet -j $PROC_NR all || { exit 1; }
make --quiet -j $PROC_NR install-strip || { exit 1; }
make --quiet -j $PROC_NR clean || { exit 1; }
make --quiet -j $PROC_NR clean
make --quiet -j $PROC_NR all
make --quiet -j $PROC_NR install-strip
make --quiet -j $PROC_NR clean

0 comments on commit cf148d5

Please sign in to comment.