Hi, I’m trying to build a working dosbox core for Pi2, but I always get one that segfaults immediately, no matter what.
pi@raspberrypi:~/retro $ ./retroarch_dbg -v -L cores/dosbox_libretro.so prehist2/PRE2.EXE RetroArch [INFO] :: === Build =======================================RetroArch [INFO] :: [CPUID]: Features: Built: Feb 28 2016 RetroArch [INFO] :: Version: 1.3.0 RetroArch [INFO] :: Git: 5e4e30a RetroArch [INFO] :: ================================================= RetroArch [INFO] :: [CPUID]: Features: RetroArch [INFO] :: Looking for config in: “/home/pi/.config/retroarch/retroarch.cfg”. RetroArch [WARN] :: SYSTEM DIR is empty, assume CONTENT DIR RetroArch [INFO] :: Config: loading config from: /home/pi/.config/retroarch/retroarch.cfg. RetroArch [INFO] :: Loading dynamic libretro core from: “/home/pi/retro/cores/dosbox_libretro.so” RetroArch [INFO] :: Overrides: no core-specific overrides found at /home/pi/.config/retroarch/DOSBox/DOSBox.cfg RetroArch [INFO] :: Overrides: no game-specific overrides found at /home/pi/.config/retroarch/DOSBox/PRE2.cfg RetroArch [INFO] :: Environ SET_SUPPORT_NO_GAME: no. RetroArch [INFO] :: Environ SET_VARIABLES. RetroArch [INFO] :: Environ SET_CONTROLLER_INFO. RetroArch [INFO] :: Controller port: 1 RetroArch [INFO] :: Gamepad (2buttons) (ID: 517) RetroArch [INFO] :: Gamepad (4buttons) (ID: 1285) RetroArch [INFO] :: Joystick (2axis/2buttons) (ID: 261) RetroArch [INFO] :: Joystick (4axis/4buttons) (ID: 1029) RetroArch [INFO] :: Joystick (2axis/2buttons + kbd arrows) (ID: 773) RetroArch [INFO] :: Joystick (4axis/4buttons + kbd arrows) (ID: 1541) RetroArch [INFO] :: Controller port: 2 RetroArch [INFO] :: Gamepad (2buttons) (ID: 517) RetroArch [INFO] :: Gamepad (4buttons) (ID: 1285) RetroArch [INFO] :: Joystick (2axis/2buttons) (ID: 261) RetroArch [INFO] :: Joystick (4axis/4buttons) (ID: 1029) RetroArch [WARN] :: SYSTEM DIR is empty, assume CONTENT DIR prehist2/PRE2.EXE RetroArch [INFO] :: Environ SYSTEM_DIRECTORY: “prehist2/”. RetroArch [INFO] :: Environ SAVE_DIRECTORY: “”. RetroArch [INFO] :: Environ CORE_ASSETS_DIRECTORY: “/home/pi/.config/retroarch/downloads”. RetroArch [INFO] :: Remaps: core name: DOSBox RetroArch [INFO] :: Remaps: game name: PRE2 RetroArch [INFO] :: Remaps: remap directory: /home/pi/.config/retroarch/remap RetroArch [INFO] :: Remaps: no game-specific remap found at /home/pi/.config/retroarch/remap/DOSBox/PRE2.rmp RetroArch [INFO] :: Remaps: no core-specific remap found at /home/pi/.config/retroarch/remap/DOSBox/DOSBox.rmp RetroArch [INFO] :: Environ GET_LOG_INTERFACE. RetroArch [libretro INFO] :: Logger interface initialized… RetroArch [INFO] :: Environ SET_PIXEL_FORMAT: XRGB8888. RetroArch [INFO] :: Content loading skipped. Implementation will load it on its own. RetroArch [libretro INFO] :: Loading default configuration prehist2//DOSbox/dosbox-libretro.conf RetroArch [libretro INFO] :: =>>>>>No configuration found, using core options RetroArch [INFO] :: Environ GET_VARIABLE dosbox_machine_type: RetroArch [INFO] :: hercules RetroArch [INFO] :: Environ GET_VARIABLE dosbox_cpu_cycles_0: RetroArch [INFO] :: 0 RetroArch [INFO] :: Environ GET_VARIABLE dosbox_cpu_cycles_1: RetroArch [INFO] :: 0 RetroArch [INFO] :: Environ GET_VARIABLE dosbox_cpu_cycles_2: RetroArch [INFO] :: 0 RetroArch [INFO] :: Environ GET_VARIABLE dosbox_cpu_cycles_3: RetroArch [INFO] :: 1 Segmentation fault
This is the plarform I have defined for it on Makefile.libretro:
Raspberry Pi 2
else ifeq ($(platform), rpi2) TARGET := $(TARGET_NAME)_libretro.so LDFLAGS += -shared -Wl,–version-script=libretro/link.T fpic = -fPIC
ENDIANNESS_DEFINES := -DLSB_FIRST COMMONFLAGS += -DARM COMMONFLAGS += -mfloat-abi=hard COMMONFLAGS += -fomit-frame-pointer -fstrict-aliasing -ffast-math COMMONFLAGS += -DDISABLE_EXCEPTIONS IS_X86 := 0
I have tried disabling each one of these, I also tried using no platform at all, etc… No way to debug this either:
pi@raspberrypi:~/retro $ gdb --args ./retroarch_dbg -v -L cores/dosbox_libretro.so GNU gdb (Raspbian 7.7.1+dfsg-5) 7.7.1 Copyright © 2014 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type “show copying” and “show warranty” for details. This GDB was configured as “arm-linux-gnueabihf”. Type “show configuration” for configuration details. For bug reporting instructions, please see: <http://www.gnu.org/software/gdb/bugs/>. Find the GDB manual and other documentation resources online at: <http://www.gnu.org/software/gdb/documentation/>. For help, type “help”. Type “apropos word” to search for commands related to “word”… Reading symbols from ./retroarch_dbg…done. (gdb) r Starting program: /home/pi/retro/retroarch_dbg -v -L cores/dosbox_libretro.so [Thread debugging using libthread_db enabled] Using host libthread_db library “/lib/arm-linux-gnueabihf/libthread_db.so.1”. [New Thread 0x76ab0460 (LWP 9206)] RetroArch [INFO] :: === Build =======================================RetroArch [INFO] :: [CPUID]: Features: Built: Feb 28 2016 RetroArch [INFO] :: Version: 1.3.0 RetroArch [INFO] :: Git: 5e4e30a RetroArch [INFO] :: ================================================= RetroArch [INFO] :: [CPUID]: Features: RetroArch [INFO] :: Looking for config in: “/home/pi/.config/retroarch/retroarch.cfg”. RetroArch [WARN] :: SYSTEM DIR is empty, assume CONTENT DIR RetroArch [INFO] :: Config: loading config from: /home/pi/.config/retroarch/retroarch.cfg. [New Thread 0x762b0460 (LWP 9207)] RetroArch [INFO] :: Loading dynamic libretro core from: “/home/pi/retro/cores/dosbox_libretro.so” RetroArch [INFO] :: Environ SET_SUPPORT_NO_GAME: no. RetroArch [INFO] :: Environ SET_VARIABLES. RetroArch [INFO] :: Environ SET_CONTROLLER_INFO. RetroArch [INFO] :: Controller port: 1 RetroArch [INFO] :: Gamepad (2buttons) (ID: 517) RetroArch [INFO] :: Gamepad (4buttons) (ID: 1285) RetroArch [INFO] :: Joystick (2axis/2buttons) (ID: 261) RetroArch [INFO] :: Joystick (4axis/4buttons) (ID: 1029) RetroArch [INFO] :: Joystick (2axis/2buttons + kbd arrows) (ID: 773) RetroArch [INFO] :: Joystick (4axis/4buttons + kbd arrows) (ID: 1541) RetroArch [INFO] :: Controller port: 2 RetroArch [INFO] :: Gamepad (2buttons) (ID: 517) RetroArch [INFO] :: Gamepad (4buttons) (ID: 1285) RetroArch [INFO] :: Joystick (2axis/2buttons) (ID: 261) RetroArch [INFO] :: Joystick (4axis/4buttons) (ID: 1029) RetroArch [WARN] :: SYSTEM DIR is empty, assume CONTENT DIR RetroArch [INFO] :: Environ SYSTEM_DIRECTORY: “”. RetroArch [INFO] :: Environ SAVE_DIRECTORY: “”. RetroArch [INFO] :: Environ CORE_ASSETS_DIRECTORY: “/home/pi/.config/retroarch/downloads”. RetroArch [INFO] :: Environ GET_LOG_INTERFACE. RetroArch [libretro INFO] :: Logger interface initialized… RetroArch [INFO] :: Environ SET_PIXEL_FORMAT: XRGB8888. RetroArch [INFO] :: libretro core requires content, but nothing was provided. RetroArch [libretro INFO] :: =>>>>>No configuration found, using core options RetroArch [INFO] :: Environ GET_VARIABLE dosbox_machine_type: RetroArch [INFO] :: hercules RetroArch [INFO] :: Environ GET_VARIABLE dosbox_cpu_cycles_0: RetroArch [INFO] :: 0 RetroArch [INFO] :: Environ GET_VARIABLE dosbox_cpu_cycles_1: RetroArch [INFO] :: 0 RetroArch [INFO] :: Environ GET_VARIABLE dosbox_cpu_cycles_2: RetroArch [INFO] :: 0 RetroArch [INFO] :: Environ GET_VARIABLE dosbox_cpu_cycles_3: RetroArch [INFO] :: 1
Program received signal SIGSEGV, Segmentation fault. 0x2d544542 in ?? () (gdb) bt #0 0x2d544542 in ?? () #1 0x0a332f30 in ?? () Backtrace stopped: previous frame identical to this frame (corrupt stack?) (gdb)
Both retroarch and the dosbox core were built with the DEBUG=1 parameter and I verified -O0 -g was passed to the compiler in both cases with verbose building when needed.
So, whoever has already gotten a dosbox core working on arm+linux, can you lend a hand? Thanks