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

cargo build --target=aarch64-unknown-fuchsia #2248

Open
wfxxy opened this issue Jun 7, 2024 · 1 comment
Open

cargo build --target=aarch64-unknown-fuchsia #2248

wfxxy opened this issue Jun 7, 2024 · 1 comment

Comments

@wfxxy
Copy link

wfxxy commented Jun 7, 2024

Hi owner,
when cargo build --target=aarch64-unknown-fuchsia
some error occur,how to resolve this question?

build error log:
Compiling libc v0.2.155
Compiling foreign-types-shared v0.1.1
Compiling cfg-if v1.0.0
Compiling bitflags v2.5.0
Compiling once_cell v1.19.0
Compiling openssl-sys v0.9.102
Compiling openssl-macros v0.1.1
error: failed to run custom build command for openssl-sys v0.9.102

Caused by:
process didn't exit successfully: openssl/target/debug/build/openssl-sys-908aa9a24708f521/build-script-main (exit status: 101)
--- stdout
cargo:rerun-if-env-changed=AARCH64_UNKNOWN_FUCHSIA_OPENSSL_LIB_DIR
AARCH64_UNKNOWN_FUCHSIA_OPENSSL_LIB_DIR unset
cargo:rerun-if-env-changed=OPENSSL_LIB_DIR
OPENSSL_LIB_DIR unset
cargo:rerun-if-env-changed=AARCH64_UNKNOWN_FUCHSIA_OPENSSL_INCLUDE_DIR
AARCH64_UNKNOWN_FUCHSIA_OPENSSL_INCLUDE_DIR unset
cargo:rerun-if-env-changed=OPENSSL_INCLUDE_DIR
OPENSSL_INCLUDE_DIR unset
cargo:rerun-if-env-changed=AARCH64_UNKNOWN_FUCHSIA_OPENSSL_DIR
AARCH64_UNKNOWN_FUCHSIA_OPENSSL_DIR unset
cargo:rerun-if-env-changed=OPENSSL_DIR
OPENSSL_DIR unset
cargo:rerun-if-env-changed=OPENSSL_NO_PKG_CONFIG
cargo:rerun-if-env-changed=PKG_CONFIG_ALLOW_CROSS_aarch64-unknown-fuchsia
cargo:rerun-if-env-changed=PKG_CONFIG_ALLOW_CROSS_aarch64_unknown_fuchsia
cargo:rerun-if-env-changed=TARGET_PKG_CONFIG_ALLOW_CROSS
cargo:rerun-if-env-changed=PKG_CONFIG_ALLOW_CROSS
cargo:rerun-if-env-changed=PKG_CONFIG_aarch64-unknown-fuchsia
cargo:rerun-if-env-changed=PKG_CONFIG_aarch64_unknown_fuchsia
cargo:rerun-if-env-changed=TARGET_PKG_CONFIG
cargo:rerun-if-env-changed=PKG_CONFIG
cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_aarch64-unknown-fuchsia
cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_aarch64_unknown_fuchsia
cargo:rerun-if-env-changed=TARGET_PKG_CONFIG_SYSROOT_DIR
cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR
run pkg_config fail: pkg-config has not been configured to support cross-compilation.

Install a sysroot for the target platform and configure it via
PKG_CONFIG_SYSROOT_DIR and PKG_CONFIG_PATH, or install a
cross-compiling wrapper for pkg-config and set it via
PKG_CONFIG environment variable.

--- stderr
thread 'main' panicked at openssl/vendor/openssl-sys/build/find_normal.rs:190:5:

Could not find directory of OpenSSL installation, and this -sys crate cannot
proceed without this knowledge. If OpenSSL is installed and this crate had
trouble finding it, you can set the OPENSSL_DIR environment variable for the
compilation process.

Make sure you also have the development packages of openssl installed.
For example, libssl-dev on Ubuntu or openssl-devel on Fedora.

If you're in a situation where you think the directory should be found
automatically, please open a bug at https://github.com/sfackler/rust-openssl
and include information about your system as well as this message.

$HOST = x86_64-unknown-linux-gnu
$TARGET = aarch64-unknown-fuchsia
openssl-sys = 0.9.102

note: run with RUST_BACKTRACE=1 environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...

@Skepfyr
Copy link
Collaborator

Skepfyr commented Jun 8, 2024

How are you expecting this to work? It looks like you're trying to cross-compile from x86 Linux to aarch64 Fuchsia? You need a version of OpenSSL to link to. Unfortunately I don't think openssl-src supports Fuchsia, so I think you'll need to do one of:

  1. Add support for Fuchsia to openssl-src, allowing you to use that to build OpenSSL and then you can use the vendored feature
  2. Obtain a version of OpenSSL for AArch64 Fuchsia and configure pkg-config for cross compilation https://docs.rs/pkg-config/latest/pkg_config/#cross-compilation
  3. Cross-compile OpenSSL yourself and configure the openssl crate to use that https://docs.rs/openssl/latest/openssl/#manual

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

2 participants