From 20a25fd7f8eb01193c37a61c88d5e36e62235c1b Mon Sep 17 00:00:00 2001 From: notaz Date: Wed, 16 Oct 2024 01:45:51 +0300 Subject: [PATCH] 3ds: try partial linking --- Makefile | 12 +++++++++- frontend/libretro-extern | 25 ++++++++++++++++++++ frontend/{link.T => libretro-version-script} | 0 3 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 frontend/libretro-extern rename frontend/{link.T => libretro-version-script} (100%) diff --git a/Makefile b/Makefile index 69b7ab3d..ac5eab9d 100644 --- a/Makefile +++ b/Makefile @@ -429,10 +429,20 @@ frontend/revision.h: FORCE target_: $(TARGET) $(TARGET): $(OBJS) +ifeq ($(PARTIAL_LINKING), 1) + sed -e 's/.*/EXTERN(\0)/' frontend/libretro-extern > frontend/libretro-extern.T + $(LD) -o $(basename $(TARGET))1.o -r --gc-sections -T frontend/libretro-extern.T $^ + $(OBJCOPY) --keep-global-symbols=frontend/libretro-extern $(basename $(TARGET))1.o $(basename $(TARGET)).o + $(AR) rcs $@ $(basename $(TARGET)).o +else ifeq ($(STATIC_LINKING), 1) + $(AR) rcs $@ $^ +else $(CC_LINK) $(CFLAGS) -o $@ $^ $(LDFLAGS) $(LDLIBS) $(EXTRA_LDFLAGS) +endif clean: $(PLAT_CLEAN) clean_plugins - $(RM) $(TARGET) $(OBJS) $(TARGET).map frontend/revision.h + $(RM) $(TARGET) *.o $(OBJS) $(TARGET).map frontend/revision.h + $(RM) frontend/libretro-extern.T ifneq ($(PLUGINS),) plugins_: $(PLUGINS) diff --git a/frontend/libretro-extern b/frontend/libretro-extern new file mode 100644 index 00000000..c3c490c2 --- /dev/null +++ b/frontend/libretro-extern @@ -0,0 +1,25 @@ +retro_api_version +retro_cheat_reset +retro_cheat_set +retro_deinit +retro_get_memory_data +retro_get_memory_size +retro_get_region +retro_get_system_av_info +retro_get_system_info +retro_init +retro_load_game +retro_load_game_special +retro_reset +retro_run +retro_serialize +retro_serialize_size +retro_set_audio_sample +retro_set_audio_sample_batch +retro_set_controller_port_device +retro_set_environment +retro_set_input_poll +retro_set_input_state +retro_set_video_refresh +retro_unload_game +retro_unserialize diff --git a/frontend/link.T b/frontend/libretro-version-script similarity index 100% rename from frontend/link.T rename to frontend/libretro-version-script -- 2.39.5