Rust: extends windows subsystem support (or just relax limitation)

Created on 3 Nov 2016  路  5Comments  路  Source: rust-lang/rust

For attribute #![windows_subsystem = "VALUE"], the current implementation only accept Windows and Console as VALUE, which has unnecessary limitation.

Perhaps we should make it possible to use #![windows_subsystem = "Console,5.01"] or something similar. The version '5.01' here is necessary to create valid .exe to Windows XP, at least for VC 2015 linker on Windows 10.

cc PR #37501, ISSUE #34407 @alexcrichton


Update: Other available subsystems may be supported: NATIVE, POSIX, BOOT_APPLICATION, ...

/SUBSYSTEM:{BOOT_APPLICATION|CONSOLE|EFI_APPLICATION|  
            EFI_BOOT_SERVICE_DRIVER|EFI_ROM|EFI_RUNTIME_DRIVER|NATIVE|  
            POSIX|WINDOWS)  
            [,major[.minor]]  

More details at https://msdn.microsoft.com/en-us/library/fcc1zstk.aspx

Most helpful comment

Using an attribute like #[windows_subsystem(type = "console")] would make this more easily extensible, no? #[windows_subsystem(type = "console", version = "5.01")]

All 5 comments

We could make sure ,5.01 always append to the linker, that's doesn't affect the link result much.

Using an attribute like #[windows_subsystem(type = "console")] would make this more easily extensible, no? #[windows_subsystem(type = "console", version = "5.01")]

Also it is a bit confusing now that empty #![windows_subsystem] gives no warnings or something: https://is.gd/8MpSo5

Because its own name is not so clear and looks like self-sufficient to assign the windows subsystem to the executable.

Posting here because #37499 was closed.

Closing. If someone wants to pursue this, please follow the RFC process here https://github.com/rust-lang/rfcs#before-creating-an-rfc.

Was this page helpful?
0 / 5 - 0 ratings