inre/rust-mq

failed to run custom build command for `openssl-sys-extras v0.7.14`

greenpdx opened this issue · 1 comments

I have a compiler error. I am building on RPi4 4G using the latest RPiOS.
Linux raspberrypi 5.4.83-v7l+ #1379 SMP Mon Dec 14 13:11:54 GMT 2020 armv7l GNU/Linux

Using libssl.so.1.1 *

  • I think this is the issue, but I am not an expert in libssl.

Steps:
$ cargo new --bin --vcs git mqttctl
Edit Cargo.toml

[dependencies]
mqttc = "0.1.4"

Do I have to use the github version?

$ cargo build
Updating crates.io index
Compiling libc v0.2.84
Compiling pkg-config v0.3.19
Compiling gcc v0.3.55
Compiling log v0.4.14
Compiling lazy_static v0.2.11
Compiling bitflags v0.7.0
Compiling byteorder v0.4.2
Compiling cfg-if v1.0.0
Compiling mqtt3 v0.1.4
Compiling log v0.3.9
Compiling openssl-sys v0.7.17
Compiling openssl-sys-extras v0.7.14
Compiling openssl v0.7.14
Compiling rand v0.3.23
The following warnings were emitted during compilation:

warning: src/c_helpers.c: In function ‘rust_SSL_clone’:
warning: src/c_helpers.c:4:5: warning: implicit declaration of function ‘CRYPTO_add’; did you mean ‘CRYPTO_free’? [-Wimplicit-function-declaration]
warning: CRYPTO_add(&ssl->references, 1, CRYPTO_LOCK_SSL);
warning: ^~~~~~~~~~
warning: CRYPTO_free
warning: src/c_helpers.c:4:20: error: dereferencing pointer to incomplete type ‘SSL’ {aka ‘struct ssl_st’}
warning: CRYPTO_add(&ssl->references, 1, CRYPTO_LOCK_SSL);
warning: ^~
warning: src/c_helpers.c:4:37: error: ‘CRYPTO_LOCK_SSL’ undeclared (first use in this function); did you mean ‘CRYPTO_LOCK’?
warning: CRYPTO_add(&ssl->references, 1, CRYPTO_LOCK_SSL);
warning: ^~~~~~~~~~~~~~~
warning: CRYPTO_LOCK
warning: src/c_helpers.c:4:37: note: each undeclared identifier is reported only once for each function it appears in
warning: src/c_helpers.c: In function ‘rust_SSL_CTX_clone’:
warning: src/c_helpers.c:8:20: error: dereferencing pointer to incomplete type ‘SSL_CTX’ {aka ‘struct ssl_ctx_st’}
warning: CRYPTO_add(&ctx->references,1,CRYPTO_LOCK_SSL_CTX);
warning: ^~
warning: src/c_helpers.c:8:35: error: ‘CRYPTO_LOCK_SSL_CTX’ undeclared (first use in this function); did you mean ‘CRYPTO_EX_INDEX_SSL_CTX’?
warning: CRYPTO_add(&ctx->references,1,CRYPTO_LOCK_SSL_CTX);
warning: ^~~~~~~~~~~~~~~~~~~
warning: CRYPTO_EX_INDEX_SSL_CTX
warning: src/c_helpers.c: In function ‘rust_X509_clone’:
warning: src/c_helpers.c:12:21: error: dereferencing pointer to incomplete type ‘X509’ {aka ‘struct x509_st’}
warning: CRYPTO_add(&x509->references,1,CRYPTO_LOCK_X509);
warning: ^~
warning: src/c_helpers.c:12:36: error: ‘CRYPTO_LOCK_X509’ undeclared (first use in this function); did you mean ‘CRYPTO_LOCK’?
warning: CRYPTO_add(&x509->references,1,CRYPTO_LOCK_X509);
warning: ^~~~~~~~~~~~~~~~
warning: CRYPTO_LOCK

error: failed to run custom build command for openssl v0.7.14

Caused by:
process didn't exit successfully: /home/pi/RUST/mctl/target/debug/build/openssl-6e0fb680d6c1cab5/build-script-build (exit code: 101)
--- stdout
TARGET = Some("armv7-unknown-linux-gnueabihf")
OPT_LEVEL = Some("0")
TARGET = Some("armv7-unknown-linux-gnueabihf")
HOST = Some("armv7-unknown-linux-gnueabihf")
TARGET = Some("armv7-unknown-linux-gnueabihf")
TARGET = Some("armv7-unknown-linux-gnueabihf")
HOST = Some("armv7-unknown-linux-gnueabihf")
CC_armv7-unknown-linux-gnueabihf = None
CC_armv7_unknown_linux_gnueabihf = None
HOST_CC = None
CC = None
HOST = Some("armv7-unknown-linux-gnueabihf")
TARGET = Some("armv7-unknown-linux-gnueabihf")
HOST = Some("armv7-unknown-linux-gnueabihf")
CFLAGS_armv7-unknown-linux-gnueabihf = None
CFLAGS_armv7_unknown_linux_gnueabihf = None
HOST_CFLAGS = None
CFLAGS = None
DEBUG = Some("true")
running: "cc" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-march=armv7-a" "-I" "/usr/include" "-Wall" "-Wextra" "-o" "/home/pi/RUST/mctl/target/debug/build/openssl-36d5fa2cddf00564/out/src/c_helpers.o" "-c" "src/c_helpers.c"
cargo:warning=src/c_helpers.c: In function ‘rust_SSL_clone’:
cargo:warning=src/c_helpers.c:4:5: warning: implicit declaration of function ‘CRYPTO_add’; did you mean ‘CRYPTO_free’? [-Wimplicit-function-declaration]
cargo:warning= CRYPTO_add(&ssl->references, 1, CRYPTO_LOCK_SSL);
cargo:warning= ^~~~~~~~~~
cargo:warning= CRYPTO_free
cargo:warning=src/c_helpers.c:4:20: error: dereferencing pointer to incomplete type ‘SSL’ {aka ‘struct ssl_st’}
cargo:warning= CRYPTO_add(&ssl->references, 1, CRYPTO_LOCK_SSL);
cargo:warning= ^~
cargo:warning=src/c_helpers.c:4:37: error: ‘CRYPTO_LOCK_SSL’ undeclared (first use in this function); did you mean ‘CRYPTO_LOCK’?
cargo:warning= CRYPTO_add(&ssl->references, 1, CRYPTO_LOCK_SSL);
cargo:warning= ^~~~~~~~~~~~~~~
cargo:warning= CRYPTO_LOCK
cargo:warning=src/c_helpers.c:4:37: note: each undeclared identifier is reported only once for each function it appears in
cargo:warning=src/c_helpers.c: In function ‘rust_SSL_CTX_clone’:
cargo:warning=src/c_helpers.c:8:20: error: dereferencing pointer to incomplete type ‘SSL_CTX’ {aka ‘struct ssl_ctx_st’}
cargo:warning= CRYPTO_add(&ctx->references,1,CRYPTO_LOCK_SSL_CTX);
cargo:warning= ^~
cargo:warning=src/c_helpers.c:8:35: error: ‘CRYPTO_LOCK_SSL_CTX’ undeclared (first use in this function); did you mean ‘CRYPTO_EX_INDEX_SSL_CTX’?
cargo:warning= CRYPTO_add(&ctx->references,1,CRYPTO_LOCK_SSL_CTX);
cargo:warning= ^~~~~~~~~~~~~~~~~~~
cargo:warning= CRYPTO_EX_INDEX_SSL_CTX
cargo:warning=src/c_helpers.c: In function ‘rust_X509_clone’:
cargo:warning=src/c_helpers.c:12:21: error: dereferencing pointer to incomplete type ‘X509’ {aka ‘struct x509_st’}
cargo:warning= CRYPTO_add(&x509->references,1,CRYPTO_LOCK_X509);
cargo:warning= ^~
cargo:warning=src/c_helpers.c:12:36: error: ‘CRYPTO_LOCK_X509’ undeclared (first use in this function); did you mean ‘CRYPTO_LOCK’?
cargo:warning= CRYPTO_add(&x509->references,1,CRYPTO_LOCK_X509);
cargo:warning= ^~~~~~~~~~~~~~~~
cargo:warning= CRYPTO_LOCK
exit code: 1

--- stderr
thread 'main' panicked at '

Internal error occurred: Command "cc" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-march=armv7-a" "-I" "/usr/include" "-Wall" "-Wextra" "-o" "/home/pi/RUST/mctl/target/debug/build/openssl-36d5fa2cddf00564/out/src/c_helpers.o" "-c" "src/c_helpers.c" with args "cc" did not execute successfully (status code exit code: 1).

', /home/pi/.cargo/registry/src/github.com-1285ae84e5963aae/gcc-0.3.55/src/lib.rs:1672:5
stack backtrace:
0: rust_begin_unwind
at /rustc/e1884a8e3c3e813aada8254edfa120e85bf5ffca/library/std/src/panicking.rs:495:5
1: std::panicking::begin_panic_fmt
at /rustc/e1884a8e3c3e813aada8254edfa120e85bf5ffca/library/std/src/panicking.rs:437:5
2: gcc::fail
at /home/pi/.cargo/registry/src/github.com-1285ae84e5963aae/gcc-0.3.55/src/lib.rs:1672:5
3: gcc::Build::compile
at /home/pi/.cargo/registry/src/github.com-1285ae84e5963aae/gcc-0.3.55/src/lib.rs:785:13
4: build_script_build::main
at ./build.rs:15:5
5: core::ops::function::FnOnce::call_once
at /rustc/e1884a8e3c3e813aada8254edfa120e85bf5ffca/library/core/src/ops/function.rs:227:5
note: Some details are omitted, run with RUST_BACKTRACE=full for a verbose backtrace.
warning: build failed, waiting for other jobs to finish...
The following warnings were emitted during compilation:

warning: src/openssl_shim.c: In function ‘SSL_CTX_set_ecdh_auto_shim’:
warning: src/openssl_shim.c:121:41: warning: unused parameter ‘ctx’ [-Wunused-parameter]
warning: int SSL_CTX_set_ecdh_auto_shim(SSL_CTX *ctx, int onoff) {
warning: ~~~~~~~~~^~~
warning: src/openssl_shim.c: In function ‘DH_new_from_params’:
warning: src/openssl_shim.c:132:7: error: dereferencing pointer to incomplete type ‘DH’ {aka ‘struct dh_st’}
warning: dh->p = p;
warning: ^~
warning: src/openssl_shim.c: In function ‘X509_get_extensions_shim’:
warning: src/openssl_shim.c:143:13: error: dereferencing pointer to incomplete type ‘X509’ {aka ‘struct x509_st’}
warning: return x->cert_info ? x->cert_info->extensions : NULL;
warning: ^~
warning: src/openssl_shim.c:144:1: warning: control reaches end of non-void function [-Wreturn-type]
warning: }
warning: ^

error: build failed

mqttc = { git = "https://github.com/inre/rust-mq" }
Still fails.