Add linker version script.

This commit is contained in:
Mike Robinson committed 2014-11-04 22:39:44 +00:00
1 parent 70d5afdbc6
commit 2fbfe1df10
2 files changed
+46

No files matched your search

+16
View File
@@ -51,3 +51,19 @@ Checkout only the changes to files in src/rust_wrapper:
Merge those changes:
`$ git commit`
Compilation
===========
Rust currently sets all library symbols visible, resulting is very bloated
libraries. If you are linking with GNU ld it is possible to restrict the visible
symbols to those required by the libretro API, using a version script. Cargo
does not support custom rustc parameters, so first run cargo with --verbose to
discover the cargo parameters. Then run rustc manually, passing the version
script in src/visible_symbols.script by appending:
`-C link-args="-Wl,-version-script=src/visible_symbols.script -Wl,-gc-sections"`
This will result in a much more reasonably sized core. The core size may be
futher reduced without loss of function by running `strip -s`.
+30
View File
@@ -0,0 +1,30 @@
{
global:
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;
local:
*;
};