Skip to content

Add support for ohos targets #121

@LuuuXXX

Description

@LuuuXXX

There are some error while compiling tikv-jemalloc-sys:

~/jemallocator# cargo build --target x86_64-unknown-linux-ohos
    Updating crates.io index
     Locking 5 packages to latest compatible versions
      Adding cfg-if v0.1.10 (available: v1.0.0)
  Downloaded cc v1.2.16
  Downloaded cfg-if v0.1.10
  Downloaded shlex v1.3.0
  Downloaded paste v1.0.15
  Downloaded libc v0.2.170
  Downloaded 5 crates (908.9 KB) in 1.18s
   Compiling shlex v1.3.0
   Compiling libc v0.2.170
   Compiling paste v1.0.15
   Compiling cfg-if v0.1.10
   Compiling cc v1.2.16
   Compiling tikv-jemalloc-sys v0.6.0+5.3.0-1-ge13ca993e8ccb9ba9847cc330696e02839f328f7 (/root/jemallocator/jemalloc-sys)
error: failed to run custom build command for `tikv-jemalloc-sys v0.6.0+5.3.0-1-ge13ca993e8ccb9ba9847cc330696e02839f328f7 (/root/jemallocator/jemalloc-sys)`

Caused by:
  process didn't exit successfully: `/root/jemallocator/target/debug/build/tikv-jemalloc-sys-e1de131668060917/build-script-build` (exit status: 101)
  --- stdout
  TARGET=x86_64-unknown-linux-ohos
  HOST=x86_64-unknown-linux-gnu
  NUM_JOBS=4
  OUT_DIR="/root/jemallocator/target/x86_64-unknown-linux-ohos/debug/build/tikv-jemalloc-sys-d45dc39783021387/out"
  BUILD_DIR="/root/jemallocator/target/x86_64-unknown-linux-ohos/debug/build/tikv-jemalloc-sys-d45dc39783021387/out/build"
  SRC_DIR="/root/jemallocator/jemalloc-sys"
  cargo:rustc-cfg=prefixed
  cargo:rerun-if-env-changed=X86_64_UNKNOWN_LINUX_OHOS_JEMALLOC_OVERRIDE
  cargo:rerun-if-env-changed=JEMALLOC_OVERRIDE
  OPT_LEVEL = Some(0)
  OUT_DIR = Some(/root/jemallocator/target/x86_64-unknown-linux-ohos/debug/build/tikv-jemalloc-sys-d45dc39783021387/out)
  TARGET = Some(x86_64-unknown-linux-ohos)
  HOST = Some(x86_64-unknown-linux-gnu)
  cargo:rerun-if-env-changed=CC_x86_64-unknown-linux-ohos
  CC_x86_64-unknown-linux-ohos = None
  cargo:rerun-if-env-changed=CC_x86_64_unknown_linux_ohos
  CC_x86_64_unknown_linux_ohos = None
  cargo:rerun-if-env-changed=TARGET_CC
  TARGET_CC = None
  cargo:rerun-if-env-changed=CC
  CC = None
  cargo:rerun-if-env-changed=CROSS_COMPILE
  CROSS_COMPILE = None
  RUSTC_LINKER = None
  cargo:rerun-if-env-changed=CC_ENABLE_DEBUG_OUTPUT
  RUSTC_WRAPPER = None
  cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
  CRATE_CC_NO_DEFAULTS = None
  DEBUG = Some(true)
  CARGO_CFG_TARGET_FEATURE = Some(fxsr,sse,sse2)
  cargo:rerun-if-env-changed=CFLAGS
  CFLAGS = None
  cargo:rerun-if-env-changed=TARGET_CFLAGS
  TARGET_CFLAGS = None
  cargo:rerun-if-env-changed=CFLAGS_x86_64_unknown_linux_ohos
  CFLAGS_x86_64_unknown_linux_ohos = None
  cargo:rerun-if-env-changed=CFLAGS_x86_64-unknown-linux-ohos
  CFLAGS_x86_64-unknown-linux-ohos = None
  CARGO_ENCODED_RUSTFLAGS = Some()
  CC="cc"
  JEMALLOC_REPO_DIR="jemalloc"
  cargo:rerun-if-env-changed=X86_64_UNKNOWN_LINUX_OHOS_JEMALLOC_SYS_WITH_MALLOC_CONF
  cargo:rerun-if-env-changed=JEMALLOC_SYS_WITH_MALLOC_CONF
  cargo:rerun-if-env-changed=X86_64_UNKNOWN_LINUX_OHOS_JEMALLOC_SYS_WITH_LG_PAGE
  cargo:rerun-if-env-changed=JEMALLOC_SYS_WITH_LG_PAGE
  cargo:rerun-if-env-changed=X86_64_UNKNOWN_LINUX_OHOS_JEMALLOC_SYS_WITH_LG_HUGEPAGE
  cargo:rerun-if-env-changed=JEMALLOC_SYS_WITH_LG_HUGEPAGE
  cargo:rerun-if-env-changed=X86_64_UNKNOWN_LINUX_OHOS_JEMALLOC_SYS_WITH_LG_QUANTUM
  cargo:rerun-if-env-changed=JEMALLOC_SYS_WITH_LG_QUANTUM
  cargo:rerun-if-env-changed=X86_64_UNKNOWN_LINUX_OHOS_JEMALLOC_SYS_WITH_LG_VADDR
  cargo:rerun-if-env-changed=JEMALLOC_SYS_WITH_LG_VADDR
  --with-jemalloc-prefix=_rjem_
  CARGO_FEATURE_STATS not set
  running: cd "/root/jemallocator/target/x86_64-unknown-linux-ohos/debug/build/tikv-jemalloc-sys-d45dc39783021387/out/build" && CC="cc" "sh" "/root/jemallocator/target/x86_64-unknown-linux-ohos/debug/build/tikv-jemalloc-sys-d45dc39783021387/out/build/configure" "--with-version=5.3.0-1-ge13ca993e8ccb9ba9847cc330696e02839f328f7" "--disable-cxx" "--enable-doc=no" "--enable-shared=no" "--with-jemalloc-prefix=_rjem_" "--with-private-namespace=_rjem_" "--disable-stats" "--host=x86_64-unknown-linux-ohos" "--build=x86_64-unknown-linux-gnu" "--prefix=/root/jemallocator/target/x86_64-unknown-linux-ohos/debug/build/tikv-jemalloc-sys-d45dc39783021387/out"
  running: "tail" "-n" "100" "/root/jemallocator/target/x86_64-unknown-linux-ohos/debug/build/tikv-jemalloc-sys-d45dc39783021387/out/build/config.log"

  --- stderr
  configure: error: cannot find sources (Makefile.in) in /root/jemallocator/target/x86_64-unknown-linux-ohos/debug/build/tikv-jemalloc-sys-d45dc39783021387/out/build or ..
  tail: cannot open '/root/jemallocator/target/x86_64-unknown-linux-ohos/debug/build/tikv-jemalloc-sys-d45dc39783021387/out/build/config.log' for reading: No such file or directory

  thread 'main' panicked at jemalloc-sys/build.rs:377:9:
  command did not execute successfully: "tail" "-n" "100" "/root/jemallocator/target/x86_64-unknown-linux-ohos/debug/build/tikv-jemalloc-sys-d45dc39783021387/out/build/config.log"
  expected success, got: exit status: 1
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

It looks like Jemalloc's build-aux/config.sub is out of date.
The latest version of https://savannah.gnu.org/projects/config has added support for OHOS targets.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions