Skip to content

Commit eb6b702

Browse files
authored
Merge pull request #16 from ps2dev/update_2.31.1
Upgrade Binutils to 2.31.1
2 parents 49da578 + d750cd8 commit eb6b702

File tree

3 files changed

+21
-19
lines changed

3 files changed

+21
-19
lines changed

.github/workflows/compilation.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,16 @@ jobs:
1212
runs-on: ${{ matrix.os[0] }}
1313
strategy:
1414
matrix:
15-
os: [[macos-latest, bash], [ubuntu-latest, bash], [windows-latest, msys2]]
15+
os: [
16+
[macos-latest, arm64, bash],
17+
[macos-13, x86_64, bash],
18+
[ubuntu-latest, x86_64, bash],
19+
[windows-latest, x86_64, msys2]
20+
]
1621
fail-fast: false
1722
defaults:
1823
run:
19-
shell: ${{ matrix.os[1] }} {0}
24+
shell: ${{ matrix.os[2] }} {0}
2025

2126
steps:
2227
- uses: actions/checkout@v4
@@ -30,7 +35,7 @@ jobs:
3035
sudo apt-get -y install texinfo bison flex gettext libgmp3-dev libmpfr-dev libmpc-dev
3136
3237
- name: Install macOS packages
33-
if: matrix.os[0] == 'macos-latest'
38+
if: startsWith(matrix.os[0], 'macos')
3439
run: |
3540
brew update
3641
brew install texinfo bison flex gnu-sed gsl gmp mpfr libmpc

config/ps2toolchain-dvp-config.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash
22

33
PS2TOOLCHAIN_DVP_BINUTILS_REPO_URL="https://github.com/ps2dev/binutils-gdb.git"
4-
PS2TOOLCHAIN_DVP_BINUTILS_DEFAULT_REPO_REF="dvp-v2.14"
4+
PS2TOOLCHAIN_DVP_BINUTILS_DEFAULT_REPO_REF="dvp-v2.31.1"
55

66
if test -f "$PS2DEV_CONFIG_OVERRIDE"; then
77
source "$PS2DEV_CONFIG_OVERRIDE"

scripts/001-binutils.sh

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -36,20 +36,17 @@ TARGET_ALIAS="dvp"
3636
TARG_XTRA_OPTS=""
3737
OSVER=$(uname)
3838

39-
# setting lt_cv_sys_max_cmd_len works around ancient libtool bugs
40-
if [ "${OSVER:0:10}" == MINGW64_NT ]; then
41-
export lt_cv_sys_max_cmd_len=8000
42-
export CC=x86_64-w64-mingw32-gcc
43-
TARG_XTRA_OPTS="--host=x86_64-w64-mingw32"
44-
CFLAGS="$CFLAGS -DHAVE_DECL_ASPRINTF -DHAVE_DECL_VASPRINTF"
45-
elif [ "${OSVER:0:10}" == MINGW32_NT ]; then
46-
export lt_cv_sys_max_cmd_len=8000
47-
export CC=i686-w64-mingw32-gcc
48-
TARG_XTRA_OPTS="--host=i686-w64-mingw32"
49-
CFLAGS="$CFLAGS -DHAVE_DECL_ASPRINTF -DHAVE_DECL_VASPRINTF"
50-
elif [ "${OSVER:0:9}" == "CYGWIN_NT" ]; then
51-
export lt_cv_sys_max_cmd_len=8000
52-
TARG_XTRA_OPTS="--host=x86_64-pc-cygwin"
39+
## If using MacOS Apple, set gmp and mpfr paths using TARG_XTRA_OPTS
40+
## (this is needed for Apple Silicon but we will do it for all MacOS systems)
41+
if [ "$(uname -s)" = "Darwin" ]; then
42+
## Check if using brew
43+
if command -v brew &> /dev/null; then
44+
TARG_XTRA_OPTS="--with-gmp=$(brew --prefix gmp) --with-mpfr=$(brew --prefix mpfr)"
45+
fi
46+
## Check if using MacPorts
47+
if command -v port &> /dev/null; then
48+
TARG_XTRA_OPTS="--with-gmp=$(port -q prefix gmp) --with-mpfr=$(port -q prefix mpfr)"
49+
fi
5350
fi
5451

5552
## Determine the maximum number of processes that Make can work with.
@@ -72,7 +69,7 @@ for TARGET in "dvp"; do
7269
$TARG_XTRA_OPTS
7370

7471
## Compile and install.
75-
make --quiet -j "$PROC_NR" CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=0 -O2 -Wno-implicit-function-declaration" LDFLAGS="$LDFLAGS -s"
72+
make --quiet -j "$PROC_NR" CFLAGS="$CFLAGS -Wno-implicit-function-declaration"
7673
make --quiet -j "$PROC_NR" install
7774
make --quiet -j "$PROC_NR" clean
7875

0 commit comments

Comments
 (0)