add CI for psp
authorkub <derkub@gmail.com>
Fri, 16 Jun 2023 21:33:36 +0000 (21:33 +0000)
committerkub <derkub@gmail.com>
Fri, 16 Jun 2023 23:43:56 +0000 (23:43 +0000)
.github/workflows/ci-psp.yml [new file with mode: 0644]
configure
platform/psp/plat.c

diff --git a/.github/workflows/ci-psp.yml b/.github/workflows/ci-psp.yml
new file mode 100644 (file)
index 0000000..9682380
--- /dev/null
@@ -0,0 +1,20 @@
+name: CI (PSP)
+on: [push, pull_request]
+jobs:
+  build-linux:
+    runs-on: ubuntu-latest
+    steps:
+    - uses: actions/checkout@v2
+      with:
+        submodules: true
+    - name: Install dependencies
+      run: |
+        whoami
+        sudo apt-get update -qq
+        sudo apt-get install -y wget
+        wget https://github.com/pspdev/pspdev/releases/download/latest/pspdev-ubuntu-latest.tar.gz
+        tar -C /tmp/ -xf pspdev-ubuntu-latest.tar.gz
+    - name: configure
+      run: DUMP_CONFIG_LOG=1 PATH=$PATH:/tmp/pspdev/bin CROSS_COMPILE=psp- ./configure --platform=psp
+    - name: make
+      run: PATH=$PATH:/tmp/pspdev/bin CROSS_COMPILE=psp- make
index 9659793..7bbf52a 100755 (executable)
--- a/configure
+++ b/configure
@@ -149,7 +149,6 @@ set_platform()
     CFLAGS="$CFLAGS -D__PSP__"
     MFLAGS="-march=allegrex"
     ARCH=mipsel
-    need_zlib="yes"
     ;;
   *)
     fail "unsupported platform: $platform"
index e5b4cf5..cd4df5a 100644 (file)
@@ -321,15 +321,22 @@ end:
 
 /* stubs for libflac (embedded in libchdr) */
 #include <utime.h>
-#include <malloc.h>
 
 int chown(const char *pathname, uid_t owner, gid_t group) { return -1; }
 int chmod(const char *pathname, mode_t mode) { return -1; }
 int utime(const char *filename, const struct utimbuf *times) { return -1; }
-int posix_memalign(void **memptr, size_t alignment, size_t size)
-       { *memptr = memalign(alignment, size); return 0; }
 #endif
 
+#include <malloc.h>
+#include <errno.h>
+
+int posix_memalign(void **p, size_t align, size_t size)
+{
+       if (p)
+               *p = memalign(align, size);
+       return (p ? *p ? 0 : ENOMEM : EINVAL);
+}
+
 int _flush_cache (char *addr, const int size, const int op)
 {
        //sceKernelDcacheWritebackAll();