Skip to content

Instantly share code, notes, and snippets.

@wolfallein
Last active May 29, 2020 20:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wolfallein/e8fb3fae57554715db70cadcbd857092 to your computer and use it in GitHub Desktop.
Save wolfallein/e8fb3fae57554715db70cadcbd857092 to your computer and use it in GitHub Desktop.
Compiling retroarch cores for clockworkpi

Retroarch configuration:

CFLAGS=-mfpu=neon ./configure --enable-alsa --enable-udev --enable-floathard --enable-neon --enable-ffmpeg --enable-networking --enable-opengles --enable-egl --enable-kms --disable-x11 --prefix=/usr

Snes9x2002

git clone https://github.com/libretro/snes9x2002.git
make -j4 platform=classic_armv7_a7

Mupem64

If lima driver is installed, change in Makefile GLES=1

git clone https://github.com/libretro/mupen64plus-libretro-nx.git
make -j4 platform=unix_armv_neon_hardfloat

Picodrive

git clone https://github.com/libretro/picodrive.git --depth=1
make -f Makefile.libretro -j4 platform=classic_armv7_a7

Nestopia

git clone https://github.com/libretro/nestopia.git
cd nestopia/libretro
make -j4 platform=classic_armv7_a7

mgba

git clone https://github.com/libretro/mgba.git
cd mgba
make -j4 platform=classic_armv7_a7

Pcsx rearmed

git clone https://github.com/libretro/pcsx_rearmed.git
cd pcsx_rearmed
make -f Makefile.libretro -j4 platform=rpi2

Flycast

core not working

git clone https://github.com/libretro/flycast.git
cd flycast
make -j4 platform=rpi2

Parallell64

git clone https://github.com/libretro/parallel-n64.git
cd parallel-n64
make -j4 platform=rpi2_mesa

comment line 35 in libretro-common/include/glsm/glsm.h

//typedef double GLdouble

if you get

./libretro-common/include/glsm/glsm.h:35:17: error: conflicting types for ‘GLdouble’
 typedef GLfloat GLdouble;
                 ^~~~~~~~
In file included from ./libretro-common/include/glsym/rglgen_headers.h:56,
                 from ./libretro-common/include/glsm/glsm.h:30,
                 from ./libretro-common/include/glsm/glsmsym.h:26,
                 from mupen64plus-core/src/api/vidext_libretro.c:41:
/usr/include/GLES2/gl2ext.h:2947:16: note: previous declaration of ‘GLdouble’ was here
 typedef double GLdouble;
                ^~~~~~~~
make: *** [Makefile:932: mupen64plus-core/src/api/vidext_libretro.o] Error 1

libretro/libretro-common#98


GCC compile flags:

Difference between -mtune -march and -mcpu https://community.arm.com/developer/tools-software/tools/b/tools-software-ides-blog/posts/compiler-flags-across-architectures-march-mtune-and-mcpu

-march=X: Tells the compiler that X is the minimal architecture the binary must run on.  The compiler is free to use architecture-specific instructions.  This flag behaves differently on Arm and x86.  On Arm, -march does not override -mtune, but on x86 -march will override both -mtune and -mcpu.
-mtune=X: Tells the compiler to optimize for microarchitecture X but does not allow the compiler to change the ABI or make assumptions about available instructions.  This flag has the more-or-less the same meaning on Arm and x86. 
-mcpu=X: On Arm, this flag is a combination of -march and -mtune.  It simultaneously specifies the target architecture and optimizes for a given microarchitecture.  On x86 this flag is a deprecated synonym for -mtune.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment