Open mq2195 opened 3 years ago
@mq2195,
I build on a lot of different platforms, but I've never tried a Docker cross-compile. So take this with a grain of salt...
You need to get beyond configure
not finding -lcrypto
. The -L
path in LDFLAGS
should do it:
checking for HMAC_Update in -lcrypto...
Add the following flags to help things along. I suspect your CPPFLAGS
and LDFLAGS
are causing your troubles. Well behaved programs will honor your flags. I know LDNS does.
CPPFLAGS: -I/builder-openssl/include
ASFLAGS: -Wa,--noexecstack
CFLAGS: -g2 -O3 ...
CXXFLAGS: -g2 -O3 ...
LDFLAGS: -L//builder-openssl/lib -Wl,-z,now -Wl,-z,origin
LDLIBS: -ldl -lpthread ...
As an example of a good configure, here's what I just observed on Solaris i86pc:
checking for int8_t... yes
checking for int16_t... yes
checking for int32_t... yes
checking for int64_t... yes
checking for uint8_t... yes
checking for uint16_t... yes
checking for uint32_t... yes
checking for uint64_t... yes
...
checking for SSL... found in /opt/ssh
checking for EVP_sha256 in -lcrypto... yes
checking for openssl/ssl.h... yes
checking for openssl/err.h... yes
checking for openssl/rand.h... yes
checking for LibreSSL... no
checking for openssl/ssl.h... (cached) yes
checking openssl/evp.h usability... yes
checking openssl/evp.h presence... yes
checking for openssl/evp.h... yes
checking openssl/engine.h usability... yes
checking openssl/engine.h presence... yes
checking for openssl/engine.h... yes
checking openssl/conf.h usability... yes
checking openssl/conf.h presence... yes
checking for openssl/conf.h... yes
checking for EVP_sha256... yes
checking for EVP_sha384... yes
checking for EVP_sha512... yes
checking for EVP_PKEY_keygen... yes
checking for ECDSA_SIG_get0... yes
checking for EVP_MD_CTX_new... yes
checking for DSA_SIG_set0... yes
checking for DSA_SIG_get0... yes
checking for EVP_dss1... no
checking for DSA_get0_pqg... yes
checking for DSA_get0_key... yes
checking for EVP_cleanup... no
checking for ENGINE_cleanup... no
checking for ENGINE_free... yes
checking for CRYPTO_cleanup_all_ex_data... no
checking for ERR_free_strings... no
checking for CONF_modules_unload... yes
checking for OPENSSL_init_ssl... no
checking for OPENSSL_init_crypto... yes
checking for ERR_load_crypto_strings... no
checking for CRYPTO_memcmp... yes
checking for EVP_PKEY_get_base_id... no
checking whether EVP_PKEY_base_id is declared... yes
checking Checking for OpenSSL >= 3.0.0... no
checking for SHA256 and SHA512... checking for SHA256_Init... yes
checking for GOST... checking for EVP_PKEY_set_type_str... yes
checking for EC_KEY_new... yes
checking if GOST works... no
configure: WARNING: Gost support does not work because the engine is missing.
configure: WARNING: Install gost-engine first or use the --enable-gost-anyway to compile with GOST support anyway
configure: WARNING: See also https://github.com/gost-engine/engine/wiki for information about gost-engine
checking for ECDSA_sign... yes
checking for SHA384_Init... yes
checking whether NID_X9_62_prime256v1 is declared... yes
checking whether NID_secp384r1 is declared... yes
checking for DSA_SIG_new... yes
checking whether NID_ED25519 is declared... yes
checking whether NID_ED448 is declared... yes
checking for X509_check_ca... yes
checking for SSL_get0_dane... yes
But stepping back a bit, since you are cross-compiling, you should also be using:
CPPFLAGS = "-isysroot=/builder-openssl"
LDFLAGS = "-sysroot=/builder-openssl"
The sysroot will help the compiler and linker find other headers and libraries, and not just OpenSSL gear. That assumes /builder-openssl
is your sysroot, which may not be the case. Change the path as required. /usr/mips64el-linux-gnuabi64
looks like it may be a good choice.
I am attempting to (cross) compile ldns for MIPS64EL, using container. The
configure
script does not recognize correct version of openssl... Any help is welcomed.relevant code:
Problem:
Except, this is 1.1.1k version... (compiled step back, and as far as I can tell it is working. This is MIPS64EL version)
full configure log: