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

No mips-unknown-linux-musl support #522

Open
greenfn2233 opened this issue Sep 14, 2024 · 2 comments
Open

No mips-unknown-linux-musl support #522

greenfn2233 opened this issue Sep 14, 2024 · 2 comments
Assignees
Labels
build problem Build failure

Comments

@greenfn2233
Copy link

greenfn2233 commented Sep 14, 2024

Problem:

Host machine: x86_x64_linux_unkown
Trying to compile aws-lc-rs/sys for mips-unknown-linux-musl using cross-rs fails :

The following warnings were emitted during compilation:

warning: [email protected]: CMAKE environment variable set: cmake
warning: [email protected]: Generating bindings - internal bindgen. Platform: mips-unknown-linux-musl

error: failed to run custom build command for `aws-lc-sys v0.21.1`

Caused by:
  process didn't exit successfully: `/target/release/build/aws-lc-sys-cf918696693dee5a/build-script-main` (exit status: 101)
  --- stdout
  cargo:rerun-if-env-changed=AWS_LC_SYS_NO_PREFIX
  cargo:rerun-if-env-changed=AWS_LC_SYS_INTERNAL_BINDGEN
  cargo:rerun-if-env-changed=AWS_LC_SYS_EXTERNAL_BINDGEN
  cargo:rerun-if-env-changed=AWS_LC_SYS_NO_ASM
  cargo:rerun-if-env-changed=AWS_LC_SYS_CFLAGS
  cargo:rerun-if-env-changed=AWS_LC_SYS_PREBUILT_NASM
  cargo:rerun-if-env-changed=AWS_LC_SYS_C_STD
  cargo:rerun-if-env-changed=AWS_LC_SYS_CMAKE_BUILDER
  cargo:rerun-if-env-changed=AWS_LC_SYS_STATIC
  cargo:rerun-if-env-changed=CMAKE
  cargo:rerun-if-env-changed=CMAKE
  cargo:warning=CMAKE environment variable set: cmake
  cargo:warning=Generating bindings - internal bindgen. Platform: mips-unknown-linux-musl
  cargo:rerun-if-env-changed=AWS_LC_SYS_INCLUDES

  --- stderr
  /home//.local/share/cargo/registry/src/index.crates.io-6f17d22bba15001f/aws-lc-sys-0.21.1/aws-lc/include/openssl/target.h:78:2: error: "Unknown target CPU"
  /home//.local/share/cargo/registry/src/index.crates.io-6f17d22bba15001f/aws-lc-sys-0.21.1/aws-lc/include/openssl/bn.h:176:2: error: "Must define either OPENSSL_32_BIT or OPENSSL_64_BIT"
  /home//.local/share/cargo/registry/src/index.crates.io-6f17d22bba15001f/aws-lc-sys-0.21.1/aws-lc/include/openssl/bn.h:234:44: error: unknown type name 'BN_ULONG'
  /home//.local/share/cargo/registry/src/index.crates.io-6f17d22bba15001f/aws-lc-sys-0.21.1/aws-lc/include/openssl/bn.h:332:16: error: unknown type name 'BN_ULONG'
  /home//.local/share/cargo/registry/src/index.crates.io-6f17d22bba15001f/aws-lc-sys-0.21.1/aws-lc/include/openssl/bn.h:405:43: error: unknown type name 'BN_ULONG'
  /home//.local/share/cargo/registry/src/index.crates.io-6f17d22bba15001f/aws-lc-sys-0.21.1/aws-lc/include/openssl/bn.h:418:43: error: unknown type name 'BN_ULONG'
  /home//.local/share/cargo/registry/src/index.crates.io-6f17d22bba15001f/aws-lc-sys-0.21.1/aws-lc/include/openssl/bn.h:427:44: error: unknown type name 'BN_ULONG'
  /home//.local/share/cargo/registry/src/index.crates.io-6f17d22bba15001f/aws-lc-sys-0.21.1/aws-lc/include/openssl/bn.h:445:16: error: unknown type name 'BN_ULONG'
  /home//.local/share/cargo/registry/src/index.crates.io-6f17d22bba15001f/aws-lc-sys-0.21.1/aws-lc/include/openssl/bn.h:445:56: error: unknown type name 'BN_ULONG'
  /home//.local/share/cargo/registry/src/index.crates.io-6f17d22bba15001f/aws-lc-sys-0.21.1/aws-lc/include/openssl/bn.h:462:49: error: unknown type name 'BN_ULONG'
  /home//.local/share/cargo/registry/src/index.crates.io-6f17d22bba15001f/aws-lc-sys-0.21.1/aws-lc/include/openssl/bn.h:476:53: error: unknown type name 'BN_ULONG'
  /home//.local/share/cargo/registry/src/index.crates.io-6f17d22bba15001f/aws-lc-sys-0.21.1/aws-lc/include/openssl/bn.h:485:49: error: unknown type name 'BN_ULONG'
  /home//.local/share/cargo/registry/src/index.crates.io-6f17d22bba15001f/aws-lc-sys-0.21.1/aws-lc/include/openssl/bn.h:544:16: error: unknown type name 'BN_ULONG'
  /home//.local/share/cargo/registry/src/index.crates.io-6f17d22bba15001f/aws-lc-sys-0.21.1/aws-lc/include/openssl/bn.h:544:54: error: unknown type name 'BN_ULONG'
  /home//.local/share/cargo/registry/src/index.crates.io-6f17d22bba15001f/aws-lc-sys-0.21.1/aws-lc/include/openssl/bn.h:662:48: error: unknown type name 'BN_ULONG'
  /home//.local/share/cargo/registry/src/index.crates.io-6f17d22bba15001f/aws-lc-sys-0.21.1/aws-lc/include/openssl/bn.h:975:52: error: unknown type name 'BN_ULONG'
  /home//.local/share/cargo/registry/src/index.crates.io-6f17d22bba15001f/aws-lc-sys-0.21.1/aws-lc/include/openssl/bn.h:1019:3: error: unknown type name 'BN_ULONG'
  /home//.local/share/cargo/registry/src/index.crates.io-6f17d22bba15001f/aws-lc-sys-0.21.1/aws-lc/include/openssl/bn.h:1050:3: error: unknown type name 'BN_ULONG'
  /home//.local/share/cargo/registry/src/index.crates.io-6f17d22bba15001f/aws-lc-sys-0.21.1/aws-lc/include/openssl/bn.h:1053:42: error: unknown type name 'BN_ULONG'
  thread 'main' panicked at /home//.local/share/cargo/registry/src/index.crates.io-6f17d22bba15001f/aws-lc-sys-0.21.1/builder/bindgen.rs:106:10:
  Unable to generate bindings.: ClangDiagnostic("/home//.local/share/cargo/registry/src/index.crates.io-6f17d22bba15001f/aws-lc-sys-0.21.1/aws-lc/include/openssl/target.h:78:2: error: \"Unknown target CPU\"\n/home//.local/share/cargo/registry/src/index.crates.io-6f17d22bba15001f/aws-lc-sys-0.21.1/aws-lc/include/openssl/bn.h:176:2: error: \"Must define either OPENSSL_32_BIT or OPENSSL_64_BIT\"\n/home//.local/share/cargo/registry/src/index.crates.io-6f17d22bba15001f/aws-lc-sys-0.21.1/aws-lc/include/openssl/bn.h:234:44: error: unknown type name 'BN_ULONG'\n/home//.local/share/cargo/registry/src/index.crates.io-6f17d22bba15001f/aws-lc-sys-0.21.1/aws-lc/include/openssl/bn.h:332:16: error: unknown type name 'BN_ULONG'\n/home//.local/share/cargo/registry/src/index.crates.io-6f17d22bba15001f/aws-lc-sys-0.21.1/aws-lc/include/openssl/bn.h:405:43: error: unknown type name 'BN_ULONG'\n/home//.local/share/cargo/registry/src/index.crates.io-6f17d22bba15001f/aws-lc-sys-0.21.1/aws-lc/include/openssl/bn.h:418:43: error: unknown type name 'BN_ULONG'\n/home//.local/share/cargo/registry/src/index.crates.io-6f17d22bba15001f/aws-lc-sys-0.21.1/aws-lc/include/openssl/bn.h:427:44: error: unknown type name 'BN_ULONG'\n/home//.local/share/cargo/registry/src/index.crates.io-6f17d22bba15001f/aws-lc-sys-0.21.1/aws-lc/include/openssl/bn.h:445:16: error: unknown type name 'BN_ULONG'\n/home//.local/share/cargo/registry/src/index.crates.io-6f17d22bba15001f/aws-lc-sys-0.21.1/aws-lc/include/openssl/bn.h:445:56: error: unknown type name 'BN_ULONG'\n/home//.local/share/cargo/registry/src/index.crates.io-6f17d22bba15001f/aws-lc-sys-0.21.1/aws-lc/include/openssl/bn.h:462:49: error: unknown type name 'BN_ULONG'\n/home//.local/share/cargo/registry/src/index.crates.io-6f17d22bba15001f/aws-lc-sys-0.21.1/aws-lc/include/openssl/bn.h:476:53: error: unknown type name 'BN_ULONG'\n/home//.local/share/cargo/registry/src/index.crates.io-6f17d22bba15001f/aws-lc-sys-0.21.1/aws-lc/include/openssl/bn.h:485:49: error: unknown type name 'BN_ULONG'\n/home//.local/share/cargo/registry/src/index.crates.io-6f17d22bba15001f/aws-lc-sys-0.21.1/aws-lc/include/openssl/bn.h:544:16: error: unknown type name 'BN_ULONG'\n/home//.local/share/cargo/registry/src/index.crates.io-6f17d22bba15001f/aws-lc-sys-0.21.1/aws-lc/include/openssl/bn.h:544:54: error: unknown type name 'BN_ULONG'\n/home//.local/share/cargo/registry/src/index.crates.io-6f17d22bba15001f/aws-lc-sys-0.21.1/aws-lc/include/openssl/bn.h:662:48: error: unknown type name 'BN_ULONG'\n/home//.local/share/cargo/registry/src/index.crates.io-6f17d22bba15001f/aws-lc-sys-0.21.1/aws-lc/include/openssl/bn.h:975:52: error: unknown type name 'BN_ULONG'\n/home//.local/share/cargo/registry/src/index.crates.io-6f17d22bba15001f/aws-lc-sys-0.21.1/aws-lc/include/openssl/bn.h:1019:3: error: unknown type name 'BN_ULONG'\n/home//.local/share/cargo/registry/src/index.crates.io-6f17d22bba15001f/aws-lc-sys-0.21.1/aws-lc/include/openssl/bn.h:1050:3: error: unknown type name 'BN_ULONG'\n/home//.local/share/cargo/registry/src/index.crates.io-6f17d22bba15001f/aws-lc-sys-0.21.1/aws-lc/include/openssl/bn.h:1053:42: error: unknown type name 'BN_ULONG'\n")
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...
[cross] warning: rust-std is not available for mips-unknown-linux-musl
[cross] note: you may need to build components for the target via `-Z build-std=<components>` or in your cross configuration specify `target.mips-unknown-linux-musl.build-std`
              the available components are core, std, alloc, and proc_macro

Note: home/{user} redacted from output.

@justinwsmith
Copy link
Contributor

This appears to be due to the __MIPSEL__ macro not being provided by the compiler.(?) You can see the logic that expects it here. Instead it's falling through to here to generate the Unknown target CPU message that you see.

One workaround you could try would be to define these macros via the environment: AWS_LC_SYS_CFLAGS="-D__MIPSEL__". (Note that with cross-rs, its build environment does not automatically pick up variables from the host environment. More information about this is here.)

@justsmth justsmth self-assigned this Sep 16, 2024
@justsmth justsmth added the build problem Build failure label Sep 16, 2024
@justsmth
Copy link
Contributor

justsmth commented Oct 3, 2024

I'm having trouble finding a Rust toolchain I can use for this. (mips-unknown-linux-musl is a Tier 3 platform for Rust.)

Could you provide some guidance on how I can setup the build environment to target this platform?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build problem Build failure
Projects
None yet
Development

No branches or pull requests

3 participants