[ALSMOST SOLVED] Error trying to compile scummvm libretro

Hi,

All other libretro ports I’ve compiled for the Pi built fine. However, this one’s resisting :slight_smile: I cloned this repo:

git clone https://github.com/libretro/scummvm.git

Then in cd into:

backends/platform/libretro/build

and run “make -f Makefile platform=armv6e”, wich ultimately stops with this error:


../../../../backends/platform/libretro/os.cpp: In function ‘OSystem* retroBuildOS()’:
../../../../backends/platform/libretro/os.cpp:766:30: error: cannot allocate an object of abstract type ‘OSystem_RETRO’
../../../../backends/platform/libretro/os.cpp:144:7: note:   because the following virtual functions are pure within ‘OSystem_RETRO’:
../../../../common/system.h:900:17: note:     virtual uint32 OSystem::getMillis(bool)
distcc[2123] ERROR: compile ../../../../backends/platform/libretro/os.cpp on localhost failed

Any ideas on what am I doing wrong?

I just pushed a fix.

Thanks, meancoot. Almost there, but not quite…It fails compilation on ARM hardware because of libco, it seems.


/usr/lib/gcc/arm-linux-gnueabihf/4.6/../../../arm-linux-gnueabihf/crt1.o: In function `_start':
(.text+0x34): undefined reference to `main'
backends/platform/libretro/libco/libco.o: In function `co_switch':
libco.cpp:(.text+0xd4): undefined reference to `co_switch_arm'
collect2: ld returned 1 exit status
distcc[10245] ERROR: compile (null) on localhost failed
make: *** [scummvm_libretro.so] Error 1


Hopefully that last commit will do it. The assembly file needed for co_swtich_arm wasn’t being included. I’ve tested it to build on iOS and android so it should be good.

Thanks again, meancoot. I got this error this time:


../../../../backends/platform/libretro/libco/armeabi.c: In function ‘void* co_create(unsigned int, void (*)())’:
../../../../backends/platform/libretro/libco/armeabi.c:35:38: error: ‘memalign’ was not declared in this scope

so I went and added #include <malloc.h> in the beginning of backends/platform/libretro/libco/armeabi.c It seems to compile now, but I don’t really know if this is an optimal solution…

EDIT: No, it won’t compile after adding the include.


/usr/lib/gcc/arm-linux-gnueabihf/4.6/../../../arm-linux-gnueabihf/crt1.o: In function `_start':
(.text+0x34): undefined reference to `main'
collect2: ld returned 1 exit status

In the Makefile could you try replacing the line

SHARED := -shared -Wl,--no-undefined

with

LDFLAGS += -shared -Wl,--no-undefined

and see if that works? It may be necessary to add -fPIC to the end of the line too.

That made it, meancoot! It compiled and now it’s working.

Thanks a lot.

[EDIT] It segfaults when trying to save a game, and with Mac and FM Towns versions of the games when starting a game. Saving a game is impossible for now.

I have compiled this same libretro port today, just in X86 (Intel graphics RetroArch running on EGL+KMS) and it works right.

So, the next problems just happen on ARM Rpi: -Saving a game on Monkey Island causes a segfault. Even autosaving does. -GOB engine causes a segfault when loading any game.

Should I copy these reports to the github issues list? Thanks

That’s probably a good place for them, so they don’t get lost in the shuffle here.

ok, hunterk, but I can’t see an “issues” button on scummvm libretro port git repository. Am I supposed to be able to do it? Other repos have such a button.

Github doesn’t give forks their own issue tracker for some reason, and reporting upstream won’t get you anywhere. I plan to do a bug hunt/refresh of the ScummVM port in the next couple of days though.