tyfkda / xcc

Standalone C compiler/assembler/linker/libc for x86-64/aarch64/riscv64/wasm
https://tyfkda.github.io/xcc/
MIT License
197 stars 14 forks source link

Feature: Windows support for wcc (MinGW64) #156

Closed ijsf closed 3 months ago

ijsf commented 3 months ago

I was wondering if there would be interest to make wcc natively compatible with Windows (64-bit) by using the MinGW64 toolchain using MSYS.

I've managed to successfully port wcc to MinGW64 and make it useable under Windows, as I have a need for a lightning fast C to WASM compiler and wcc seems to fit the bill 🏆

It seems that scope of the changes are more or less:

My changes are passing all test-wcc tests. I've tried to keep the changes as unintrusive as possible to avoid regression, but there are still a large number of changes.

For other targets like xcc, it seems much less logical and I have not touched any of these, namely, the compiler will produce ELF output which won't be able to run natively on Windows, unless something is added to accommodate this.

tyfkda commented 3 months ago

Would you send a pull request, or tell me how to solve the problem? I am worried about code complexity with conditional compilation.

ijsf commented 3 months ago

Yes I understand, I guess it would be better to split up in multiple PRs to keep overview. I've contained nearly all of the conditional code to a separate util file called platform.c. I will open up a first PR for the data types.

ijsf commented 3 months ago

This should be the complete patchset for wcc.

tyfkda commented 3 months ago

After careful consideration, I would like to reject this pull request because it is difficult for me to support the MinGW64 platform. I apologize for not being able to meet your request.

ijsf commented 3 months ago

I understand as the changes are quite substantial. I will focus my own fork on Win32 compatibility instead: https://github.com/ijsf/xcc-win32