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

openssl wrap doesn't build on windows (vs via ninja) #181

Closed
anarazel opened this issue Oct 6, 2021 · 12 comments · Fixed by #1283
Closed

openssl wrap doesn't build on windows (vs via ninja) #181

anarazel opened this issue Oct 6, 2021 · 12 comments · Fixed by #1283

Comments

@anarazel
Copy link

anarazel commented Oct 6, 2021

Hi,

PS C:\Users\anfreund\src\pg-meson\build-ninja-x64> ninja .\subprojects\openssl-1.1.1l\openssl.exe
[1/1] Linking target subprojects/openssl-1.1.1l/openssl.exe
FAILED: subprojects/openssl-1.1.1l/openssl.exe subprojects/openssl-1.1.1l/openssl.pdb
"link" @subprojects/openssl-1.1.1l/openssl.exe.rsp
LINK : fatal error LNK1181: cannot open input file 'subprojects\openssl-1.1.1l\crypto.lib'

As far as I can tell the reason for the failure to build is that the buildsystem contained in the wrap doesn't take care of exporting symbols. Due to that link.exe doesn't produce an import library, which then causes this issue.

CC: @nazar-pc

Regards,

Andres

@xclaesse
Copy link
Member

xclaesse commented Oct 6, 2021

The good news is we now have Windows CI, so if someone does an update of openssl wrap it will be tested this time.

@nazar-pc
Copy link
Contributor

nazar-pc commented Oct 6, 2021

Is it MSVC's linker? I'm running Windows builds on CI without problems, but I had to make GNU linker unavailable for MSVC builds or else it didn't work together

@anarazel
Copy link
Author

anarazel commented Oct 6, 2021 via email

@xclaesse
Copy link
Member

xclaesse commented Oct 8, 2021

I can confirm, the issue is the generator script configure openssl with no-shared so libcrypto.def is not generated. We also have to pass that file to library(). While looking into this, I noticed there is also a ld script for the linux ABI.

@vinipsmaker
Copy link

Any updates on this?

@punytroll
Copy link
Contributor

Good to know, that I'm not the only one with this problem!

@xclaesse You mentioned some things in your reply from nearly a year ago. Could you elaborate on the issues ... I am very willing to try my hands on this, but I could use some starters ...

Thanks! :)

@amyspark
Copy link
Contributor

I have a version ready for public consumption, I'll update it to 1.1.1q and fix #428 before linking it here.

@amyspark
Copy link
Contributor

@punytroll @jfinkhaeuser, I've made a custom wrap for OpenSSL 1.x based on the existing version for v3.

Mine improves the following bits:

  • support for MSYS compilers (64 and 32-bit) as well as MSVC
  • detection of the assemblers available (gas/nasm)
  • adds a .pc file for easy lookup
  • enabled the usage of nasm for MSVC

The latter was a longstanding TODO since 7dfccc1.

You'll find the wrap in this branch and the release here. I'm not sure if/how I could upstream it here, given that wrapdb has already moved to the 3.x branch.

@jfinkhaeuser
Copy link

Thank you, I'll check it out!

@jfinkhaeuser
Copy link

@amyspark it doesn't quite work for me, but it's enough that I can probably work my way there. FWIW, I would have no problem with using v3, but then there's #428 and #427 in those.

At any rate, I have more info with this, so thank you very much!

@lemosjose
Copy link

lemosjose commented Dec 29, 2022

Any udpates on that? got into similar stuff while building a project, and i see it's not closed yet

@hrxi
Copy link
Contributor

hrxi commented Nov 10, 2023

Would be fixed by #1283.

hrxi added a commit to hrxi/wrapdb that referenced this issue Nov 13, 2023
MSVC needs a way of knowing which symbols are supposed to be exported,
otherwise it does not create a DLL. This means the wrap was previously
unusable as a shared library.

The OpenSSL build process does that by passing a `.def` file to the
linker. This reimplements OpenSSL's `util/mkdef.pl` script to make the
meson build do the same as the normal build process.

Fixes mesonbuild#181.
hrxi added a commit to hrxi/wrapdb that referenced this issue Nov 22, 2023
MSVC needs a way of knowing which symbols are supposed to be exported,
otherwise it does not create a DLL. This means the wrap was previously
unusable as a shared library.

The OpenSSL build process does that by passing a `.def` file to the
linker. This reimplements OpenSSL's `util/mkdef.pl` script to make the
meson build do the same as the normal build process.

Fixes mesonbuild#181.
neheb pushed a commit that referenced this issue Nov 22, 2023
MSVC needs a way of knowing which symbols are supposed to be exported,
otherwise it does not create a DLL. This means the wrap was previously
unusable as a shared library.

The OpenSSL build process does that by passing a `.def` file to the
linker. This reimplements OpenSSL's `util/mkdef.pl` script to make the
meson build do the same as the normal build process.

Fixes #181.
willwray pushed a commit to willwray/wrapdb that referenced this issue Apr 22, 2024
MSVC needs a way of knowing which symbols are supposed to be exported,
otherwise it does not create a DLL. This means the wrap was previously
unusable as a shared library.

The OpenSSL build process does that by passing a `.def` file to the
linker. This reimplements OpenSSL's `util/mkdef.pl` script to make the
meson build do the same as the normal build process.

Fixes mesonbuild#181.
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

Successfully merging a pull request may close this issue.

9 participants