Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Windows support for wcc (MinGW64) #156

Closed
ijsf opened this issue May 25, 2024 · 5 comments
Closed

Feature: Windows support for wcc (MinGW64) #156

ijsf opened this issue May 25, 2024 · 5 comments

Comments

@ijsf
Copy link
Contributor

ijsf commented May 25, 2024

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:

  • Changed use of long (not 64-bit on Windows) to long long to explicitly use 64-bit and still allow for arithmetic.
  • Platform specific utility function replacements for non-C standard functions such as fmemopen, tmpfile as well as process handling such as fork.
  • Path handling that handles C:\\A\\B\\C as well as POSIX paths transparently.
  • Enforce use of 32-bit wchar.

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
Copy link
Owner

tyfkda commented May 26, 2024

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

@ijsf
Copy link
Contributor Author

ijsf commented May 27, 2024

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
Copy link
Contributor Author

ijsf commented May 27, 2024

This should be the complete patchset for wcc.

@tyfkda
Copy link
Owner

tyfkda commented May 28, 2024

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.

@tyfkda tyfkda closed this as completed May 28, 2024
@ijsf
Copy link
Contributor Author

ijsf commented May 29, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants