Error in Building Rust with custom llvm-5.0


#1

I am trying to build rust with LLVM-5.0, I first run this command: ./configure --llvm-root=/usr/lib/llvm-5.0

and then change codegen-tests to false in config.toml and run the following command: make && sudo make install

I am using latest git build…

Here is the terminal output with error:

Updating only changed submodules Submodules updated in 0.04 seconds downloading https://static.rust-lang.org/dist/2018-10-30/rust-std-beta-x86_64-unknown-linux-gnu.tar.gz ######################################################################## 100.0% extracting /home/ab/Desktop/RUSTNightly/rust-master/GitHub/rust/build/cache/2018-10-30/rust-std-beta-x86_64-unknown-linux-gnu.tar.gz downloading https://static.rust-lang.org/dist/2018-10-30/rustc-beta-x86_64-unknown-linux-gnu.tar.gz ######################################################################## 100.0% extracting /home/ab/Desktop/RUSTNightly/rust-master/GitHub/rust/build/cache/2018-10-30/rustc-beta-x86_64-unknown-linux-gnu.tar.gz downloading https://static.rust-lang.org/dist/2018-10-30/cargo-beta-x86_64-unknown-linux-gnu.tar.gz ######################################################################## 100.0% extracting /home/ab/Desktop/RUSTNightly/rust-master/GitHub/rust/build/cache/2018-10-30/cargo-beta-x86_64-unknown-linux-gnu.tar.gz Compiling proc-macro2 v0.4.24
Compiling unicode-xid v0.1.0
Compiling ryu v0.2.6
Compiling serde v1.0.75
Compiling ordermap v0.3.5
Compiling cfg-if v0.1.5
Compiling libc v0.2.43
Compiling fixedbitset v0.1.9
Compiling itoa v0.4.3
Compiling cc v1.0.25
Compiling lazy_static v0.2.11
Compiling build_helper v0.1.0 (/home/ab/Desktop/RUSTNightly/rust-master/GitHub/rust/src/build_helper)
Compiling getopts v0.2.17
Compiling petgraph v0.4.13
Compiling time v0.1.40
Compiling num_cpus v1.8.0
Compiling filetime v0.2.1
Compiling cmake v0.1.33
Compiling quote v0.6.8
Compiling syn v0.14.9
Compiling serde_derive v1.0.75
Compiling toml v0.4.6
Compiling serde_json v1.0.31
Compiling bootstrap v0.0.0 (/home/ab/Desktop/RUSTNightly/rust-master/GitHub/rust/src/bootstrap)
Finished dev [unoptimized] target(s) in 36.29s
Downloaded rls-data v0.18.1
Downloaded log v0.4.5
Downloaded version_check v0.1.5
Downloaded openssl-sys v0.9.38
Downloaded lazycell v1.2.0
Downloaded libgit2-sys v0.7.10
Downloaded ena v0.10.1
Downloaded rustc-ap-rustc_cratesio_shim v297.0.0
Downloaded openssl v0.10.13
Downloaded proptest v0.8.7
Downloaded rustc-ap-syntax_pos v297.0.0
Downloaded rustc-ap-graphviz v297.0.0
Downloaded racer v2.1.13
Downloaded wait-timeout v0.1.5
Downloaded rls-vfs v0.7.0
Downloaded socket2 v0.3.8
Downloaded schannel v0.1.14
Downloaded rustc-ap-serialize v297.0.0
Downloaded syn v0.15.21
Downloaded rls-analysis v0.16.8
Downloaded rustc-ap-rustc_data_structures v297.0.0
Downloaded crossbeam-channel v0.2.6
Downloaded rustc-ap-rustc_target v297.0.0
Downloaded crossbeam-epoch v0.6.0
Downloaded bytecount v0.3.2
Downloaded minifier v0.0.20
Downloaded simd v0.2.3
Downloaded env_logger v0.6.0
Downloaded cargo_metadata v0.6.2
Downloaded derive_more v0.13.0
Downloaded rustc-ap-rustc_errors v297.0.0
Downloaded curl-sys v0.4.15
Downloaded rustc-ap-syntax v297.0.0
Downloaded git2-curl v0.8.2
Downloaded pkg-config v0.3.14
Downloaded winapi v0.3.6
Downloaded bytesize v1.0.0
Downloaded flate2 v1.0.3
Downloaded rls-blacklist v0.1.3
Downloaded rusty-fork v0.2.1
Downloaded vergen v3.0.3
Downloaded chalk-engine v0.8.0
Downloaded compiletest_rs v0.3.16
Downloaded libz-sys v1.0.24
Downloaded curl v0.4.19
Downloaded bit-vec v0.5.0
Downloaded libnghttp2-sys v0.1.0
Downloaded bit-set v0.5.0
Downloaded tar v0.4.19
Downloaded rustc-ap-arena v297.0.0
Downloaded crossbeam-utils v0.6.1
Downloaded 51 crates (9.5 MB) in 14.84s (largest was curl-sys at 2.9 MB)
Building stage0 std artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
Compiling cc v1.0.25
Compiling core v0.0.0 (/home/ab/Desktop/RUSTNightly/rust-master/GitHub/rust/src/libcore)
Compiling build_helper v0.1.0 (/home/ab/Desktop/RUSTNightly/rust-master/GitHub/rust/src/build_helper)
Compiling unwind v0.0.0 (/home/ab/Desktop/RUSTNightly/rust-master/GitHub/rust/src/libunwind)
Compiling compiler_builtins v0.0.0 (/home/ab/Desktop/RUSTNightly/rust-master/GitHub/rust/src/rustc/compiler_builtins_shim)
Compiling cmake v0.1.33
Compiling std v0.0.0 (/home/ab/Desktop/RUSTNightly/rust-master/GitHub/rust/src/libstd)
Compiling rustc_msan v0.0.0 (/home/ab/Desktop/RUSTNightly/rust-master/GitHub/rust/src/librustc_msan)
Compiling rustc_asan v0.0.0 (/home/ab/Desktop/RUSTNightly/rust-master/GitHub/rust/src/librustc_asan)
Compiling rustc_lsan v0.0.0 (/home/ab/Desktop/RUSTNightly/rust-master/GitHub/rust/src/librustc_lsan)
Compiling rustc_tsan v0.0.0 (/home/ab/Desktop/RUSTNightly/rust-master/GitHub/rust/src/librustc_tsan)
Compiling libc v0.0.0 (/home/ab/Desktop/RUSTNightly/rust-master/GitHub/rust/src/rustc/libc_shim)
Compiling alloc v0.0.0 (/home/ab/Desktop/RUSTNightly/rust-master/GitHub/rust/src/liballoc)
Compiling panic_abort v0.0.0 (/home/ab/Desktop/RUSTNightly/rust-master/GitHub/rust/src/libpanic_abort)
Compiling panic_unwind v0.0.0 (/home/ab/Desktop/RUSTNightly/rust-master/GitHub/rust/src/libpanic_unwind)
Finished release [optimized] target(s) in 25.68s
Copying stage0 std from stage0 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu / x86_64-unknown-linux-gnu) Building stage0 test artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu) Compiling term v0.0.0 (/home/ab/Desktop/RUSTNightly/rust-master/GitHub/rust/src/libterm)
Compiling getopts v0.2.17
Compiling test v0.0.0 (/home/ab/Desktop/RUSTNightly/rust-master/GitHub/rust/src/libtest)
Finished release [optimized] target(s) in 4.66s
Copying stage0 test from stage0 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu / x86_64-unknown-linux-gnu) Building stage0 compiler artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu) Compiling version_check v0.1.5
Compiling nodrop v0.1.12
Compiling cfg-if v0.1.5
Compiling void v1.0.2
Compiling scopeguard v0.3.3
Compiling memoffset v0.2.1
Compiling rand_core v0.2.1
Compiling libc v0.2.43
Compiling stable_deref_trait v1.1.0
Compiling rustc-rayon-core v0.1.1
Compiling bitflags v1.0.4
Compiling either v1.5.0
Compiling unicode-width v0.1.5
Compiling byteorder v1.2.3
Compiling graphviz v0.0.0 (/home/ab/Desktop/RUSTNightly/rust-master/GitHub/rust/src/libgraphviz)
Compiling rustc_target v0.0.0 (/home/ab/Desktop/RUSTNightly/rust-master/GitHub/rust/src/librustc_target)
Compiling scoped-tls v0.1.2
Compiling cc v1.0.25
Compiling syntax v0.0.0 (/home/ab/Desktop/RUSTNightly/rust-master/GitHub/rust/src/libsyntax)
Compiling termcolor v1.0.2
Compiling lazy_static v0.2.11
Compiling rustc-demangle v0.1.9
Compiling rustc v0.0.0 (/home/ab/Desktop/RUSTNightly/rust-master/GitHub/rust/src/librustc)
Compiling datafrog v0.1.0
Compiling remove_dir_all v0.5.1
Compiling rustc_fs_util v0.0.0 (/home/ab/Desktop/RUSTNightly/rust-master/GitHub/rust/src/librustc_fs_util)
Compiling fmt_macros v0.0.0 (/home/ab/Desktop/RUSTNightly/rust-master/GitHub/rust/src/libfmt_macros)
Compiling rustc_metadata v0.0.0 (/home/ab/Desktop/RUSTNightly/rust-master/GitHub/rust/src/librustc_metadata)
Compiling rustc_incremental v0.0.0 (/home/ab/Desktop/RUSTNightly/rust-master/GitHub/rust/src/librustc_incremental)
Compiling rustc-serialize v0.3.24
Compiling rustc_platform_intrinsics v0.0.0 (/home/ab/Desktop/RUSTNightly/rust-master/GitHub/rust/src/librustc_platform_intrinsics)
Compiling quick-error v1.2.2
Compiling rustc_driver v0.0.0 (/home/ab/Desktop/RUSTNightly/rust-master/GitHub/rust/src/librustc_driver)
Compiling crossbeam-utils v0.2.2
Compiling log v0.4.5
Compiling arrayvec v0.4.7
Compiling unreachable v1.0.0
Compiling owning_ref v0.3.3
Compiling num_cpus v1.8.0
Compiling rand v0.5.5
Compiling rand v0.4.3
Compiling atty v0.2.11
Compiling memmap v0.6.2
Compiling lazy_static v1.1.0
Compiling rustc-hash v1.0.1
Compiling chalk-macros v0.1.0
Compiling humantime v1.1.1
Compiling backtrace-sys v0.1.24
Compiling miniz-sys v0.1.10
Compiling ena v0.10.1
Compiling rustc_cratesio_shim v0.0.0 (/home/ab/Desktop/RUSTNightly/rust-master/GitHub/rust/src/librustc_cratesio_shim)
Compiling jobserver v0.1.11
Compiling smallvec v0.6.5
Compiling lock_api v0.1.3
Compiling tempfile v3.0.3
Compiling rls-span v0.4.0
Compiling polonius-engine v0.5.0
Compiling chalk-engine v0.8.0
Compiling env_logger v0.5.12
Compiling parking_lot_core v0.3.0
Compiling serialize v0.0.0 (/home/ab/Desktop/RUSTNightly/rust-master/GitHub/rust/src/libserialize)
Compiling rustc_apfloat v0.0.0 (/home/ab/Desktop/RUSTNightly/rust-master/GitHub/rust/src/librustc_apfloat)
Compiling rls-data v0.18.1
Compiling parking_lot v0.6.4
Compiling crossbeam-epoch v0.3.1
Compiling log_settings v0.1.2
Compiling backtrace v0.3.9
Compiling flate2 v1.0.3
Compiling crossbeam-deque v0.2.0
Compiling rustc-rayon v0.1.1
Compiling rustc_data_structures v0.0.0 (/home/ab/Desktop/RUSTNightly/rust-master/GitHub/rust/src/librustc_data_structures)
Compiling arena v0.0.0 (/home/ab/Desktop/RUSTNightly/rust-master/GitHub/rust/src/libarena)
Compiling syntax_pos v0.0.0 (/home/ab/Desktop/RUSTNightly/rust-master/GitHub/rust/src/libsyntax_pos)
Compiling rustc_errors v0.0.0 (/home/ab/Desktop/RUSTNightly/rust-master/GitHub/rust/src/librustc_errors)
Compiling proc_macro v0.0.0 (/home/ab/Desktop/RUSTNightly/rust-master/GitHub/rust/src/libproc_macro)
Compiling syntax_ext v0.0.0 (/home/ab/Desktop/RUSTNightly/rust-master/GitHub/rust/src/libsyntax_ext)
Compiling rustc_mir v0.0.0 (/home/ab/Desktop/RUSTNightly/rust-master/GitHub/rust/src/librustc_mir)
Compiling rustc_typeck v0.0.0 (/home/ab/Desktop/RUSTNightly/rust-master/GitHub/rust/src/librustc_typeck)
Compiling rustc_traits v0.0.0 (/home/ab/Desktop/RUSTNightly/rust-master/GitHub/rust/src/librustc_traits)
Compiling rustc_allocator v0.0.0 (/home/ab/Desktop/RUSTNightly/rust-master/GitHub/rust/src/librustc_allocator)
Compiling rustc_resolve v0.0.0 (/home/ab/Desktop/RUSTNightly/rust-master/GitHub/rust/src/librustc_resolve)
Compiling rustc_plugin v0.0.0 (/home/ab/Desktop/RUSTNightly/rust-master/GitHub/rust/src/librustc_plugin)
Compiling rustc_privacy v0.0.0 (/home/ab/Desktop/RUSTNightly/rust-master/GitHub/rust/src/librustc_privacy)
Compiling rustc_codegen_utils v0.0.0 (/home/ab/Desktop/RUSTNightly/rust-master/GitHub/rust/src/librustc_codegen_utils)
Compiling rustc_passes v0.0.0 (/home/ab/Desktop/RUSTNightly/rust-master/GitHub/rust/src/librustc_passes)
Compiling rustc_borrowck v0.0.0 (/home/ab/Desktop/RUSTNightly/rust-master/GitHub/rust/src/librustc_borrowck)
Compiling rustc_lint v0.0.0 (/home/ab/Desktop/RUSTNightly/rust-master/GitHub/rust/src/librustc_lint)
Compiling rustc_save_analysis v0.0.0 (/home/ab/Desktop/RUSTNightly/rust-master/GitHub/rust/src/librustc_save_analysis)
Compiling rustc-main v0.0.0 (/home/ab/Desktop/RUSTNightly/rust-master/GitHub/rust/src/rustc)
Finished release [optimized] target(s) in 6m 59s
Copying stage0 rustc from stage0 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu / x86_64-unknown-linux-gnu) Building stage0 codegen artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu, llvm) Compiling cc v1.0.25
Compiling build_helper v0.1.0 (/home/ab/Desktop/RUSTNightly/rust-master/GitHub/rust/src/build_helper)
Compiling libc v0.2.43
Compiling rustc-demangle v0.1.9
Compiling rustc_codegen_llvm v0.0.0 (/home/ab/Desktop/RUSTNightly/rust-master/GitHub/rust/src/librustc_codegen_llvm)
Compiling memmap v0.6.2
Compiling num_cpus v1.8.0
Compiling rustc_llvm v0.0.0 (/home/ab/Desktop/RUSTNightly/rust-master/GitHub/rust/src/librustc_llvm)
Compiling rustc_codegen_ssa v0.0.0 (/home/ab/Desktop/RUSTNightly/rust-master/GitHub/rust/src/librustc_codegen_ssa)
Finished release [optimized] target(s) in 42.34s
Assembling stage1 compiler (x86_64-unknown-linux-gnu) Building stage1 std artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu) error: process didn’t exit successfully: /home/ab/Desktop/RUSTNightly/rust-master/GitHub/rust/build/bootstrap/debug/rustc -vV (exit code: 1) — stdout rustc 1.32.0-dev binary: rustc commit-hash: unknown commit-date: unknown host: x86_64-unknown-linux-gnu release: 1.32.0-dev

— stderr error: couldn’t load codegen backend “/home/ab/Desktop/RUSTNightly/rust-master/GitHub/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/codegen-backends/librustc_codegen_llvm-llvm.so”: “/home/ab/Desktop/RUSTNightly/rust-master/GitHub/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/codegen-backends/librustc_codegen_llvm-llvm.so: undefined symbol: ffi_type_float”

command did not execute successfully: “/home/ab/Desktop/RUSTNightly/rust-master/GitHub/rust/build/x86_64-unknown-linux-gnu/stage0/bin/cargo” “build” “–target” “x86_64-unknown-linux-gnu” “-j” “4” “–release” “–features” “panic-unwind backtrace” “–manifest-path” “/home/ab/Desktop/RUSTNightly/rust-master/GitHub/rust/src/libstd/Cargo.toml” “–message-format” “json” expected success, got: exit code: 101 failed to run: /home/ab/Desktop/RUSTNightly/rust-master/GitHub/rust/build/bootstrap/debug/bootstrap build Build completed unsuccessfully in 0:18:09 Makefile:28: recipe for target ‘all’ failed make: *** [all] Error 1


#2

Sounds like this: https://github.com/rust-lang/rust/issues/39880