ARM 服务器上编译 tikv 出错

为提高效率,提问时请提供以下信息,问题描述清晰可优先响应。

  • 【TiDB 版本】:v2.1.14
  • 【问题描述】:arm64 服务器上编译 tikv 二进制出错

因为需要在 arm 服务器上打 tikv 镜像,参考了TUG上问答和这两篇文章:

用的 CentOS 7.6,内核 4.14.0-115.el7a.0.1.aarch64

但是在构建 tikv 二进制时出错:

# cargo version
cargo 1.29.0-nightly (af9e40c26 2018-07-05)

# cargo build --release --features "default portable no-fail" -v
       Fresh nodrop v0.1.12
       Fresh cfg-if v0.1.3
       Fresh lazy_static v1.0.0
       Fresh memoffset v0.2.1
       Fresh scopeguard v0.3.3
       Fresh semver-parser v0.7.0
       Fresh autocfg v0.1.1
       Fresh either v1.5.0
       Fresh void v1.0.2
       Fresh matches v0.1.2
       Fresh ucd-util v0.1.1
       Fresh rand_core v0.3.0
       Fresh byteorder v1.2.4
       Fresh semver v0.1.20
       Fresh lazycell v1.2.1
       Fresh unicode-normalization v0.1.2
       Fresh slab v0.4.1
       Fresh winapi-build v0.1.1
       Fresh utf8-ranges v1.0.0
       Fresh glob v0.3.0
       Fresh pkg-config v0.3.14
       Fresh futures v0.1.23
       Fresh unicode-xid v0.0.4
       Fresh percent-encoding v1.0.0
       Fresh build_const v0.2.1
       Fresh stable_deref_trait v1.0.0
       Fresh unicode-xid v0.1.0
       Fresh fnv v1.0.5
       Fresh rand_core v0.2.1
       Fresh quote v0.3.15
       Fresh gcc v0.3.54
       Fresh winapi v0.2.8
       Fresh itoa v0.4.2
       Fresh quick-error v1.2.2
       Fresh string v0.1.2
       Fresh rustc-serialize v0.3.24
       Fresh language-tags v0.2.2
       Fresh typeable v0.1.2
       Fresh bitflags v1.0.1
       Fresh nom v1.2.4
       Fresh slog v2.3.3
       Fresh httparse v1.1.2
       Fresh unicode-width v0.1.4
       Fresh crossbeam v0.2.12
       Fresh traitobject v0.0.1
       Fresh bitflags v0.4.0
       Fresh lazy_static v0.2.8
       Fresh crossbeam-utils v0.5.0
       Fresh byteorder v0.5.1
       Fresh try-lock v0.2.2
       Fresh scoped-tls v0.1.0
       Fresh slab v0.1.3
       Fresh rustc-demangle v0.1.9
       Fresh bytes v0.3.0
       Fresh ansi_term v0.11.0
       Fresh strsim v0.7.0
       Fresh quick-error v0.2.2
       Fresh spin v0.4.9
       Fresh take_mut v0.2.2
       Fresh vec_map v0.8.1
       Fresh more-asserts v0.1.0
       Fresh hex v0.3.2
       Fresh arrayvec v0.4.7
       Fresh crossbeam-utils v0.2.2
       Fresh crossbeam-utils v0.6.3
       Fresh log v0.4.6 (https://github.com/busyjay/log?branch=revert-to-static#20502c57)
       Fresh semver v0.9.0
       Fresh unreachable v1.0.0
       Fresh unicode-bidi v0.2.3
       Fresh regex-syntax v0.6.2
       Fresh rand_isaac v0.1.1
       Fresh rand_hc v0.1.0
       Fresh rand_xorshift v0.1.1
       Fresh fxhash v0.2.1
       Fresh term v0.5.1
       Fresh murmur3 v0.4.0 (https://github.com/pingcap/murmur3.git#4af9e1a8)
       Fresh rustc_version v0.1.7
       Fresh tokio-executor v0.1.2
       Fresh synom v0.11.3
       Fresh owning_ref v0.3.3
       Fresh proc-macro2 v0.3.8
       Fresh textwrap v0.10.0
       Fresh slog-scope v4.0.1
       Fresh crossbeam-epoch v0.5.2
       Fresh crossbeam-epoch v0.3.1
       Fresh crossbeam-epoch v0.7.0
       Fresh log v0.3.9 (https://github.com/busyjay/log?branch=use-static-module#70860d6c)
       Fresh want v0.0.6
       Fresh libc v0.2.47
       Fresh rustc_version v0.2.2
       Fresh thread_local v0.3.5
       Fresh smallvec v0.6.3
       Fresh idna v0.1.0
       Fresh num-traits v0.2.5
       Fresh serde v1.0.71
       Fresh tokio-timer v0.2.4
       Fresh syn v0.11.11
       Fresh lock_api v0.1.3
       Fresh protobuf v2.0.4
       Fresh quote v0.5.2
       Fresh ryu v0.2.3
       Fresh crossbeam-deque v0.2.0
       Fresh crossbeam-deque v0.6.3
       Fresh hpack v0.2.0
       Fresh mime v0.2.2
       Fresh slog-stdlog v3.0.4-pre
       Fresh num_cpus v1.6.2
       Fresh memchr v2.0.1
       Fresh iovec v0.1.2
       Fresh rand_os v0.1.0
       Fresh net2 v0.2.33
       Fresh rand v0.4.2
       Fresh time v0.1.38
       Fresh rand v0.5.5
       Fresh nix v0.5.1
       Fresh atty v0.2.2
       Fresh isatty v0.1.7
       Fresh rand v0.3.14
       Fresh nix v0.11.0
       Fresh fs2 v0.4.0
       Fresh rand_chacha v0.1.1
       Fresh slog-async v2.3.0
       Fresh url v1.7.0
       Fresh num-integer v0.1.39
       Fresh num-complex v0.2.0
       Fresh kernel32-sys v0.2.2
       Fresh ws2_32-sys v0.2.1
       Fresh dbghelp-sys v0.2.0
       Fresh indexmap v1.0.1
       Fresh toml v0.4.3
       Fresh serde_derive_internals v0.15.1
       Fresh crc v1.8.1
       Fresh tipb v0.0.1 (https://github.com/pingcap/tipb.git#658ea9c1)
       Fresh syn v0.13.11
       Fresh serde_json v1.0.26
       Fresh sys-info v0.5.1
       Fresh solicit v0.4.4
       Fresh rayon-core v1.4.1
       Fresh futures-cpupool v0.1.8
       Fresh aho-corasick v0.6.6
       Fresh bytes v0.4.11
       Fresh mio v0.6.16
       Fresh parking_lot_core v0.2.13
       Fresh uuid v0.6.3
       Fresh raft v0.4.3
       Fresh clap v2.32.0
       Fresh rust-crypto v0.2.36
       Fresh zipf v0.2.0
       Fresh fail v0.2.0
       Fresh tempdir v0.3.4
       Fresh signal v0.6.0
       Fresh cookie v0.2.5
       Fresh num-bigint v0.2.0
       Fresh chrono v0.4.5
       Fresh num-iter v0.1.37
       Fresh unicase v1.4.0
       Fresh procinfo v0.3.1
       Fresh utime v0.2.0
       Fresh miow v0.1.5
       Fresh serde_derive v1.0.8
       Fresh derive_more v0.11.0
       Fresh prometheus-static-metric v0.1.4
       Fresh rayon v1.0.3
       Fresh regex v1.0.2
       Fresh tokio-io v0.1.10
       Fresh http v0.1.14
       Fresh parking_lot v0.6.3
       Fresh rand_pcg v0.1.1
       Fresh num-rational v0.2.1
       Fresh slog-term v2.4.0
       Fresh hyper v0.9.18
       Fresh mio v0.5.1
       Fresh cc v1.0.28
       Fresh parse-zoneinfo v0.2.0
       Fresh tokio-reactor v0.1.3
       Fresh tokio-codec v0.1.1
       Fresh h2 v0.1.14
       Fresh crossbeam-channel v0.2.4
       Fresh rand v0.6.3
       Fresh num v0.2.0
       Fresh prometheus v0.4.2
       Fresh cmake v0.1.28
       Fresh tokio-tcp v0.1.2
       Fresh tokio-udp v0.1.3
       Fresh tokio-threadpool v0.1.9
       Fresh tokio-fs v0.1.4
       Fresh bzip2-sys v0.1.7 (https://github.com/alexcrichton/bzip2-rs.git#18fd3e18)
       Fresh libz-sys v1.0.25
       Fresh zstd-sys v1.4.10+zstd.1.4.0 (https://github.com/gyscos/zstd-rs.git#d09a3a06)
       Fresh lz4-sys v1.8.0 (https://github.com/busyjay/lz4-rs.git?branch=adjust-build#41509fea)
       Fresh backtrace-sys v0.1.23
       Fresh chrono-tz v0.5.0
       Fresh tokio v0.1.7
       Fresh snappy-sys v0.1.0 (https://github.com/busyjay/rust-snappy.git?branch=static-link#8c12738b)
       Fresh grpcio-sys v0.2.3
       Fresh backtrace v0.2.3
       Fresh tokio-core v0.1.17
       Fresh hyper v0.12.19
       Fresh librocksdb_sys v0.1.0 (https://github.com/pingcap/rust-rocksdb.git?branch=release-2.1#bcf68caa)
       Fresh grpcio v0.3.0
       Fresh rocksdb v0.3.0 (https://github.com/pingcap/rust-rocksdb.git?branch=release-2.1#bcf68caa)
       Fresh kvproto v0.0.1 (https://github.com/pingcap/kvproto.git?branch=release-2.1#32a5ba2a)
   Compiling tikv v2.1.14 (file:///data/arm/tidb/tikv)
     Running `rustc --crate-name tikv_server src/bin/tikv-server.rs --crate-type bin --emit=dep-info,link -C opt-level=3 -C lto -C codegen-units=2 -C debuginfo=2 --cfg 'feature="default"' --cfg 'feature="fail"' --cfg 'feature="no-fail"' --cfg 'feature="portable"' --cfg 'feature="rocksdb"' -C metadata=7cd1a85bd03976dc -C extra-filename=-7cd1a85bd03976dc --out-dir /data/arm/tidb/tikv/target/release/deps -L dependency=/data/arm/tidb/tikv/target/release/deps --extern backtrace=/data/arm/tidb/tikv/target/release/deps/libbacktrace-bceb72bbddbfdb78.rlib --extern bitflags=/data/arm/tidb/tikv/target/release/deps/libbitflags-de9784ae398543a1.rlib --extern byteorder=/data/arm/tidb/tikv/target/release/deps/libbyteorder-3d6724391174f960.rlib --extern chrono=/data/arm/tidb/tikv/target/release/deps/libchrono-3d8e772fb05ede15.rlib --extern chrono_tz=/data/arm/tidb/tikv/target/release/deps/libchrono_tz-1ce3e76886106452.rlib --extern clap=/data/arm/tidb/tikv/target/release/deps/libclap-dcb07e049bd65780.rlib --extern crc=/data/arm/tidb/tikv/target/release/deps/libcrc-ee09a991656912bf.rlib --extern crossbeam_channel=/data/arm/tidb/tikv/target/release/deps/libcrossbeam_channel-d9e5570c628e3fee.rlib --extern crossbeam=/data/arm/tidb/tikv/target/release/deps/libcrossbeam-32544bbc3fb17c74.rlib --extern derive_more=/data/arm/tidb/tikv/target/release/deps/libderive_more-1889ffd3c9f7ee68.so --extern fail=/data/arm/tidb/tikv/target/release/deps/libfail-be6631898161e84e.rlib --extern fnv=/data/arm/tidb/tikv/target/release/deps/libfnv-8b2e008117b32b1b.rlib --extern fs2=/data/arm/tidb/tikv/target/release/deps/libfs2-15037c0394910671.rlib --extern futures=/data/arm/tidb/tikv/target/release/deps/libfutures-8e1e8bd0ced61382.rlib --extern futures_cpupool=/data/arm/tidb/tikv/target/release/deps/libfutures_cpupool-dd1f22ba19958bd7.rlib --extern fxhash=/data/arm/tidb/tikv/target/release/deps/libfxhash-dfd8dba3ff920aa3.rlib --extern grpcio=/data/arm/tidb/tikv/target/release/deps/libgrpcio-a4a5a52fd5f8cb43.rlib --extern hex=/data/arm/tidb/tikv/target/release/deps/libhex-83ba2f073cd43b6c.rlib --extern hyper=/data/arm/tidb/tikv/target/release/deps/libhyper-2a989a303fdc3c5b.rlib --extern indexmap=/data/arm/tidb/tikv/target/release/deps/libindexmap-12286757f773f411.rlib --extern kvproto=/data/arm/tidb/tikv/target/release/deps/libkvproto-f4396e4b7db79e11.rlib --extern lazy_static=/data/arm/tidb/tikv/target/release/deps/liblazy_static-a6ee6f5b8f5cce80.rlib --extern libc=/data/arm/tidb/tikv/target/release/deps/liblibc-48a0d494491026f6.rlib --extern log=/data/arm/tidb/tikv/target/release/deps/liblog-7438edf929a0e307.rlib --extern mio=/data/arm/tidb/tikv/target/release/deps/libmio-1d76c69bdae27343.rlib --extern more_asserts=/data/arm/tidb/tikv/target/release/deps/libmore_asserts-02b9e5856405f0e5.rlib --extern murmur3=/data/arm/tidb/tikv/target/release/deps/libmurmur3-4f2291a89cfb121d.rlib --extern nix=/data/arm/tidb/tikv/target/release/deps/libnix-9ee3733e703cf6a7.rlib --extern num=/data/arm/tidb/tikv/target/release/deps/libnum-358b8ee1b85666c4.rlib --extern prometheus=/data/arm/tidb/tikv/target/release/deps/libprometheus-3d5dcd0ca037fcae.rlib --extern prometheus_static_metric=/data/arm/tidb/tikv/target/release/deps/libprometheus_static_metric-4214d3ad705af5ee.so --extern protobuf=/data/arm/tidb/tikv/target/release/deps/libprotobuf-73c153f744b7245b.rlib --extern quick_error=/data/arm/tidb/tikv/target/release/deps/libquick_error-a0c81d55849199c9.rlib --extern raft=/data/arm/tidb/tikv/target/release/deps/libraft-944a98c9737fa699.rlib --extern rand=/data/arm/tidb/tikv/target/release/deps/librand-8dd8bd97fb44abed.rlib --extern regex=/data/arm/tidb/tikv/target/release/deps/libregex-3e2d1a24c342ae19.rlib --extern rocksdb=/data/arm/tidb/tikv/target/release/deps/librocksdb-5e336b8ad7d8abbd.rlib --extern crypto=/data/arm/tidb/tikv/target/release/deps/libcrypto-932d15b53c46386f.rlib --extern rustc_serialize=/data/arm/tidb/tikv/target/release/deps/librustc_serialize-807bce82aa12f308.rlib --extern serde=/data/arm/tidb/tikv/target/release/deps/libserde-b1b1f7fcf319a0c3.rlib --extern serde_derive=/data/arm/tidb/tikv/target/release/deps/libserde_derive-9013bbe589cfe762.so --extern serde_json=/data/arm/tidb/tikv/target/release/deps/libserde_json-1f3cd001efad3323.rlib --extern signal=/data/arm/tidb/tikv/target/release/deps/libsignal-f914037bd659eb11.rlib --extern slog=/data/arm/tidb/tikv/target/release/deps/libslog-b4c36a69af64947d.rlib --extern slog_async=/data/arm/tidb/tikv/target/release/deps/libslog_async-0dc052c526051f22.rlib --extern slog_scope=/data/arm/tidb/tikv/target/release/deps/libslog_scope-d5397e55b0d12396.rlib --extern slog_stdlog=/data/arm/tidb/tikv/target/release/deps/libslog_stdlog-f9f18568ac11de54.rlib --extern slog_term=/data/arm/tidb/tikv/target/release/deps/libslog_term-7c91c89652417c22.rlib --extern sys_info=/data/arm/tidb/tikv/target/release/deps/libsys_info-8670fdb242b283fd.rlib --extern tempdir=/data/arm/tidb/tikv/target/release/deps/libtempdir-0d6a1ff46fa2f1ef.rlib --extern tikv=/data/arm/tidb/tikv/target/release/deps/libtikv-ede1c093e2224600.rlib --extern time=/data/arm/tidb/tikv/target/release/deps/libtime-e71a6a3cd25f0bd9.rlib --extern tipb=/data/arm/tidb/tikv/target/release/deps/libtipb-607be98ef1803e8c.rlib --extern tokio_core=/data/arm/tidb/tikv/target/release/deps/libtokio_core-fd431fbda0f9f248.rlib --extern tokio_threadpool=/data/arm/tidb/tikv/target/release/deps/libtokio_threadpool-f0d48e43ad2694d0.rlib --extern tokio_timer=/data/arm/tidb/tikv/target/release/deps/libtokio_timer-782c0d2adf596a29.rlib --extern toml=/data/arm/tidb/tikv/target/release/deps/libtoml-c6caa9512c4c0dc6.rlib --extern url=/data/arm/tidb/tikv/target/release/deps/liburl-2dc2eea252a26683.rlib --extern utime=/data/arm/tidb/tikv/target/release/deps/libutime-1cec027ab692a682.rlib --extern uuid=/data/arm/tidb/tikv/target/release/deps/libuuid-66149db1c56554ea.rlib --extern zipf=/data/arm/tidb/tikv/target/release/deps/libzipf-55e4c6eb16463f89.rlib -L native=/data/arm/tidb/tikv/target/release/build/backtrace-sys-c2680c3c5d27a551/out -L native=/data/arm/tidb/tikv/target/release/build/grpcio-sys-1957b5de55bb34bf/out/build -L native=/data/arm/tidb/tikv/target/release/build/grpcio-sys-1957b5de55bb34bf/out/build/third_party/cares/cares/lib -L native=/data/arm/tidb/tikv/target/release/build/grpcio-sys-1957b5de55bb34bf/out/build/third_party/zlib -L native=/data/arm/tidb/tikv/target/release/build/grpcio-sys-1957b5de55bb34bf/out/build/third_party/boringssl/ssl -L native=/data/arm/tidb/tikv/target/release/build/grpcio-sys-1957b5de55bb34bf/out/build/third_party/boringssl/crypto -L native=/data/arm/tidb/tikv/target/release/build/grpcio-sys-1957b5de55bb34bf/out -L native=/data/arm/tidb/tikv/target/release/build/librocksdb_sys-32122000d42062d6/out/build -L native=/data/arm/tidb/tikv/target/release/build/librocksdb_sys-32122000d42062d6/out -L native=/data/arm/tidb/tikv/target/release/build/bzip2-sys-4981f709877353b1/out/lib -L native=/data/arm/tidb/tikv/target/release/build/libz-sys-dc9249c929006396/out/build -L native=/data/arm/tidb/tikv/target/release/build/lz4-sys-e595ad10a9d701e9/out -L native=/data/arm/tidb/tikv/target/release/build/snappy-sys-c5ad678451ec90ec/out/build -L native=/data/arm/tidb/tikv/target/release/build/zstd-sys-2acdbfb45bba5762/out -L native=/data/arm/tidb/tikv/target/release/build/rust-crypto-4950bf2c9a0e6b8f/out -L native=/data/arm/tidb/tikv/target/release/build/sys-info-a5569cc3c55ed98f/out`
error: linking with `cc` failed: exit code: 1======================> ] 277/278: tikv
  |
  = note: "cc" "-Wl,--as-needed" "-Wl,-z,noexecstack" "-L" "/root/.rustup/toolchains/nightly-2018-07-18-aarch64-unknown-linux-gnu/lib/rustlib/aarch64-unknown-linux-gnu/lib" "/data/arm/tidb/tikv/target/release/deps/tikv_server-7cd1a85bd03976dc.tikv_server1.rcgu.o" "-o" "/data/arm/tidb/tikv/target/release/deps/tikv_server-7cd1a85bd03976dc" "-Wl,--gc-sections" "-pie" "-Wl,-z,relro,-z,now" "-Wl,-O1" "-nodefaultlibs" "-L" "/data/arm/tidb/tikv/target/release/deps" "-L" "/data/arm/tidb/tikv/target/release/build/backtrace-sys-c2680c3c5d27a551/out" "-L" "/data/arm/tidb/tikv/target/release/build/grpcio-sys-1957b5de55bb34bf/out/build" "-L" "/data/arm/tidb/tikv/target/release/build/grpcio-sys-1957b5de55bb34bf/out/build/third_party/cares/cares/lib" "-L" "/data/arm/tidb/tikv/target/release/build/grpcio-sys-1957b5de55bb34bf/out/build/third_party/zlib" "-L" "/data/arm/tidb/tikv/target/release/build/grpcio-sys-1957b5de55bb34bf/out/build/third_party/boringssl/ssl" "-L" "/data/arm/tidb/tikv/target/release/build/grpcio-sys-1957b5de55bb34bf/out/build/third_party/boringssl/crypto" "-L" "/data/arm/tidb/tikv/target/release/build/grpcio-sys-1957b5de55bb34bf/out" "-L" "/data/arm/tidb/tikv/target/release/build/librocksdb_sys-32122000d42062d6/out/build" "-L" "/data/arm/tidb/tikv/target/release/build/librocksdb_sys-32122000d42062d6/out" "-L" "/data/arm/tidb/tikv/target/release/build/bzip2-sys-4981f709877353b1/out/lib" "-L" "/data/arm/tidb/tikv/target/release/build/libz-sys-dc9249c929006396/out/build" "-L" "/data/arm/tidb/tikv/target/release/build/lz4-sys-e595ad10a9d701e9/out" "-L" "/data/arm/tidb/tikv/target/release/build/snappy-sys-c5ad678451ec90ec/out/build" "-L" "/data/arm/tidb/tikv/target/release/build/zstd-sys-2acdbfb45bba5762/out" "-L" "/data/arm/tidb/tikv/target/release/build/rust-crypto-4950bf2c9a0e6b8f/out" "-L" "/data/arm/tidb/tikv/target/release/build/sys-info-a5569cc3c55ed98f/out" "-L" "/root/.rustup/toolchains/nightly-2018-07-18-aarch64-unknown-linux-gnu/lib/rustlib/aarch64-unknown-linux-gnu/lib" "-Wl,-Bstatic" "/tmp/rustc1QtSGd/libsys_info-8670fdb242b283fd.rlib" "/tmp/rustc1QtSGd/libgrpcio_sys-45955ecaa83bb829.rlib" "/tmp/rustc1QtSGd/libcrypto-932d15b53c46386f.rlib" "/tmp/rustc1QtSGd/libbacktrace_sys-c3eaab8265442425.rlib" "/tmp/rustc1QtSGd/liblibrocksdb_sys-f0429942f855c2eb.rlib" "/tmp/rustc1QtSGd/libbzip2_sys-1a26d48874db2fad.rlib" "-Wl,--start-group" "/tmp/rustc1QtSGd/libstd-5585314b271b5c78.rlib" "-Wl,--end-group" "/root/.rustup/toolchains/nightly-2018-07-18-aarch64-unknown-linux-gnu/lib/rustlib/aarch64-unknown-linux-gnu/lib/libcompiler_builtins-a319cd5407aa2c9f.rlib" "-Wl,-Bdynamic" "-l" "stdc++" "-l" "util" "-l" "util" "-l" "dl" "-l" "rt" "-l" "pthread" "-l" "gcc_s" "-l" "c" "-l" "m" "-l" "rt" "-l" "pthread" "-l" "util" "-l" "util"
  = note: /data/arm/tidb/tikv/target/release/deps/tikv_server-7cd1a85bd03976dc.tikv_server1.rcgu.o:在函数‘tikv::util::jemalloc::jemalloc::dump_stats::h32b159942034d318’中:
          /data/arm/tidb/tikv/src/util/jemalloc.rs:41:对‘malloc_stats_print’未定义的引用
          /usr/bin/ld: /data/arm/tidb/tikv/target/release/deps/tikv_server-7cd1a85bd03976dc.tikv_server1.rcgu.o(.debug_info+0x10e8199): R_AARCH64_ABS64 used with TLS symbol _ZN5hyper5proto2h14date6CACHED7__getit5__KEY17he4d9f68a3c0ac4caE
          /usr/bin/ld: /data/arm/tidb/tikv/target/release/deps/tikv_server-7cd1a85bd03976dc.tikv_server1.rcgu.o(.debug_info+0x11a6545): R_AARCH64_ABS64 used with TLS symbol _ZN10tokio_core7reactor12CURRENT_LOOP3FOO7__getit5__KEY17hcce86e9cff70d0acE
          /usr/bin/ld: /data/arm/tidb/tikv/target/release/deps/tikv_server-7cd1a85bd03976dc.tikv_server1.rcgu.o(.debug_info+0x120a19a): R_AARCH64_ABS64 used with TLS symbol _ZN5tokio8executor14current_thread7CURRENT7__getit5__KEY17h9bc26702fad6c5d1E
          /usr/bin/ld: /data/arm/tidb/tikv/target/release/deps/tikv_server-7cd1a85bd03976dc.tikv_server1.rcgu.o(.debug_info+0x121f578): R_AARCH64_ABS64 used with TLS symbol _ZN11tokio_timer5clock5clock5CLOCK7__getit5__KEY17h6f58ae7412e15fa4E
          /usr/bin/ld: /data/arm/tidb/tikv/target/release/deps/tikv_server-7cd1a85bd03976dc.tikv_server1.rcgu.o(.debug_info+0x121f703): R_AARCH64_ABS64 used with TLS symbol _ZN11tokio_timer5timer6handle13CURRENT_TIMER7__getit5__KEY17hc3cf289c8f616328E
          /usr/bin/ld: /data/arm/tidb/tikv/target/release/deps/tikv_server-7cd1a85bd03976dc.tikv_server1.rcgu.o(.debug_info+0x123010f): R_AARCH64_ABS64 used with TLS symbol _ZN13tokio_reactor15CURRENT_REACTOR7__getit5__KEY17h60168d3755ab8782E
          /usr/bin/ld: /data/arm/tidb/tikv/target/release/deps/tikv_server-7cd1a85bd03976dc.tikv_server1.rcgu.o(.debug_info+0x125b467): R_AARCH64_ABS64 used with TLS symbol _ZN16tokio_threadpool6worker14CURRENT_WORKER7__getit5__KEY17hfd2381d2c8a41c84E
          /usr/bin/ld: /data/arm/tidb/tikv/target/release/deps/tikv_server-7cd1a85bd03976dc.tikv_server1.rcgu.o(.debug_info+0x1277c7b): R_AARCH64_ABS64 used with TLS symbol _ZN16tokio_threadpool4pool4Pool10rand_usize3RNG7__getit5__KEY17h192ed0b92bcc0f6fE.llvm.13951268333019481779
          /usr/bin/ld: /data/arm/tidb/tikv/target/release/deps/tikv_server-7cd1a85bd03976dc.tikv_server1.rcgu.o(.debug_info+0x128cd6b): R_AARCH64_ABS64 used with TLS symbol _ZN4rand4rngs6thread14THREAD_RNG_KEY7__getit5__KEY17h063afdeeef7a2503E
          /usr/bin/ld: /data/arm/tidb/tikv/target/release/deps/tikv_server-7cd1a85bd03976dc.tikv_server1.rcgu.o(.debug_info+0x12a1ddc): R_AARCH64_ABS64 used with TLS symbol _ZN15crossbeam_epoch7default6HANDLE7__getit5__KEY17h7ff1ba072cd4fd53E
          /usr/bin/ld: /data/arm/tidb/tikv/target/release/deps/tikv_server-7cd1a85bd03976dc.tikv_server1.rcgu.o(.debug_info+0x12aeb93): R_AARCH64_ABS64 used with TLS symbol _ZN14tokio_executor5enter7ENTERED7__getit5__KEY17h7349d5278d128bc7E.0.0
          /usr/bin/ld: /data/arm/tidb/tikv/target/release/deps/tikv_server-7cd1a85bd03976dc.tikv_server1.rcgu.o(.debug_info+0x12b1981): R_AARCH64_ABS64 used with TLS symbol _ZN14tokio_executor6global8EXECUTOR7__getit5__KEY17hfa393fc1b5d1eb33E
          /usr/bin/ld: /data/arm/tidb/tikv/target/release/deps/tikv_server-7cd1a85bd03976dc.tikv_server1.rcgu.o(.debug_info+0x12b1a4e): R_AARCH64_ABS64 used with TLS symbol _ZN14tokio_executor4park19CURRENT_PARK_THREAD7__getit5__KEY17h1b9218c6babe5a33E
          /usr/bin/ld: /data/arm/tidb/tikv/target/release/deps/tikv_server-7cd1a85bd03976dc.tikv_server1.rcgu.o(.debug_info+0x1d3cd42): R_AARCH64_ABS64 used with TLS symbol _ZN7futures9task_impl3std12CURRENT_TASK7__getit5__KEY17h1979618b9a90d540E
          /usr/bin/ld: /data/arm/tidb/tikv/target/release/deps/tikv_server-7cd1a85bd03976dc.tikv_server1.rcgu.o(.debug_info+0x1d3cd6a): R_AARCH64_ABS64 used with TLS symbol _ZN7futures9task_impl3std21CURRENT_THREAD_NOTIFY7__getit5__KEY17h13c68aef65913f1cE
          /usr/bin/ld: /data/arm/tidb/tikv/target/release/deps/tikv_server-7cd1a85bd03976dc.tikv_server1.rcgu.o(.debug_info+0x1d6f428): R_AARCH64_ABS64 used with TLS symbol _ZN4rand10thread_rng14THREAD_RNG_KEY7__getit5__KEY17h28782c5e868ccf45E
          /usr/bin/ld: /data/arm/tidb/tikv/target/release/deps/tikv_server-7cd1a85bd03976dc.tikv_server1.rcgu.o(.debug_info+0x1d7281a): R_AARCH64_ABS64 used with TLS symbol _ZN17crossbeam_channel8internal7context7CONTEXT7__getit5__KEY17h13277396f5fa3ae3E
          /usr/bin/ld: /data/arm/tidb/tikv/target/release/deps/tikv_server-7cd1a85bd03976dc.tikv_server1.rcgu.o(.debug_info+0x1d74ddb): R_AARCH64_ABS64 used with TLS symbol _ZN17crossbeam_channel8internal5utils7shuffle3RNG7__getit5__KEY17h6b8e9062bf38e43bE
          /usr/bin/ld: /data/arm/tidb/tikv/target/release/deps/tikv_server-7cd1a85bd03976dc.tikv_server1.rcgu.o(.debug_info+0x1d78bf6): R_AARCH64_ABS64 used with TLS symbol _ZN16parking_lot_core11parking_lot15get_thread_data11THREAD_DATA7__getit5__KEY17h90f9be10e6d88c91E
          /usr/bin/ld: /data/arm/tidb/tikv/target/release/deps/tikv_server-7cd1a85bd03976dc.tikv_server1.rcgu.o(.debug_info+0x1d7fe44): R_AARCH64_ABS64 used with TLS symbol _ZN16parking_lot_core9word_lock15get_thread_data11THREAD_DATA7__getit5__KEY17h0cdc61696229fc0fE
          /usr/bin/ld: /data/arm/tidb/tikv/target/release/deps/tikv_server-7cd1a85bd03976dc.tikv_server1.rcgu.o(.debug_info+0x1d8b2e3): R_AARCH64_ABS64 used with TLS symbol _ZN4rand10thread_rng14THREAD_RNG_KEY7__getit5__KEY17h87f748427a608817E
          /usr/bin/ld: /data/arm/tidb/tikv/target/release/deps/tikv_server-7cd1a85bd03976dc.tikv_server1.rcgu.o(.debug_info+0x1d9ad15): R_AARCH64_ABS64 used with TLS symbol _ZN4rand4rngs6thread14THREAD_RNG_KEY7__getit5__KEY17ha709f71f7f797fdfE
          /usr/bin/ld: /data/arm/tidb/tikv/target/release/deps/tikv_server-7cd1a85bd03976dc.tikv_server1.rcgu.o(.debug_info+0x1da4fea): R_AARCH64_ABS64 used with TLS symbol _ZN15crossbeam_epoch7default6HANDLE7__getit5__KEY17h7f94e27a126f9b21E
          /usr/bin/ld: /data/arm/tidb/tikv/target/release/deps/tikv_server-7cd1a85bd03976dc.tikv_server1.rcgu.o(.debug_info+0x1dcd434): R_AARCH64_ABS64 used with TLS symbol _ZN9backtrace4lock9LOCK_HELD7__getit5__KEY17h9c9602b2f8d20a08E.0.0
          /usr/bin/ld: /data/arm/tidb/tikv/target/release/deps/tikv_server-7cd1a85bd03976dc.tikv_server1.rcgu.o(.debug_info+0x1e1b081): R_AARCH64_ABS64 used with TLS symbol _ZN10slog_scope9TL_SCOPES7__getit5__KEY17ha012bdbdb0343ea0E
          /usr/bin/ld: /data/arm/tidb/tikv/target/release/deps/tikv_server-7cd1a85bd03976dc.tikv_server1.rcgu.o(.debug_info+0x1e39933): R_AARCH64_ABS64 used with TLS symbol _ZN12thread_local9thread_id9THREAD_ID7__getit5__KEY17hebddb5d99464a865E
          /usr/bin/ld: /data/arm/tidb/tikv/target/release/deps/tikv_server-7cd1a85bd03976dc.tikv_server1.rcgu.o(.debug_info+0x1fc5383): R_AARCH64_ABS64 used with TLS symbol _ZN3std11collections4hash3map11RandomState3new4KEYS7__getit5__KEY17h31533035a3a80129E
          /usr/bin/ld: /data/arm/tidb/tikv/target/release/deps/tikv_server-7cd1a85bd03976dc.tikv_server1.rcgu.o(.debug_info+0x1fcd0cc): R_AARCH64_ABS64 used with TLS symbol _ZN3std9panicking12LOCAL_STDERR7__getit5__KEY17h2d0c9ba486215ad8E
          /usr/bin/ld: /data/arm/tidb/tikv/target/release/deps/tikv_server-7cd1a85bd03976dc.tikv_server1.rcgu.o(.debug_info+0x1fcd106): R_AARCH64_ABS64 used with TLS symbol _ZN3std9panicking18update_panic_count11PANIC_COUNT7__getit5__KEY17hbb286188565371e2E
          /usr/bin/ld: /data/arm/tidb/tikv/target/release/deps/tikv_server-7cd1a85bd03976dc.tikv_server1.rcgu.o(.debug_info+0x1fd8bde): R_AARCH64_ABS64 used with TLS symbol _ZN3std10sys_common11thread_info11THREAD_INFO7__getit5__KEY17h33fb751a181ad4c0E
          /usr/bin/ld: /data/arm/tidb/tikv/target/release/deps/tikv_server-7cd1a85bd03976dc.tikv_server1.rcgu.o(.debug_info+0x1fe2094): R_AARCH64_ABS64 used with TLS symbol _ZN3std2io5stdio12LOCAL_STDOUT7__getit5__KEY17hdbea41c2afbdf2fbE
          collect2: 错误:ld 返回 1


error: aborting due to previous error

error: Could not compile `tikv`.

Caused by:
  process didn't exit successfully: `rustc --crate-name tikv_server src/bin/tikv-server.rs --crate-type bin --emit=dep-info,link -C opt-level=3 -C lto -C codegen-units=2 -C debuginfo=2 --cfg 'feature="default"' --cfg 'feature="fail"' --cfg 'feature="no-fail"' --cfg 'feature="portable"' --cfg 'feature="rocksdb"' -C metadata=7cd1a85bd03976dc -C extra-filename=-7cd1a85bd03976dc --out-dir /data/arm/tidb/tikv/target/release/deps -L dependency=/data/arm/tidb/tikv/target/release/deps --extern backtrace=/data/arm/tidb/tikv/target/release/deps/libbacktrace-bceb72bbddbfdb78.rlib --extern bitflags=/data/arm/tidb/tikv/target/release/deps/libbitflags-de9784ae398543a1.rlib --extern byteorder=/data/arm/tidb/tikv/target/release/deps/libbyteorder-3d6724391174f960.rlib --extern chrono=/data/arm/tidb/tikv/target/release/deps/libchrono-3d8e772fb05ede15.rlib --extern chrono_tz=/data/arm/tidb/tikv/target/release/deps/libchrono_tz-1ce3e76886106452.rlib --extern clap=/data/arm/tidb/tikv/target/release/deps/libclap-dcb07e049bd65780.rlib --extern crc=/data/arm/tidb/tikv/target/release/deps/libcrc-ee09a991656912bf.rlib --extern crossbeam_channel=/data/arm/tidb/tikv/target/release/deps/libcrossbeam_channel-d9e5570c628e3fee.rlib --extern crossbeam=/data/arm/tidb/tikv/target/release/deps/libcrossbeam-32544bbc3fb17c74.rlib --extern derive_more=/data/arm/tidb/tikv/target/release/deps/libderive_more-1889ffd3c9f7ee68.so --extern fail=/data/arm/tidb/tikv/target/release/deps/libfail-be6631898161e84e.rlib --extern fnv=/data/arm/tidb/tikv/target/release/deps/libfnv-8b2e008117b32b1b.rlib --extern fs2=/data/arm/tidb/tikv/target/release/deps/libfs2-15037c0394910671.rlib --extern futures=/data/arm/tidb/tikv/target/release/deps/libfutures-8e1e8bd0ced61382.rlib --extern futures_cpupool=/data/arm/tidb/tikv/target/release/deps/libfutures_cpupool-dd1f22ba19958bd7.rlib --extern fxhash=/data/arm/tidb/tikv/target/release/deps/libfxhash-dfd8dba3ff920aa3.rlib --extern grpcio=/data/arm/tidb/tikv/target/release/deps/libgrpcio-a4a5a52fd5f8cb43.rlib --extern hex=/data/arm/tidb/tikv/target/release/deps/libhex-83ba2f073cd43b6c.rlib --extern hyper=/data/arm/tidb/tikv/target/release/deps/libhyper-2a989a303fdc3c5b.rlib --extern indexmap=/data/arm/tidb/tikv/target/release/deps/libindexmap-12286757f773f411.rlib --extern kvproto=/data/arm/tidb/tikv/target/release/deps/libkvproto-f4396e4b7db79e11.rlib --extern lazy_static=/data/arm/tidb/tikv/target/release/deps/liblazy_static-a6ee6f5b8f5cce80.rlib --extern libc=/data/arm/tidb/tikv/target/release/deps/liblibc-48a0d494491026f6.rlib --extern log=/data/arm/tidb/tikv/target/release/deps/liblog-7438edf929a0e307.rlib --extern mio=/data/arm/tidb/tikv/target/release/deps/libmio-1d76c69bdae27343.rlib --extern more_asserts=/data/arm/tidb/tikv/target/release/deps/libmore_asserts-02b9e5856405f0e5.rlib --extern murmur3=/data/arm/tidb/tikv/target/release/deps/libmurmur3-4f2291a89cfb121d.rlib --extern nix=/data/arm/tidb/tikv/target/release/deps/libnix-9ee3733e703cf6a7.rlib --extern num=/data/arm/tidb/tikv/target/release/deps/libnum-358b8ee1b85666c4.rlib --extern prometheus=/data/arm/tidb/tikv/target/release/deps/libprometheus-3d5dcd0ca037fcae.rlib --extern prometheus_static_metric=/data/arm/tidb/tikv/target/release/deps/libprometheus_static_metric-4214d3ad705af5ee.so --extern protobuf=/data/arm/tidb/tikv/target/release/deps/libprotobuf-73c153f744b7245b.rlib --extern quick_error=/data/arm/tidb/tikv/target/release/deps/libquick_error-a0c81d55849199c9.rlib --extern raft=/data/arm/tidb/tikv/target/release/deps/libraft-944a98c9737fa699.rlib --extern rand=/data/arm/tidb/tikv/target/release/deps/librand-8dd8bd97fb44abed.rlib --extern regex=/data/arm/tidb/tikv/target/release/deps/libregex-3e2d1a24c342ae19.rlib --extern rocksdb=/data/arm/tidb/tikv/target/release/deps/librocksdb-5e336b8ad7d8abbd.rlib --extern crypto=/data/arm/tidb/tikv/target/release/deps/libcrypto-932d15b53c46386f.rlib --extern rustc_serialize=/data/arm/tidb/tikv/target/release/deps/librustc_serialize-807bce82aa12f308.rlib --extern serde=/data/arm/tidb/tikv/target/release/deps/libserde-b1b1f7fcf319a0c3.rlib --extern serde_derive=/data/arm/tidb/tikv/target/release/deps/libserde_derive-9013bbe589cfe762.so --extern serde_json=/data/arm/tidb/tikv/target/release/deps/libserde_json-1f3cd001efad3323.rlib --extern signal=/data/arm/tidb/tikv/target/release/deps/libsignal-f914037bd659eb11.rlib --extern slog=/data/arm/tidb/tikv/target/release/deps/libslog-b4c36a69af64947d.rlib --extern slog_async=/data/arm/tidb/tikv/target/release/deps/libslog_async-0dc052c526051f22.rlib --extern slog_scope=/data/arm/tidb/tikv/target/release/deps/libslog_scope-d5397e55b0d12396.rlib --extern slog_stdlog=/data/arm/tidb/tikv/target/release/deps/libslog_stdlog-f9f18568ac11de54.rlib --extern slog_term=/data/arm/tidb/tikv/target/release/deps/libslog_term-7c91c89652417c22.rlib --extern sys_info=/data/arm/tidb/tikv/target/release/deps/libsys_info-8670fdb242b283fd.rlib --extern tempdir=/data/arm/tidb/tikv/target/release/deps/libtempdir-0d6a1ff46fa2f1ef.rlib --extern tikv=/data/arm/tidb/tikv/target/release/deps/libtikv-ede1c093e2224600.rlib --extern time=/data/arm/tidb/tikv/target/release/deps/libtime-e71a6a3cd25f0bd9.rlib --extern tipb=/data/arm/tidb/tikv/target/release/deps/libtipb-607be98ef1803e8c.rlib --extern tokio_core=/data/arm/tidb/tikv/target/release/deps/libtokio_core-fd431fbda0f9f248.rlib --extern tokio_threadpool=/data/arm/tidb/tikv/target/release/deps/libtokio_threadpool-f0d48e43ad2694d0.rlib --extern tokio_timer=/data/arm/tidb/tikv/target/release/deps/libtokio_timer-782c0d2adf596a29.rlib --extern toml=/data/arm/tidb/tikv/target/release/deps/libtoml-c6caa9512c4c0dc6.rlib --extern url=/data/arm/tidb/tikv/target/release/deps/liburl-2dc2eea252a26683.rlib --extern utime=/data/arm/tidb/tikv/target/release/deps/libutime-1cec027ab692a682.rlib --extern uuid=/data/arm/tidb/tikv/target/release/deps/libuuid-66149db1c56554ea.rlib --extern zipf=/data/arm/tidb/tikv/target/release/deps/libzipf-55e4c6eb16463f89.rlib -L native=/data/arm/tidb/tikv/target/release/build/backtrace-sys-c2680c3c5d27a551/out -L native=/data/arm/tidb/tikv/target/release/build/grpcio-sys-1957b5de55bb34bf/out/build -L native=/data/arm/tidb/tikv/target/release/build/grpcio-sys-1957b5de55bb34bf/out/build/third_party/cares/cares/lib -L native=/data/arm/tidb/tikv/target/release/build/grpcio-sys-1957b5de55bb34bf/out/build/third_party/zlib -L native=/data/arm/tidb/tikv/target/release/build/grpcio-sys-1957b5de55bb34bf/out/build/third_party/boringssl/ssl -L native=/data/arm/tidb/tikv/target/release/build/grpcio-sys-1957b5de55bb34bf/out/build/third_party/boringssl/crypto -L native=/data/arm/tidb/tikv/target/release/build/grpcio-sys-1957b5de55bb34bf/out -L native=/data/arm/tidb/tikv/target/release/build/librocksdb_sys-32122000d42062d6/out/build -L native=/data/arm/tidb/tikv/target/release/build/librocksdb_sys-32122000d42062d6/out -L native=/data/arm/tidb/tikv/target/release/build/bzip2-sys-4981f709877353b1/out/lib -L native=/data/arm/tidb/tikv/target/release/build/libz-sys-dc9249c929006396/out/build -L native=/data/arm/tidb/tikv/target/release/build/lz4-sys-e595ad10a9d701e9/out -L native=/data/arm/tidb/tikv/target/release/build/snappy-sys-c5ad678451ec90ec/out/build -L native=/data/arm/tidb/tikv/target/release/build/zstd-sys-2acdbfb45bba5762/out -L native=/data/arm/tidb/tikv/target/release/build/rust-crypto-4950bf2c9a0e6b8f/out -L native=/data/arm/tidb/tikv/target/release/build/sys-info-a5569cc3c55ed98f/out` (exit code: 101)

编译脚本能上传看下吗

wget https://github.com/tikv/tikv/archive/v2.1.14.tar.gz
tar xzf tikv-2.1.14.tar.gz
cd tikv-2.1.14
ROCKSDB_SYS_SSE=0 make release

可以试下用编译脚本进行编译,从报错看可能是依赖的问题

https://gist.github.com/siddontang/3a35473437bc47ebf27e541ba7d41141#file-build_on_arm-sh

用这个脚本跑了,报错还是一样的:frowning_face:

稍等,我这边让研发同学一起帮忙看下

能否用 3.0.x 版本试一下?不确定 2.1 版本能否支持 arm。

好的我先试试 v3 版本编译。

現在用的是 tidb-operator(1.0.3) 部署的 tidb 集群,如果要把 tidb 2.1.14 切换到 v3 版本,有什么要注意的么?

btw: 我好像之前和你交流过,不过是17年那会在萧的编程二群里,找工作时还参考了你知乎的回答 :smile:

执行出错

wget https://github.com/tikv/tikv/archive/v3.0.11.tar.gz
tar xzf v3.0.11.tar.gz
cd tikv-3.0.11/


# ROCKSDB_SYS_SSE=0 make release
make dist_release
make[1]: 进入目录“/root/tikv-3.0.11”
make build_release
make[2]: 进入目录“/root/tikv-3.0.11”
cargo build --no-default-features --release --features " jemalloc portable no-fail"
   Compiling librocksdb_sys v0.1.0 (https://github.com/tikv/rust-rocksdb.git?branch=tikv-3.x#7ec1dbd9)
   Compiling libpapi_sys v0.1.5
   Compiling kvproto v0.0.1 (https://github.com/pingcap/kvproto.git?branch=release-3.0#d2cf0af7)
   Compiling rocksdb v0.3.0 (https://github.com/tikv/rust-rocksdb.git?branch=tikv-3.x#7ec1dbd9)
error: failed to run custom build command for `libpapi_sys v0.1.5`

Caused by:
  process didn't exit successfully: `/root/tikv-3.0.11/target/release/build/libpapi_sys-f24507ce3aa8f1a6/build-script-build` (exit code: 101)

...

我找下负责这块的同学。。arm 不太了解。

:rofl:世界太小了

日志:tikv.log (129.4 KB)

INFO: make finished
cargo:warning=couldn't execute `llvm-config --prefix` (error: No such file or directory (os error 2))
cargo:warning=set the LLVM_CONFIG_PATH environment variable to a valid `llvm-config` executable

--- stderr
ar: 正在创建 libpapi.a
+ test '' '!=' ''
+ for comp in perf_event perf_event_uncore
+ make -C components/perf_event/tests
+ for comp in perf_event perf_event_uncore
+ make -C components/perf_event_uncore/tests
thread 'main' panicked at 'Unable to find libclang: "couldn\'t find any valid shared libraries matching: [\'libclang.so\', \'libclang-*.so\', \'libclang.so.*\'], set the `LIBCLANG_PATH` environment variable to a path where one of these files can be found (invalid: [])"', src/libcore/result.rs:999:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.

warning: build failed, waiting for other jobs to finish...
 error: build failed
make[2]: *** [build_release] 错误 101
make[2]: 离开目录“/root/tikv-3.0.11”
make[1]: *** [dist_release] 错误 2
make[1]: 离开目录“/root/tikv-3.0.11”
make: *** [release] 错误 2

Hi~

尝试安装 clang 和 clang-devel 再试试?

yum install clang clang-devel -y 

我可以继续走下去了

3.0.11 可以,2.0.x 编译不通过。你们会支持 2.0.x 在 arm 上的编译适配么?:thinking:

# ROCKSDB_SYS_SSE=0 make release

make dist_release
make[1]: 进入目录“/root/tikv-3.0.11”
make build_release
make[2]: 进入目录“/root/tikv-3.0.11”
cargo build --no-default-features --release --features " jemalloc portable no-fail"
   Compiling tikv v3.0.11 (/root/tikv-3.0.11)
    Finished release [optimized + debuginfo] target(s) in 5m 13s
make[2]: 离开目录“/root/tikv-3.0.11”
bash scripts/check-sse4_2.sh
skipping sse4.2 check - sse4.2 disabled
make[1]: 离开目录“/root/tikv-3.0.11”

2.0.x 旧版本已不再更新维护,建议使用当前最新的稳定版本 3.0.x 编译部署。