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

Windows support #77

Closed
daurnimator opened this issue Nov 9, 2016 · 7 comments
Closed

Windows support #77

daurnimator opened this issue Nov 9, 2016 · 7 comments

Comments

@daurnimator
Copy link
Collaborator

daurnimator commented Nov 9, 2016

I had a go at this tonight on a branch over here: https://github.com/daurnimator/luaossl/tree/windows-support.

With 568a076 if you comment out the lines in _openssl.c that use inet_pton and inet_ntop then I could cross compile with:

x86_64-w64-mingw32-gcc -O2 -fPIC -Wall -Wextra -Wno-missing-field-initializers -c src/openssl.c -o src/openssl.o -D_REENTRANT -D_THREAD_SAFE -DLUA_COMPAT_APIINTCASTS -D_WIN32_WINNT=0x0600
x86_64-w64-mingw32-gcc -shared -o _openssl.dll src/openssl.o -lssl -lcrypto -lpthread -lm -llua

The resulting dll seems to work, and the basic examples work (only tested in wine though).

@greatwolf
Copy link

greatwolf commented Jan 13, 2017

Are there any plans to merge the latest changes from master into the windows branch? It's behind quite a few. Also any plan to PR merge windows support back to upstream?

@daurnimator
Copy link
Collaborator Author

daurnimator commented Jan 14, 2017

Are there any plans to merge the latest changes from master into the windows branch? It's behind quite a few.

It should be a conflict+issue free merge.
I tend to dislike pulling master into branches unless there is complex conflict.

Ideally it gets merged, things that need to be done before then:

  • Decide if we are okay with the EXPORT decoration: if not, need to write a linker script/.lib
  • Test on an actual windows machine (not wine)
  • Add support to build system
  • Figure out inet_pton/inet_ntop: windows has them (since vista), but mingw seems to not expose them
  • Possibly discard the gathering entropy from uname/pid, etc instead of turning off for windows. I'm actually not sure what path windows will take for the random stirring functionality: we might need something windows specific.

@moteus
Copy link

moteus commented Apr 3, 2017

Figure out inet_pton/inet_ntop: windows has them (since vista), but mingw seems to not expose them

This is related issues luarocks/luarocks#655

@daurnimator
Copy link
Collaborator Author

daurnimator commented Apr 3, 2017

I've pushed updates to my windows-support branch. Please test to see if you can compile with MSVC.
It also depends on #92

@moteus
Copy link

moteus commented Apr 3, 2017

I took quick look on code. It broken in some cases. Also it can be done with less changes.
I already has compiled version for MSVC 2015 which pass regress tests. But i do not have time to make pr today. Also may be I update it with some your changes.

@daurnimator
Copy link
Collaborator Author

daurnimator commented Aug 30, 2017

I had another go at this tonight. Still not there yet, but getting closer. I've updated my master...daurnimator:windows-support branch

@daurnimator
Copy link
Collaborator Author

PR is up for review: #102

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

No branches or pull requests

3 participants