libretro / parallel-n64

Optimized/rewritten Nintendo 64 emulator made specifically for Libretro. Originally based on Mupen64 Plus.
319 stars 127 forks source link

Pinebook Pro build #633

Open louisabraham opened 4 years ago

louisabraham commented 4 years ago

Hi,

I'm trying to install parallel-n64 on manjaro ARM. I first tried https://aur.archlinux.org/libretro-parallel-n64-git.git and got an error. Then I tried compiling with make and got the same error:

/usr/bin/ld: ./mupen64plus-core/src/r4300/recomp.o: in function `init_block':
recomp.c:(.text+0x5f58): undefined reference to `free_assembler'
/usr/bin/ld: recomp.c:(.text+0x608c): undefined reference to `init_assembler'
/usr/bin/ld: ./mupen64plus-core/src/r4300/recomp.o: in function `recompile_block':
recomp.c:(.text+0x674c): undefined reference to `passe2'
/usr/bin/ld: recomp.c:(.text+0x6794): undefined reference to `free_assembler'
/usr/bin/ld: recomp.c:(.text+0x67d8): undefined reference to `init_assembler'
collect2: error: ld returned 1 exit status
make: *** [Makefile:971: parallel_n64_libretro.so] Error 1
[louisabraham@pbp parallel-n64]$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/aarch64-unknown-linux-gnu/9.2.0/lto-wrapper
Target: aarch64-unknown-linux-gnu
Configured with: /build/gcc/src/gcc/configure --prefix=/usr --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=https://github.com/archlinuxarm/PKGBUILDs/issues --enable-languages=c,c++,fortran,go,lto,objc,obj-c++,d --enable-shared --enable-threads=posix --with-system-zlib --with-isl --enable-__cxa_atexit --disable-libunwind-exceptions --enable-clocale=gnu --disable-libstdcxx-pch --disable-libssp --enable-gnu-unique-object --enable-linker-build-id --enable-lto --enable-plugin --enable-install-libiberty --with-linker-hash-style=gnu --enable-gnu-indirect-function --disable-multilib --disable-werror --enable-checking=release --enable-default-pie --enable-default-ssp --host=aarch64-unknown-linux-gnu --build=aarch64-unknown-linux-gnu --with-arch=armv8-a --enable-fix-cortex-a53-835769 --enable-fix-cortex-a53-843419 gdc_include_dir=/usr/include/dlang/gdc
Thread model: posix
gcc version 9.2.0 (GCC) 
[louisabraham@pbp parallel-n64]$ ld -v
GNU ld (GNU Binutils) 2.33.1
louisabraham commented 4 years ago

Trying to diagnose this made me discover that block

https://github.com/libretro/parallel-n64/blob/5939f440d59ec16b37efba89f225a20a416424cd/mupen64plus-core/src/r4300/empty_dynarec.c#L27-L41

It looks like the Makefile doesn't detect that I'm on ARM.

Furthermore, there is a misplaced endif here https://github.com/libretro/parallel-n64/blob/4db122987d6d47b8e865d42a16a502c95f04e008/Makefile#L245 that disables the detection of platform=armv8

As the build is made on my machine, I also changed

CC = gcc
CXX = g++

I could then compile with make platform=armv8 and install with cp parallel_n64_libretro.so /usr/lib/libretro/.

However, the core crashes when I load Zelda.

I'm using a Pinebook Pro, that supports OpenGL.

Could you orient me so that I can test good build options?

louisabraham commented 4 years ago

This is the info of the coredump:

           PID: 64982 (retroarch)
           UID: 1000 (louisabraham)
           GID: 1000 (louisabraham)
        Signal: 11 (SEGV)
     Timestamp: Sun 2020-03-22 22:30:45 CET (4min 16s ago)
  Command Line: retroarch --menu --verbose
    Executable: /usr/bin/retroarch
 Control Group: /user.slice/user-1000.slice/session-c2.scope
          Unit: session-c2.scope
         Slice: user-1000.slice
       Session: c2
     Owner UID: 1000 (louisabraham)
       Boot ID: b3467db472c045a69274ad4f2baa09ec
    Machine ID: e50553af412343349e99fa1a88459084
      Hostname: pbp
       Storage: /var/lib/systemd/coredump/core.retroarch.1000.b3467db472c045a69274ad4f2baa09ec.64982.1584912645000000000000.lz4
       Message: Process 64982 (retroarch) of user 1000 dumped core.

                Stack trace of thread 64982:
                #0  0x0000000000000000 n/a (n/a + 0x0)
                #1  0x0000ffff77abe24c glsm_ctl (parallel_n64_libretro.so + 0xfe24c)
                #2  0x0000ffff7839c3a8 default_framebuffer (parallel_n64_libretro.so + 0x9dc3a8)
mrfixit2001 commented 4 years ago

FWIW - This will be included in my next reelease of recalbox for the PBP. Seems to compile fine, but so far I've only tested it on Rk3328.

louisabraham commented 4 years ago

Oops, wrong button.

@mrfixit2001 First, thank you so much for what you do! Any idea about how I could compile it on arch?

mrfixit2001 commented 4 years ago

No worries!

I'm compiling it in 32-bit (with 64-bit kernel), so perhaps the dynarec doesn't support aarch64?

You will also need this patch to make it work with MESA:

MRFIXIT: Fix upstream compatibility
--- a/libretro-common/include/glsm/glsm.h
+++ b/libretro-common/include/glsm/glsm.h
@@ -32,7 +32,7 @@
 RETRO_BEGIN_DECLS

 #ifdef HAVE_OPENGLES2
-typedef GLfloat GLdouble;
+typedef double GLdouble;
 typedef GLclampf GLclampd;
 #endif
Chips-fr commented 4 years ago

I come to close issue as you, the detection of platform=armv8 (armv on my side) wasn't working. I came to conlusion that it was due to wrong else in makefile: https://github.com/libretro/parallel-n64/blob/4db122987d6d47b8e865d42a16a502c95f04e008/Makefile#L248

EDIT: PR has been merged here: https://github.com/libretro/parallel-n64/commit/82c352e27049ae39e30c8d1cffabec6cbc581a3c

louisabraham commented 4 years ago

Hi, I still get segfault. Any update?