all repos — mgba @ db408920ca40417bb1826b82738aefeed06b4814

mGBA Game Boy Advance Emulator

Fix undefined symbols when compiling libretro core as debug build

When building with `cmake -DCMAKE_BUILD_TYPE=Debug -DBUILD_LIBRETRO=1`
the resulting lib has undefined symbols that cause issues when loading
the core in GDB.

Functionality is being ifdefed out with the defines MINIMAL_CORE
and DISABLE_THREADING, but some symbols are still used in a few
places.

$ ldd -r mgba_libretro.so
undefined symbol: GBAVideoProxyRendererCreate (./mgba_libretro.so)
undefined symbol: GBAVideoProxyRendererUnshim (./mgba_libretro.so)
undefined symbol: GBAVideoProxyRendererShim (./mgba_libretro.so)
undefined symbol: GBVideoProxyRendererCreate (./mgba_libretro.so)
undefined symbol: GBVideoProxyRendererUnshim (./mgba_libretro.so)
undefined symbol: GBVideoProxyRendererShim (./mgba_libretro.so)
undefined symbol: mVideoLogContextInitialState (./mgba_libretro.so)
undefined symbol: mVideoLoggerAddChannel (./mgba_libretro.so)
undefined symbol: mVideoLoggerAttachChannel (./mgba_libretro.so)
undefined symbol: mVideoLoggerRendererCreate (./mgba_libretro.so)
undefined symbol: mCoreThreadMarkCrashed (./mgba_libretro.so)
Christian Fetzer fetzer.ch@gmail.com
Wed, 29 Nov 2017 20:50:04 +0100
commit

db408920ca40417bb1826b82738aefeed06b4814

parent

4d2675e3e8b03d259631242437334a22af4f21dc

3 files changed, 6 insertions(+), 0 deletions(-)

jump to
M src/core/thread.csrc/core/thread.c

@@ -625,7 +625,9 @@ vprintf(format, args);

printf("\n"); struct mCoreThread* thread = mCoreThreadGet(); if (thread && level == mLOG_FATAL) { +#ifndef DISABLE_THREADING mCoreThreadMarkCrashed(thread); +#endif } }
M src/gb/core.csrc/gb/core.c

@@ -812,6 +812,7 @@ break;

} } +#ifndef MINIMAL_CORE static void _GBCoreStartVideoLog(struct mCore* core, struct mVideoLogContext* context) { struct GBCore* gbcore = (struct GBCore*) core; struct GB* gb = core->board;

@@ -834,6 +835,7 @@ GBVideoProxyRendererUnshim(&gb->video, &gbcore->proxyRenderer);

free(gbcore->proxyRenderer.logger); gbcore->proxyRenderer.logger = NULL; } +#endif struct mCore* GBCoreCreate(void) { struct GBCore* gbcore = malloc(sizeof(*gbcore));
M src/gba/core.csrc/gba/core.c

@@ -825,6 +825,7 @@ break;

} } +#ifndef MINIMAL_CORE static void _GBACoreStartVideoLog(struct mCore* core, struct mVideoLogContext* context) { struct GBACore* gbacore = (struct GBACore*) core; struct GBA* gba = core->board;

@@ -851,6 +852,7 @@ GBAVideoProxyRendererUnshim(&gba->video, &gbacore->proxyRenderer);

free(gbacore->proxyRenderer.logger); gbacore->proxyRenderer.logger = NULL; } +#endif struct mCore* GBACoreCreate(void) { struct GBACore* gbacore = malloc(sizeof(*gbacore));