From: notaz Date: Tue, 15 Oct 2024 22:45:51 +0000 (+0300) Subject: 3ds: try partial linking X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=20a25fd7f8eb01193c37a61c88d5e36e62235c1b;p=pcsx_rearmed.git 3ds: try partial linking --- 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