Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

incr. comp.: Linker errors when compiling tokei crate. #39534

Closed
michaelwoerister opened this Issue Feb 4, 2017 · 4 comments

Comments

Projects
None yet
5 participants
@michaelwoerister
Copy link
Contributor

michaelwoerister commented Feb 4, 2017

Original report: XAMPPRocky/tokei#102

@michaelwoerister

This comment has been minimized.

Copy link
Contributor Author

michaelwoerister commented Feb 7, 2017

This looks like it is related to LTO. At least, when I turn off LTO for the crate, the linker errors go away.

@ehuss

This comment has been minimized.

Copy link
Contributor

ehuss commented Feb 19, 2017

Here is a minimum recreation of the linker error when using LTO.

  1. cargo new --bin scratch
  2. Add lto=true to release or dev profile (doesn't matter).
  3. Set main.rs to: fn main() { panic!(); }
  4. Build with incremental.

On OSX, I get the following error:

error: linking with `cc` failed: exit code: 1
  |
  = note: "cc" "-m64" "-L" "/Users/eric/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib" "/Users/eric/Temp/rust/scratch-lto/target/debug/deps/scratch_lto-21b84faa2393c01d.core-any.volatile.o" "/Users/eric/Temp/rust/scratch-lto/target/debug/deps/scratch_lto-21b84faa2393c01d.scratch_lto.o" "/Users/eric/Temp/rust/scratch-lto/target/debug/deps/scratch_lto-21b84faa2393c01d.std-panicking.volatile.o" "-o" "/Users/eric/Temp/rust/scratch-lto/target/debug/deps/scratch_lto-21b84faa2393c01d" "-Wl,-dead_strip" "-nodefaultlibs" "-L" "/Users/eric/Temp/rust/scratch-lto/target/debug/deps" "-L" "/Users/eric/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib" "/var/folders/g1/jk6mlnz132g4wvw2g90hfzk40000gp/T/rustc.tj6lnwuKsdHN/liballoc_jemalloc-eeea41b1054fd303.rlib" "/var/folders/g1/jk6mlnz132g4wvw2g90hfzk40000gp/T/rustc.tj6lnwuKsdHN/libcompiler_builtins-a156453e4a4418dc.rlib" "-l" "System" "-l" "pthread" "-l" "c" "-l" "m"
  = note: Undefined symbols for architecture x86_64:
            "_rust_eh_personality", referenced from:
                Dwarf Exception Unwind Info (__eh_frame) in scratch_lto-21b84faa2393c01d.std-panicking.volatile.o
            "___rust_allocate", referenced from:
                alloc::heap::allocate::h4eb83c87d1ceebe0 in scratch_lto-21b84faa2393c01d.std-panicking.volatile.o
            "alloc::oom::oom::hafa494cd9e3b81ad", referenced from:
                alloc::heap::exchange_malloc::hde5cad0a985c0ad1 in scratch_lto-21b84faa2393c01d.std-panicking.volatile.o
            "std::panicking::rust_panic_with_hook::h8e6300d8e8aca457", referenced from:
                std::panicking::begin_panic::h9ec63481878b4a71 in scratch_lto-21b84faa2393c01d.std-panicking.volatile.o
            "std::rt::lang_start::he28fbf70e98a2b18", referenced from:
                _main in scratch_lto-21b84faa2393c01d.scratch_lto.o
          ld: symbol(s) not found for architecture x86_64
          clang: error: linker command failed with exit code 1 (use -v to see invocation)
@jonhoo

This comment has been minimized.

Copy link
Contributor

jonhoo commented Apr 1, 2017

This is likely the same as #40034

@alexcrichton

This comment has been minimized.

Copy link
Member

alexcrichton commented Sep 15, 2017

Today you get:

error: can't perform LTO when compiling incrementally

So I'm going to close this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.