.. Copyright 1988-2022 Free Software Foundation, Inc. This is part of the GCC manual. For copying conditions, see the copyright.rst file. .. program:: x86 Windows .. index:: x86 Windows Options, Windows Options for x86 .. _x86-windows-options: x86 Windows Options ^^^^^^^^^^^^^^^^^^^ These additional options are available for Microsoft Windows targets: .. option:: -mconsole This option specifies that a console application is to be generated, by instructing the linker to set the PE header subsystem type required for console applications. This option is available for Cygwin and MinGW targets and is enabled by default on those targets. .. option:: -mdll This option is available for Cygwin and MinGW targets. It specifies that a DLL---a dynamic link library---is to be generated, enabling the selection of the required runtime startup object and entry point. .. option:: -mnop-fun-dllimport This option is available for Cygwin and MinGW targets. It specifies that the :microsoft-windows-fn-attr:`dllimport` attribute should be ignored. .. option:: -mthreads This option is available for MinGW targets. It specifies that MinGW-specific thread support is to be used. .. option:: -municode This option is available for MinGW-w64 targets. It causes the ``UNICODE`` preprocessor macro to be predefined, and chooses Unicode-capable runtime startup code. .. option:: -mwin32 This option is available for Cygwin and MinGW targets. It specifies that the typical Microsoft Windows predefined macros are to be set in the pre-processor, but does not influence the choice of runtime library/startup code. .. option:: -mwindows This option is available for Cygwin and MinGW targets. It specifies that a GUI application is to be generated by instructing the linker to set the PE header subsystem type appropriately. .. option:: -fno-set-stack-executable This option is available for MinGW targets. It specifies that the executable flag for the stack used by nested functions isn't set. This is necessary for binaries running in kernel mode of Microsoft Windows, as there the User32 API, which is used to set executable privileges, isn't available. .. option:: -fset-stack-executable Default setting; overrides :option:`-fno-set-stack-executable`. .. option:: -fwritable-relocated-rdata This option is available for MinGW and Cygwin targets. It specifies that relocated-data in read-only section is put into the ``.data`` section. This is a necessary for older runtimes not supporting modification of ``.rdata`` sections for pseudo-relocation. .. option:: -fno-writable-relocated-rdata Default setting; overrides :option:`-fwritable-relocated-rdata`. .. option:: -mpe-aligned-commons This option is available for Cygwin and MinGW targets. It specifies that the GNU extension to the PE file format that permits the correct alignment of COMMON variables should be used when generating code. It is enabled by default if GCC detects that the target assembler found during configuration supports the feature. See also under :ref:`x86-options` for standard options.