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

Fix compilation on Windows #4996

Open
wants to merge 4 commits into
base: master
from

Conversation

@btongminh
Copy link

commented Aug 10, 2019

  • Add .exe extension to the STRIP input
  • Add quotes around libgcc path

btongminh added some commits Aug 10, 2019

Fix compilation on Windows
- Add .exe extension to the STRIP input
- Add quotes around libgcc path
@@ -122,6 +122,14 @@ endif
ifneq ($(PROG),)
# Build a standalone executable (unix does this)

COMPILER_TARGET := $(shell $(CC) -dumpmachine)
ifneq (,$(findstring mingw,$(COMPILER_TARGET)))

This comment has been minimized.

Copy link
@stinos

stinos Aug 12, 2019

Contributor

Would this be sufficient? I.e. suppose clang is used to target windows it will perhaps also add the extension? On the other hand since no problems have been reported this ight be ok for now. But from previous attempts it looks like this needs to be checked thoroughly. Do you think this covers at least all mingw cases including cross-compiling on unix for windows, and does it also work for mpy-cross?

Also see e.g. #3361 and #4143

This comment has been minimized.

Copy link
@btongminh

btongminh Aug 12, 2019

Author

It does work for mpy-cross; this is the one that is currently broken under mingw.

For some reason the mingw cross compiler does NOT add the .exe extension. I don't know what clang behavior is, but if I recall correctly in the past it used gcc's.

This comment has been minimized.

Copy link
@btongminh

btongminh Aug 12, 2019

Author

In any case, adding the extension explicitly solves the issue, I think.

Fix compilation on Windows
Explicitly add the .exe extension to the linker output target file
@chrismas9

This comment has been minimized.

Copy link
Contributor

commented Aug 13, 2019

I reviewed the comments on my PRs #3310 and #3370 and I don't think this PR will cover all cases. Some of the issues involve using WSL and MSYS on the same computer. I use WSL on a daily basis, but MSYS / GCC / Eclipse / GDB for debugging. One problem is that once you run under WSL and create mpy-cross Windows will try to execute mpy-cross, even if mpy-cross.exe exists. Another thing that needs checking is whether the Windows port will cross compile under WSL, CYGWIN or Linux and native compile under MSYS.

I did a complete rewrite of #3370 after I learned of all the issues but didn't push it after I started using WSL. I intend to rebase a and retest it in the next few weeks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.