Ok, here is what I do:
1) Build the core library with DEBUG flags enabled, you can try:
make DEBUG=1 platform=gcw0
Or put those CFLAGS manually in the Makefile.
2) Create a folder called 'retroarch' inside the SD Card, using an ftp client or the OPK Manager.
3) Copy the retroarch executable (not the OPK), and the libretro core there.
4) Connect through telnet to the gcw0
telnet 10.1.1.2
5) Browse to the retroarch folder and init the profiler with the following commands:
opcontrol --deinit
opcontrol --no-vmlinux
opcontrol --separate=kernel
opcontrol --init
opcontrol --reset
opcontrol --start
6) Then, also from telnet, start retroarch:
./retroarch -L catsfc_libretro.so "roms/Mega Man X (Version 1.0).sfc"
I like to load a rom directly to skip the rgui menu.
7) Then let the game run for a couple of minutes, and then exit retroarch by pressing Select.
8 ) Finally stop the profiler and check the results:
opcontrol --stop
opreport -l ./retroarch
opcontrol --deinit
About the Makefile, I think you are missing the CXX compiler.
else ifeq ($(platform), gcw0)
TARGET := $(TARGET_NAME)_libretro.so
CC = /opt/gcw0-toolchain/usr/bin/mipsel-linux-gcc
CXX = /opt/gcw0-toolchain/usr/bin/mipsel-linux-g++
AR = /opt/gcw0-toolchain/usr/bin/mipsel-linux-ar
fpic := -fPIC
SHARED := -shared -Wl,--no-undefined -Wl,--version-script=link.T
LDFLAGS += $(PTHREAD_FLAGS) -lrt
FLAGS += $(PTHREAD_FLAGS) -DHAVE_MKDIR
FLAGS += -march=mips32 -mtune=mips32r2 -mhard-float
It will be interesting to see the profiler report from the pcsx1 and the jaguar cores.