aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorspicyjpeg <thatspicyjpeg@gmail.com>2023-04-06 00:40:22 +0200
committerspicyjpeg <thatspicyjpeg@gmail.com>2023-04-06 00:40:22 +0200
commit0a797d2964517ac88e818b0741c5e7674c6fa018 (patch)
treea2cbe42662bd794734675b16c1a1926d0dbec825
parentb4242acc35c522bd4d4a951a84933ba6f80d2015 (diff)
Update binutils and mkpsxiso, enable GCC STL headers
-rw-r--r--.github/workflows/build.yml18
-rw-r--r--CHANGELOG.md41
-rw-r--r--doc/toolchain.md42
m---------tools/mkpsxiso0
m---------tools/tinyxml20
5 files changed, 76 insertions, 25 deletions
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 71417c1..879c72a 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -1,5 +1,5 @@
# PSn00bSDK GitHub Actions CI script
-# (C) 2021 spicyjpeg - MPL licensed
+# (C) 2021-2023 spicyjpeg - MPL licensed
# The GCC toolchain is stored in the GitHub Actions cache after being built. To
# minimize build times, all the toolchain build steps are skipped if there is a
@@ -10,9 +10,11 @@
name: Build PSn00bSDK
on: [ push, pull_request ]
env:
- BINUTILS_VERSION: 2.39
- GCC_VERSION: 12.2.0
- GCC_TARGET: mipsel-none-elf
+ BINUTILS_VERSION: '2.40'
+ BINUTILS_OPTIONS: '--disable-docs --disable-nls --disable-werror --with-float=soft'
+ GCC_VERSION: '12.2.0'
+ GCC_OPTIONS: '--disable-docs --disable-nls --disable-werror --disable-libada --disable-libssp --disable-libquadmath --disable-threads --disable-libgomp --disable-libstdcxx-pch --disable-hosted-libstdcxx --enable-languages=c,c++ --without-isl --without-headers --with-float=soft --with-gnu-as --with-gnu-ld'
+ GCC_TARGET: 'mipsel-none-elf'
jobs:
# This is based on doc/toolchain.md, no surprises here other than the cache.
@@ -52,7 +54,7 @@ jobs:
run: |
mkdir binutils_linux
cd binutils_linux
- ../binutils-${{ env.BINUTILS_VERSION }}/configure --prefix=${{ github.workspace }}/gcc/linux --target=${{ env.GCC_TARGET }} --disable-docs --disable-nls --with-float=soft
+ ../binutils-${{ env.BINUTILS_VERSION }}/configure --prefix=${{ github.workspace }}/gcc/linux --target=${{ env.GCC_TARGET }} ${{ env.BINUTILS_OPTIONS }}
make -j 2
make install-strip
echo "${{ github.workspace }}/gcc/linux/bin" >>$GITHUB_PATH
@@ -62,7 +64,7 @@ jobs:
run: |
mkdir gcc_linux
cd gcc_linux
- ../gcc-${{ env.GCC_VERSION }}/configure --prefix=${{ github.workspace }}/gcc/linux --target=${{ env.GCC_TARGET }} --disable-docs --disable-nls --disable-libada --disable-libssp --disable-libquadmath --disable-libstdc++-v3 --with-float=soft --enable-languages=c,c++ --with-gnu-as --with-gnu-ld
+ ../gcc-${{ env.GCC_VERSION }}/configure --prefix=${{ github.workspace }}/gcc/linux --target=${{ env.GCC_TARGET }} ${{ env.GCC_OPTIONS }}
make -j 2
make install-strip
@@ -71,7 +73,7 @@ jobs:
run: |
mkdir binutils_windows
cd binutils_windows
- ../binutils-${{ env.BINUTILS_VERSION }}/configure --prefix=${{ github.workspace }}/gcc/windows --build=x86_64-linux-gnu --host=x86_64-w64-mingw32 --target=${{ env.GCC_TARGET }} --disable-docs --disable-nls --with-float=soft
+ ../binutils-${{ env.BINUTILS_VERSION }}/configure --prefix=${{ github.workspace }}/gcc/windows --build=x86_64-linux-gnu --host=x86_64-w64-mingw32 --target=${{ env.GCC_TARGET }} ${{ env.BINUTILS_OPTIONS }}
make -j 2
make install-strip
@@ -80,7 +82,7 @@ jobs:
run: |
mkdir gcc_windows
cd gcc_windows
- ../gcc-${{ env.GCC_VERSION }}/configure --prefix=${{ github.workspace }}/gcc/windows --build=x86_64-linux-gnu --host=x86_64-w64-mingw32 --target=${{ env.GCC_TARGET }} --disable-docs --disable-nls --disable-libada --disable-libssp --disable-libquadmath --disable-libstdc++-v3 --with-float=soft --enable-languages=c,c++ --with-gnu-as --with-gnu-ld
+ ../gcc-${{ env.GCC_VERSION }}/configure --prefix=${{ github.workspace }}/gcc/windows --build=x86_64-linux-gnu --host=x86_64-w64-mingw32 --target=${{ env.GCC_TARGET }} ${{ env.GCC_OPTIONS }}
make -j 2
make install-strip
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 5fa49db..e02f33d 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -19,6 +19,47 @@ to ensure the changelog can be parsed correctly.
-------------------------------------------------------------------------------
+## 2023-04-05: 0.23
+
+spicyjpeg:
+
+- libc: Fixed bugs in some string manipulation and number parsing functions.
+ Added `memccpy()`. Removed the `SYSTEM.CNF` argument parser as it would
+ interfere with manual argc/argv passing in some edge cases.
+
+- psxgpu: Added `IsIdleGPU()` and fixed a bug in `SetVideoMode()`. Added new
+ "tagless" primitive structures with the `_T` suffix (e.g. `POLY_FT4_T`,
+ `SPRT_T`, ...) and related macros (`setPolyFT4_T()`, `setSPRT_T()`, ...) that
+ can be used to group multiple primitives into a single display list packet
+ for better performance. Fixed some macros not working properly with negative
+ values. Renamed `DR_MASK` and `setDrawMask()` to `DR_STP` and `setDrawStp()`
+ respectively for consistency with the official SDK.
+
+- psxcd: Added `CdUnlock()`. Improved reliability of `CdGetRegion()` on early
+ Japanese console models.
+
+- psxetc: Added `SetDMAPriority()` and `GetDMAPriority()`.
+
+- psxapi: Added PCDRV (host file I/O) API, declared in the `psxsn.h` header.
+
+- psxpress: Fixed bugs in the MDEC API. Added support for bitstream version 3
+ to the GTE-accelerated decoder. Replaced `DecDCTvlcCopyTable()` with
+ `DecDCTvlcCopyTableV2()` and `DecDCTvlcCopyTableV3()` for better control over
+ how much of the scratchpad is used for lookup tables.
+
+- examples: `mdec/strvideo` is now (finally) functional on real hardware and
+ can properly detect the end of a video file even if immediately followed by
+ another video on the disc. Added previously missing CD image dependencies to
+ the CMake scripts of the examples that make use of CD images.
+
+- tools: `elf2x` no longer adds region strings to converted executables, fixing
+ issues with DuckStation's region autodetection. Updated `mkpsxiso` to 2.03 in
+ order to fix a bug with its thread pool implementation on Linux.
+
+- Updated binutils and recompiled the GCC toolchain with the
+ `--disable-hosted-libstdcxx` option, allowing a subset of the C++ STL to be
+ used in PSn00bSDK projects.
+
## 2022-12-18: 0.22
spicyjpeg:
diff --git a/doc/toolchain.md b/doc/toolchain.md
index 8e28c24..9b65720 100644
--- a/doc/toolchain.md
+++ b/doc/toolchain.md
@@ -28,6 +28,7 @@ tested extensively:
- ~~GCC 7.4.0 with binutils 2.31~~ (the linker fails to build PS1 DLLs)
- GCC **11.1.0** with binutils **2.36**
- GCC **11.2.0** with binutils **2.37**
+- GCC **12.2.0** with binutils **2.40**
If you wish to pick an older GCC release but don't know which binutils version
it requires, see [here](https://wiki.osdev.org/Cross-Compiler_Successful_Builds)
@@ -78,7 +79,7 @@ for a compatibility table.
```bash
../binutils-<VERSION>/configure \
--prefix=/usr/local/mipsel-none-elf --target=mipsel-none-elf \
- --disable-docs --disable-nls --with-float=soft
+ --disable-docs --disable-nls --disable-werror --with-float=soft
```
Replace `<VERSION>` as usual. If you don't want to install the toolchain into
@@ -117,9 +118,11 @@ options.
```bash
../gcc-<VERSION>/configure \
--prefix=/usr/local/mipsel-none-elf --target=mipsel-none-elf \
- --disable-docs --disable-nls --disable-libada --disable-libssp \
- --disable-libquadmath --disable-libstdc++-v3 --with-float=soft \
- --enable-languages=c,c++ --with-gnu-as --with-gnu-ld
+ --disable-docs --disable-nls --disable-werror --disable-libada \
+ --disable-libssp --disable-libquadmath --disable-threads \
+ --disable-libgomp --disable-libstdcxx-pch --disable-hosted-libstdcxx \
+ --enable-languages=c,c++ --without-isl --without-headers \
+ --with-float=soft --with-gnu-as --with-gnu-ld
```
If you previously set a custom installation path, remember to set it here as
@@ -172,7 +175,7 @@ that runs on Windows.
../binutils-<VERSION>/configure \
--build=x86_64-linux-gnu --host=x86_64-w64-mingw32 \
--prefix=/tmp/mipsel-none-elf --target=mipsel-none-elf \
- --disable-docs --disable-nls --with-float=soft
+ --disable-docs --disable-nls --disable-werror --with-float=soft
```
Then build binutils again:
@@ -187,10 +190,12 @@ that runs on Windows.
```bash
../gcc-<VERSION>/configure \
--build=x86_64-linux-gnu --host=x86_64-w64-mingw32 \
- --prefix=/tmp/mipsel-none-elf --target=mipsel-none-elf \
- --disable-docs --disable-nls --disable-libada --disable-libssp \
- --disable-libquadmath --disable-libstdc++-v3 --with-float=soft \
- --enable-languages=c,c++ --with-gnu-as --with-gnu-ld
+ --prefix=/usr/local/mipsel-none-elf --target=mipsel-none-elf \
+ --disable-docs --disable-nls --disable-werror --disable-libada \
+ --disable-libssp --disable-libquadmath --disable-threads \
+ --disable-libgomp --disable-libstdcxx-pch --disable-hosted-libstdcxx \
+ --enable-languages=c,c++ --without-isl --without-headers \
+ --with-float=soft --with-gnu-as --with-gnu-ld
```
And build it as usual:
@@ -211,14 +216,17 @@ that runs on Windows.
## Note regarding C++ support
-C++ support in PSn00bSDK, besides compile-time features like `constexpr`, only
-goes as far as basic classes, namespaces and the ability to dynamically create
-and delete class objects at any point of the program. The required dependencies
-(which are just wrappers around `malloc()` and `free()`) are supplied by `libc`.
+C++ support in PSn00bSDK is limited to the freestanding subset of the standard
+library provided by GCC, which includes most metaprogramming and compile-time
+utilities but not higher level functionality that requires runtime support such
+as exceptions, containers or streams. Basic C++ features that only depend on the
+compiler (classes, templates, `constexpr` and so on) are fully supported.
-Standard C++ libraries are not implemented and likely never going to be
-implemented due to bloat concerns that it may introduce. Besides, the official
-SDK lacks full C++ support as well.
+Implementing a full STL, while technically possible, is currently out of the
+scope of PSn00bSDK. There are other PS1 SDKs that provide an STL, such as
+[psyqo](https://github.com/grumpycoders/pcsx-redux/tree/main/src/mips/psyqo),
+and they might be a better fit for your project if you plan to make heavy use of
+C++ features.
-----------------------------------------
-_Last updated on 2021-11-23 by spicyjpeg_
+_Last updated on 2023-04-05 by spicyjpeg_
diff --git a/tools/mkpsxiso b/tools/mkpsxiso
-Subproject 7bcb4ad2086a8004da32d0ee2289093ed8d4872
+Subproject 9f6275f08829ea9de8122c8232a019e8724acbb
diff --git a/tools/tinyxml2 b/tools/tinyxml2
-Subproject e45d9d16d430a3f5d3eee9fe40d5e194e1e5e63
+Subproject e05956094c27117f989d22f25b75633123d72a8