libretro / supafaust

Unsupported SNES emulator for multicore ARM Cortex A7,A9,A15,A53 Linux platforms.
GNU General Public License v2.0
9 stars 12 forks source link

Broken VFS code under Windows with MSYS2. #17

Open mudlord opened 2 years ago

mudlord commented 2 years ago

When loading a test file, MSU1 loading is broken which causes the core to throw C++ exceptions and thus exit. Example of such broken path when loading a file. "./C:\code\working\WTFweg\compile_dir\test\snes_smw.msu"

The errant "./" is added because the Supafaust VFS has no distinction between Windows paths and Linux paths (it always assumes Linux pathing in the VirtualFS constructor)

It is possible to work around this in a libretro frontend, but this is never a ideal solution since it can break many many other cores in said frontend.

keithbowes commented 1 year ago

I'm sorry. I couldn't cross-compile this because it fails in the link stage:

x86_64-w64-mingw32-g++ -static-libgcc -static-libstdc++ -lwinmm  -shared -Wl,--no-undefined -Wl,--version-script=link.T -o mednafen_supafaust_libretro.dll mednafen/mednafen.o mednafen/endian.o mednafen/git.o mednafen/error.o mednafen/settings.o mednafen/mempatcher.o mednafen/state.o mednafen/string/string.o mednafen/Stream.o mednafen/FileStream.o mednafen/VirtualFS.o mednafen/NativeVFS.o mednafen/ExtMemStream.o mednafen/MemoryStream.o mednafen/sound/DSPUtility.o mednafen/sound/OwlResampler.o mednafen/video/convert.o mednafen/video/Deinterlacer_Blend.o mednafen/video/Deinterlacer_Simple.o mednafen/video/Deinterlacer.o mednafen/video/surface.o mednafen/cheat_formats/snes.o mednafen/hash/sha1.o mednafen/hash/sha256.o mednafen/MTStreamReader.o mednafen/mthreading/MThreading_Win32.o mednafen/snes_faust/apu.o mednafen/snes_faust/cpu.o mednafen/snes_faust/ppu.o mednafen/snes_faust/ppu_mt.o mednafen/snes_faust/ppu_mtrender.o mednafen/snes_faust/cart.o mednafen/snes_faust/input.o mednafen/snes_faust/snes.o mednafen/snes_faust/cart/dsp1.o mednafen/snes_faust/cart/dsp2.o mednafen/snes_faust/cart/sdd1.o mednafen/snes_faust/cart/cx4.o mednafen/snes_faust/cart/superfx.o mednafen/snes_faust/cart/sa1.o mednafen/snes_faust/cart/sa1cpu.o mednafen/snes_faust/msu1.o mednafen/snes_faust/ppu_st.o libretro.o
/usr/lib/gcc/x86_64-w64-mingw32/10.2.1/../../../../x86_64-w64-mingw32/bin/ld: /usr/x86_64-w64-mingw32/sys-root/mingw/lib/../lib/libmingwex.a(lib64_libmingwex_a-dirent.o): in function `strcpy':
/usr/x86_64-w64-mingw32/sys-root/mingw/include/string.h:228: undefined reference to `__strcpy_chk'

Anyway, the uncaught exception probably has something to do with the try...catch sections that the core developers removed during various cleanups.

mudlord commented 1 year ago

Somewhat makes sense.