Currently we use both __app_type (lib/sdk/crt/misc/environ.c) and mingw_app_type (lib/sdk/crt/startup/crtexe.c) at the same time. This will probably lead to undesired results.