I now have a solution, for GCC >= 4.6.1.
Firstly, re-enable explicit DLL import / export, and supply a compiler flag, to bring back pre-4.5 style DLL export handling.
Flag to handle exports in pre-4.5 way:
Ensure exports are output, by removing GCC version check in include\wx\dlimpexp.h(37), resulting in:
# elif defined(__GNUC__)
__declspec could be used here too but let's use the native
__attribute__ instead for clarity.
# define WXEXPORT __attribute__((dllexport))
# define WXIMPORT __attribute__((dllimport))
This keeps the build time / space requirements manageable, but makes the exports explicit instead of relying on GCC auto export / import.
Next, the executable start time and memory footprint can be brought down by using the GCC static libs:
This is done by default in TDM's distro for example, where he also includes a complementary shared-memory patch related to propagating exceptions out of DLLs.
Many thanks to those who helped. Very much appreciated