-
-
Notifications
You must be signed in to change notification settings - Fork 9.9k
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
Cannot set --openssldir to Windows path when cross compiling on Linux #21334
Comments
It is wrong to use --prefix the way you're using it. Do you actually want to specify DESTDIR when running make install instead? |
Probably, although how do I do that? For For |
Maybe you could try to work around this by using |
I am sorry but you've closed the PR. I could have amended the patch for you if you asked me to do that as you already have an ICLA signed. |
I closed the patch because after me stepping up to fix this issue (after OpenSSL ignoring it for years) you requested a change, then followed-up by promoting the patch to "non-trivial" (a rather unfriendly step, I felt), then requested to sign a new CLA because my commit email address changed. This felt unreasonable and unacceptable to me, esp considering how petty (yet annoying) bug this is. Please feel free to commit this under anybody's name, I release this patch to the public domain (I might have already done so back then). Aside: OpenSSL is also apparently not willing to address the underlying issue of using a vulnerable openssldir by default. 3.1.3 fixed the |
Fixed by #22723 |
Thank you @t8m! After noticing the patch in 3.2.0, I started using this live. It turned out to be somewhat complicated and fragile, because our merged solution is relying on filling export CROSS_COMPILE
CROSS_COMPILE="$(dirname "$(command -v "$(echo "${CC}" | cut -d ' ' -f 1)")")/" A possible improvement is to make the absolute path detection function enforce the rules for the target OS instead of the host OS the build is running on. I have no patch ready for this though. (The build knows we're building for Windows, so the necessary information should be there.) The reason to change |
Issue
I am trying to cross compile OpenSSL for Windows on Linux, but when I set set --openssldir to a Windows path, it appends it to the --prefix Unix path and fails.
Commands and output
Configure command:
./Configure --cross-compile-prefix=/usr/bin/i686-w64-mingw32- mingw --prefix=$(pwd)/build --openssldir="\"C:/Program Files/Common Files/SSL\""
(I have also tried
./Configure --cross-compile-prefix=/usr/bin/i686-w64-mingw32- mingw --prefix=$(pwd)/build --openssldir='C:\\Program Files\\Common Files\\SSL\\'
)perl configdata.pm --dump
make:
Tested Platforms
This fails on Ubuntu on GitHub Actions and Debian on WSL2.
Workarounds
Using
--openssldir="/Program Files/Common Files/SSL/"
works and appears to read from the corresponding Windows directory (although by default it uses the --prefix directory which seems like a security issue). Also, theopenssl version -d
command gives the Unix path output, which is not ideal.Expected behavior
It compiles it with the Windows path, and
openssl version -d
outputs a Windows path.The text was updated successfully, but these errors were encountered: