Closed JesseRMeyer closed 3 years ago
You can compile an x86_64-linux-gnu cross compiler toolchain for Windows. But I recommend just running Linux in a virtual machine and using that to compile. Builds actually go faster in a virtual machine on Windows than on Windows itself. It's not possible to support a MinGW toolchain because it uses COFF, which imposes restrictions on things like the length of section names that would otherwise make Actually Portable Executable impossible. The same is true of Mach-O. You have to use an ELF toolchain. It's totally possible to have an ELF toolchain on Windows. It's just prebuilt binaries for such a thing are hard to find online and it's hard to configure a build from scratch to create them.
Regarding the integrated linker, I'm assuming you're referring to https://github.com/jart/cosmopolitan/commit/81ef162703ec2075136ceb5aa7601bf3ef8e8ca2 which is discussed further in https://github.com/jart/cosmopolitan/blob/master/third_party/chibicc/README.cosmo An integrated linker would be nice, since the chibicc compiler can be built as an actually portable executable. Keep in mind it's not a replacement for GCC which has decades of development behind it and can generally produce code that's twice as fast.
There's now a tutorial on the website on how to build Actually Portable Executables on Windows. Static binaries are provided of an x86_64-linux-gnu cross-compiler toolchain which runs on Windows. https://justine.lol/cosmopolitan/windows-compiling.html
Hi,
Cosmopolitan currently assumes a Linux environment to build ape programs. However, my primary development is on and for Windows. Is minGW support within the scope of this project (assuming global 'minGW' support is even possible)? Apparently gcc on minGW is currently configured exclusively for elf output, so certain assembler directives simply do not exist. Recognizing that beggars cannot be choosers, is there a possibility of more general Clang compiler support, which already supports Windows? Would an integrated linker resolve these issues (I noticed a related remark in a recent commit message)?
Thanks!