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

cross-compiling Win32 build on Ubuntu 16.04 fails if DO_REALLY_STATIC=1 #111

Closed
johnmah opened this issue Oct 20, 2017 · 6 comments
Closed

Comments

@johnmah
Copy link
Contributor

johnmah commented Oct 20, 2017

Fails with:

...
configure: WARNING: tap-windows.h: accepted by the compiler, rejected by the preprocessor!
configure: WARNING: tap-windows.h: proceeding with the compiler's result
checking for tap-windows.h... yes
checking whether TUNSETPERSIST is declared... no
checking for setcon in -lselinux... no
checking for pam_start in -lpam... no
checking for PKCS11_HELPER... yes
checking for SSL_CTX_new... no
configure: error: openssl check failed
FATAL: Configure openvpn

This previously worked for me for OpenVPN 2.3.10 w/ OpenSSL 1.0.2k. Also current master builds fine without DO_REALLY_STATIC variable set. FWIW, also fails on Ubuntu 14.04.

I've attached output for the build process when DO_REALLY_STATIC is set.

openvpn-build-output.txt

@chipitsine
Copy link
Contributor

Thank you for reporting, I'll have a look soon

@chipitsine
Copy link
Contributor

it seems, there's no easy way to get DO_REALLY_STATIC back
it is broken for a long time

you are the only person who complains on that. can please describe your use case ?

@chipitsine
Copy link
Contributor

it does not work even for openvpn-2.3.10 + openssl-1.0.2k

git clone -b release/2.3 https://github.com/OpenVPN/openvpn-build.git
cd openvpn-build/generic
IMAGEROOT=`pwd`/image-win32 DO_REALLY_STATIC=1 CHOST=i686-w64-mingw32 OPENSSL_VERSION=1.0.2k OPENVPN_VERSION=2.3.10 OPENVPN_URL=http://openvpn.skbkontur.ru/openvpn-2.3.10.tar.gz CBUILD=x86_64-pc-linux-gnu ./build
....
ssl_openssl.o:ssl_openssl.c:(.text+0x2bcb): undefined reference to `SSL_CTX_free'
ssl_openssl.o:ssl_openssl.c:(.text+0x2bd9): undefined reference to `SSLv23_method'
ssl_openssl.o:ssl_openssl.c:(.text+0x2be1): undefined reference to `SSL_CTX_new'
ssl_openssl.o:ssl_openssl.c:(.text+0x2c25): undefined reference to `SSL_new'
ssl_openssl.o:ssl_openssl.c:(.text+0x2c71): undefined reference to `SSL_get_cipher_list'
ssl_openssl.o:ssl_openssl.c:(.text+0x2c98): undefined reference to `SSL_free'
ssl_openssl.o:ssl_openssl.c:(.text+0x2ca3): undefined reference to `SSL_CTX_free'
ssl_verify_openssl.o:ssl_verify_openssl.c:(.text+0xeb): undefined reference to `SSL_get_ex_data_X509_STORE_CTX_idx'
ssl_verify_openssl.o:ssl_verify_openssl.c:(.text+0x133): undefined reference to `SSL_get_ex_data'
cryptoapi.o:cryptoapi.c:(.text+0xd18): undefined reference to `SSL_CTX_use_certificate'
cryptoapi.o:cryptoapi.c:(.text+0xd92): undefined reference to `SSL_CTX_use_RSAPrivateKey'
collect2: error: ld returned 1 exit status
make[4]: *** [Makefile:549: openvpn.exe] Error 1
make[4]: Leaving directory '/home/ilia/openvpn-build/generic/tmp/openvpn-2.3.10/src/openvpn'
make[3]: *** [Makefile:401: install-recursive] Error 1
make[3]: Leaving directory '/home/ilia/openvpn-build/generic/tmp/openvpn-2.3.10/src'
make[2]: *** [Makefile:583: install-recursive] Error 1
make[2]: Leaving directory '/home/ilia/openvpn-build/generic/tmp/openvpn-2.3.10'
make[1]: *** [Makefile:880: install] Error 2
make[1]: Leaving directory '/home/ilia/openvpn-build/generic/tmp/openvpn-2.3.10'
make: *** [Makefile:890: install-strip] Error 2
FATAL: make openvpn

can you tell, how did you build it?

@chipitsine
Copy link
Contributor

@johnmah
Copy link
Contributor Author

johnmah commented Oct 23, 2017

we would like to use a static Windows build so that the OpenSSL/LZO DLLs don't need to be installed or distributed.

the following diff fixed the build issue with 1.0.2l against 2.3.10 with your above build command:

vagrant@vagrant:~/openvpn-build/generic$ git diff
diff --git a/generic/build b/generic/build
index d21e97b..5a5431c 100755
--- a/generic/build
+++ b/generic/build
@@ -383,7 +383,7 @@ fi
 # OpenVPN-GUI build expects the OPENSSL_CRYPTO_* variables to be set, even
 # though they were removed from openvpn/configure.ac by commit 31b0bebe.
 export OPENSSL_CRYPTO_CFLAGS="-I${OPENVPN_ROOT}/include"
-export OPENSSL_CRYPTO_LIBS="-L${OPENVPN_ROOT}/lib -lcrypto"
+export OPENSSL_CRYPTO_LIBS="-L${OPENVPN_ROOT}/lib -lssl -lcrypto"
 export OPENSSL_CFLAGS="-I${OPENVPN_ROOT}/include"
 export OPENSSL_LIBS="-L${OPENVPN_ROOT}/lib -lssl -lcrypto"
 export LZO_CFLAGS="-I${OPENVPN_ROOT}/include"

(it still breaks when compiling against 2.4.4 though)

@chipitsine
Copy link
Contributor

this issue might be closed

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

No branches or pull requests

3 participants