Stream: t-compiler/help

Topic: rustc compilation failures


davidtwco (Jun 27 2019 at 06:38, on Zulip):

For the past few days, I've been unable to compile rustc on my machine, I'm not sure what's changed, I've tried nuking the build directory:

Building stage1 compiler artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
   Compiling rustc-main v0.0.0 (/home/david/projects/rust/rust1/src/rustc)
error: linking with `cc` failed: exit code: 1
  |
  = note: "cc" "-Wl,--as-needed" "-Wl,-z,noexecstack" "-m64" "-L" "/home/david/projects/rust/rust1/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib" "/home/david/projects/rust/rust1/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/debug/deps/rustc_binary-deb9300b83568394.1263nq3e2ud1o1r4.rcgu.o" "/home/david/projects/rust/rust1/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/debug/deps/rustc_binary-deb9300b83568394.19epgmon2rkq5dqz.rcgu.o" "/home/david/projects/rust/rust1/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/debug/deps/rustc_binary-deb9300b83568394.2ndja17l3eh4xefg.rcgu.o" "/home/david/projects/rust/rust1/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/debug/deps/rustc_binary-deb9300b83568394.3mhtk9zwdn16kyhb.rcgu.o" "/home/david/projects/rust/rust1/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/debug/deps/rustc_binary-deb9300b83568394.maphhcx0e6y3w5p.rcgu.o" "-o" "/home/david/projects/rust/rust1/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/debug/deps/rustc_binary-deb9300b83568394" "-Wl,--gc-sections" "-pie" "-Wl,-zrelro" "-Wl,-znow" "-nodefaultlibs" "-L" "/home/david/projects/rust/rust1/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/debug/deps" "-L" "/home/david/projects/rust/rust1/build/x86_64-unknown-linux-gnu/stage1-rustc/debug/deps" "-L" "/home/david/projects/rust/rust1/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/debug/build/backtrace-sys-46f80450446ade43/out" "-L" "/home/david/projects/rust/rust1/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/debug/build/miniz-sys-fc84a27db85004a9/out" "-L" "/home/david/projects/rust/rust1/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-L" "/home/david/projects/rust/rust1/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/debug/deps" "-lrustc_driver-92cabad887175fbd" "-L" "/home/david/projects/rust/rust1/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/debug/deps" "-lrustc_interface-3c9591280d71773e" "-L" "/home/david/projects/rust/rust1/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/debug/deps" "-lrustc_lint-d1cbfcd28f4f6c9d" "-L" "/home/david/projects/rust/rust1/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/debug/deps" "-lrustc_traits-a9264844143f03bd" "-L" "/home/david/projects/rust/rust1/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/debug/deps" "-lrustc_resolve-ee4dad60d33d7e77" "-L" "/home/david/projects/rust/rust1/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/debug/deps" "-lrustc_privacy-7a9a512f6d9e17e0" "-L" "/home/david/projects/rust/rust1/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/debug/deps" "-lrustc_typeck-4ae08802f739b808" "-L" "/home/david/projects/rust/rust1/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/debug/deps" "-lrustc_plugin-b664993e67340a59" "-L" "/home/david/projects/rust/rust1/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/debug/deps" "-lrustc_passes-d140753043f9a139" "-L" "/home/david/projects/rust/rust1/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/debug/deps" "-lrustc_codegen_ssa-2cb9746fb91012d9" "-L" "/home/david/projects/rust/rust1/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/debug/deps" "-lrustc_incremental-0bd0ecbb930f21a4" "-L" "/home/david/projects/rust/rust1/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/debug/deps" "-lrustc_borrowck-37a983988ab4e91d" "-L" "/home/david/projects/rust/rust1/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/debug/deps" "-lrustc_mir-c1cb373a64019785" "-L" "/home/david/projects/rust/rust1/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/debug/deps" "-lrustc_allocator-4a61643d292e53f0" "-L" "/home/david/projects/rust/rust1/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/debug/deps" "-lrustc_save_analysis-c57ab05bfa68ef11" "-L" "/home/david/projects/rust/rust1/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/debug/deps" "-lrustc_codegen_utils-9eccc25163658977" "-L" "/home/david/projects/rust/rust1/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/debug/deps" "-lrustc_metadata-61e29cfa6d6b2c9f" "-L" "/home/david/projects/rust/rust1/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/debug/deps" "-lsyntax_ext-5d0b711f7456c69a" "-L" "/home/david/projects/rust/rust1/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/debug/deps" "-lrustc-5b6ecf8f92ed30b8" "-L" "/home/david/projects/rust/rust1/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/debug/deps" "-lfmt_macros-26c8e1b9ecf78390" "-L" "/home/david/projects/rust/rust1/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/debug/deps" "-lrustc_fs_util-611bea1453abbdd9" "-L" "/home/david/projects/rust/rust1/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-ltest-8a6e21431435ffde" "-L" "/home/david/projects/rust/rust1/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-lterm-ff0b7549deba8821" "-L" "/home/david/projects/rust/rust1/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/debug/deps" "-lsyntax-34892d50bc6c0e8d" "-L" "/home/david/projects/rust/rust1/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/debug/deps" "-lrustc_target-ce4c6a8ab44f6289" "-L" "/home/david/projects/rust/rust1/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/debug/deps" "-lrustc_errors-662d68a5c84e576b" "-L" "/home/david/projects/rust/rust1/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/debug/deps" "-lsyntax_pos-146b76a9e314a43a" "-L" "/home/david/projects/rust/rust1/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/debug/deps" "-larena-c73c72e167db49ac" "-L" "/home/david/projects/rust/rust1/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/debug/deps" "-lrustc_data_structures-0b793d5bdefb4eea" "-L" "/home/david/projects/rust/rust1/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/debug/deps" "-lgraphviz-267b75f50964da8e" "-L" "/home/david/projects/rust/rust1/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/debug/deps" "-lrustc_cratesio_shim-cc7572e7a76e61f0" "-L" "/home/david/projects/rust/rust1/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/debug/deps" "-lserialize-905317db2d4405be" "-Wl,--start-group" "-L" "/home/david/projects/rust/rust1/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-lstd-a52529454bb7e403" "-Wl,--end-group" "-Wl,-Bstatic" "/home/david/projects/rust/rust1/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins-866ebf4f9ba01b1e.rlib" "-Wl,-Bdynamic" "-lutil" "-lutil" "-ldl" "-lrt" "-lpthread" "-lgcc_s" "-lc" "-lm" "-lrt" "-lpthread" "-lutil" "-lutil" "-Wl,-rpath,$ORIGIN/../lib"
  = note: /nix/store/0y7jmqnj48ikjh37n3dl9kqw9hnn68nq-binutils-2.31.1/bin/ld: /home/david/projects/rust/rust1/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/debug/deps/librustc_codegen_ssa-2cb9746fb91012d9.so: undefined reference to `<I as core::iter::traits::collect::IntoIterator>::into_iter'
          /nix/store/0y7jmqnj48ikjh37n3dl9kqw9hnn68nq-binutils-2.31.1/bin/ld: /home/david/projects/rust/rust1/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/debug/deps/librustc_codegen_ssa-2cb9746fb91012d9.so: undefined reference to `std::error::Error::type_id'
          /nix/store/0y7jmqnj48ikjh37n3dl9kqw9hnn68nq-binutils-2.31.1/bin/ld: /home/david/projects/rust/rust1/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/debug/deps/librustc_codegen_ssa-2cb9746fb91012d9.so: undefined reference to `core::iter::range::<impl core::iter::traits::iterator::Iterator for core::ops::range::Range<A>>::next'
collect2: error: ld returned 1 exit status
davidtwco (Jun 27 2019 at 06:39, on Zulip):

Anyone ran into this or know how to get around it?

davidtwco (Jun 27 2019 at 06:41, on Zulip):

In fact, this is on my unoptimized directory, so I suspect it's something to do with that.

davidtwco (Jun 27 2019 at 07:06, on Zulip):

Can confirm that it was that, switching to my regular config.toml fixed the issue.

simulacrum (Jun 27 2019 at 11:12, on Zulip):

Possibly errors in how we handle symbols or something? @eddyb is the most familiar with that code I believe

eddyb (Jun 27 2019 at 12:25, on Zulip):

I have no idea, there shouldn't be any change to that, but building unoptimized rustc is generally discouraged just because of how uselessly slow the resulting compiler is :P

eddyb (Jun 27 2019 at 12:26, on Zulip):

if it's a dylib-related issue maybe @Zoxc knows

davidtwco (Jun 27 2019 at 12:58, on Zulip):

I have no idea, there shouldn't be any change to that, but building unoptimized rustc is generally discouraged just because of how uselessly slow the resulting compiler is :P

I build it overnight because I sometimes I find it useful to be able to step through what's happening on master with a debugger.

Zoxc (Jun 27 2019 at 13:01, on Zulip):

Was it a clean build?

davidtwco (Jun 27 2019 at 13:19, on Zulip):

Yeah, I ran clean before it, and tried deleting build.

Zoxc (Jun 27 2019 at 13:39, on Zulip):

I'm going to try a clean debug build =P

davidtwco (Jun 27 2019 at 13:43, on Zulip):

I should have backed up the config.toml it was using.

Zoxc (Jun 28 2019 at 10:54, on Zulip):

I didn't have any problems building a debug build. (I had parallel-compiler enabled, so it would complete in an hour though)

Last update: Nov 11 2019 at 23:20UTC