Skip to content

Cross compilation support. #82

Closed
Closed
@Toasterson

Description

@Toasterson

Hey all.

I am trying to compile the rust compiler to aarch64_unknown_illumos from my x86_64_unknown_illumos system. However as described in rust-lang/rust#112936 I get the following error.

error: failed to run custom build command for `psm v0.1.21`

Caused by:
  process didn't exit successfully: `/var/lib/abuild/rust/build/x86_64-unknown-illumos/stage1-rustc/release/build/psm-61c9c6ef89c427d5/build-script-build` (exit status: 1)
  --- stdout
  OPT_LEVEL = Some("3")
  TARGET = Some("aarch64-unknown-illumos")
  HOST = Some("x86_64-unknown-illumos")
  cargo:rerun-if-env-changed=CC_aarch64-unknown-illumos
  CC_aarch64-unknown-illumos = None
  cargo:rerun-if-env-changed=CC_aarch64_unknown_illumos
  CC_aarch64_unknown_illumos = Some("gcc")
  cargo:rerun-if-env-changed=CFLAGS_aarch64-unknown-illumos
  CFLAGS_aarch64-unknown-illumos = None
  cargo:rerun-if-env-changed=CFLAGS_aarch64_unknown_illumos
  CFLAGS_aarch64_unknown_illumos = Some("-ffunction-sections -fdata-sections -fPIC")
  cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
  CRATE_CC_NO_DEFAULTS = None
  DEBUG = Some("false")
  CARGO_CFG_TARGET_FEATURE = Some("neon")
  cargo:rustc-cfg=asm
  cargo:rustc-cfg=switchable_stack
  running: "gcc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-ffunction-sections" "-fdata-sections" "-fPIC" "-xassembler-with-cpp" "-DCFG_TARGET_OS_illumos" "-DCFG_TARGET_ARCH_aarch64" "-DCFG_TARGET_ENV_" "-o" "/var/lib/abuild/rust/build/x86_64-unknown-illumos/stage1-rustc/aarch64-unknown-illumos/release/build/psm-a54651dd69990eb0/out/src/arch/aarch_aapcs64.o" "-c" "src/arch/aarch_aapcs64.s"
  cargo:warning=src/arch/aarch_aapcs64.s: Assembler messages:
  cargo:warning=src/arch/aarch_aapcs64.s:35: Error: no such instruction: `orr w0,wzr,'
  cargo:warning=src/arch/aarch_aapcs64.s:48: Error: operand size mismatch for `mov'
  cargo:warning=src/arch/aarch_aapcs64.s:62: Error: operand size mismatch for `mov'
  cargo:warning=src/arch/aarch_aapcs64.s:63: Error: no such instruction: `br x1'
  cargo:warning=src/arch/aarch_aapcs64.s:75: Error: no such instruction: `stp x29,x30,[sp,'
  cargo:warning=src/arch/aarch_aapcs64.s:76: Error: bad register expression
  cargo:warning=src/arch/aarch_aapcs64.s:77: Error: operand size mismatch for `mov'
  cargo:warning=src/arch/aarch_aapcs64.s:78: Error: bad register expression
  cargo:warning=src/arch/aarch_aapcs64.s:79: Error: bad register expression
  cargo:warning=src/arch/aarch_aapcs64.s:80: Error: bad register expression
  cargo:warning=src/arch/aarch_aapcs64.s:81: Error: operand size mismatch for `mov'
  cargo:warning=src/arch/aarch_aapcs64.s:82: Error: no such instruction: `blr x2'
  cargo:warning=src/arch/aarch_aapcs64.s:83: Error: operand size mismatch for `mov'
  cargo:warning=src/arch/aarch_aapcs64.s:84: Error: bad register expression
  cargo:warning=src/arch/aarch_aapcs64.s:85: Error: no such instruction: `ldp x29,x30,[sp],'
  cargo:warning=src/arch/aarch_aapcs64.s:86: Error: bad register expression
  cargo:warning=src/arch/aarch_aapcs64.s:87: Error: bad register expression
  cargo:warning=src/arch/aarch_aapcs64.s:88: Error: bad register expression
  exit status: 1

  --- stderr


  error occurred: Command "gcc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-ffunction-sections" "-fdata-sections" "-fPIC" "-xassembler-with-cpp" "-DCFG_TARGET_OS_illumos" "-DCFG_TARGET_ARCH_aarch64" "-DCFG_TARGET_ENV_" "-o" "/var/lib/abuild/rust/build/x86_64-unknown-illumos/stage1-rustc/aarch64-unknown-illumos/release/build/psm-a54651dd69990eb0/out/src/arch/aarch_aapcs64.o" "-c" "src/arch/aarch_aapcs64.s" with args "gcc" did not execute successfully (status code exit status: 1).

From waht I can read out gcc build does not understand that ARM assembler. Do you know how to setup a usable cross compiler on linux or another unix OS? if I have the guide to setup the compiler properly or the packages and the OS this build script assumes I can copy the packaging to our system. Alternatively could we get Variables we can set during build to sepecify a different compiler binary so I can force the rust build to use the ARM cross compiler instead of the native system one?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions