diff --git a/racket/src/start/start.c b/racket/src/start/start.c index 7e00019e64..03dd7b2f14 100644 --- a/racket/src/start/start.c +++ b/racket/src/start/start.c @@ -41,10 +41,17 @@ #endif #define DUPLICATE_INPUT +#if defined(__GNUC__) +# define PRESERVE_IN_EXECUTABLE __attribute__((used)) +#else +# define PRESERVE_IN_EXECUTABLE /* empty */ +#endif + /* Win command lines limited to 1024 chars, so 1024 chars for command tail is ample */ -static wchar_t *input = +PRESERVE_IN_EXECUTABLE +wchar_t * volatile input = L""; -static wchar_t *variant = L""; +PRESERVE_IN_EXECUTABLE +wchar_t * volatile variant = L""; static int wc_strlen(const wchar_t *ws) { @@ -279,6 +288,7 @@ int wmain(int argc_in, wchar_t **argv_in) /* gcc: input is read-only */ input = copy_string(input); exedir = copy_string(exedir); + variant = copy_string(variant); #endif count = 1;