Closed Kray-G closed 1 year ago
Thank you for reporting this and trying to make a fix.
Unfortunately windows port is currently not supported. What you see is the initial code for the windows port. Although I guess the most tests are still working.
What you are proposing with this change is basically to use SYSV ABI for varargs instead of Windows one. As all generated code using the same ABI, it is ok. But mixed code (e.g. calling standard library functions) might not work. So I'd rather avoid to commit the PR.
It is very hard to do native Windows port as the development documentation is not good and there is no source code to look at to resolve the issues. For example, I wasted so much time to make setjmp/longjmp working on Windows and failed. Windows requires specific function code generation and even after modifying code generation required by Windows documentation, I did not manage to make longjmp/setjmp working.
I'd like to try again to finish a native Windows port but I don't know when I really will have time for this. Even maintenance of MIR is difficult (although I am committed to this) as there are more higher priority projects I am involved in.
Thanks for your comment. I understand your opinion about what to do on your project. Actually, I am really in trouble with this error, so I am in the situation where I have to use a modified version on myself. That's why it would be really helpful if you could accept it even only if it would be a temporary workaround until you've got a real fix that have to be.
After you accept it, how about you having enough time to fix it with the best way that you think?
After you accept it, how about you having enough time to fix it with the best way that you think?
I've merged your PR. I was afraid that it can affect musl based linux but it seems the change is ok for musl.
Thank you so much for accepting it. That's really helpful for me. I had an experience with the problem on the differences between MS ABI and SYSV ABI, so I know that's so tough work especially for mixed code as you said.
Anyway I am very appriciative of you and it works with my project. Thanks a lot.
I would like you to see details on #321, but let me report it again.
I found some errors in c2m.exe on Windows, and it caused by the file of mirc_x86_64_stdarg.h. At the beginning, I felt some mistakes with the macro of
__WIN32
because MSVC doesn't have__WIN32
and it has_WIN32
instead. However, it has another error when I replaced it by_WIN32
.When I digged into the source file, this macro's branch has no
#else
clause and__WIN32
macro also doesn't work, so the frst problem has occurred. But even if I replaced it by_WIN32
, the__va_start
macro doesn't work by the error of not found on c2m.exe on Windows, that's why the second problem has occurred.At least, this macro's branch has no
#else
clause, so it needs#else
clause anyway, and now I am trying to find the correct fix but I didn't find anything so far. Therefore, this fix could be better as a workaround, so could you make it back to#else
? My project is going well with this fix so far.Thank you so much in advance.