Skip to content

linking now fails with unwind failures #16

Closed
@clux

Description

@clux

Latest cron build failed with a missing -lunwind

error: linking with `cc` failed: exit code: 1
  |
  = note: "cc" "-Wl,--as-needed" "-Wl,-z,noexecstack" "-nostdlib" "-Wl,--eh-frame-hdr" "-Wl,-(" "-m64" "/usr/local/lib/rustlib/x86_64-unknown-linux-musl/lib/crt1.o" "/usr/local/lib/rustlib/x86_64-unknown-linux-musl/lib/crti.o" "-L" "/usr/local/lib/rustlib/x86_64-unknown-linux-musl/lib" "/volume/target/x86_64-unknown-linux-musl/debug/deps/plaincrate-54d1030939d14f9b.0.o" "-o" "/volume/target/x86_64-unknown-linux-musl/debug/deps/plaincrate-54d1030939d14f9b" "/volume/target/x86_64-unknown-linux-musl/debug/deps/plaincrate-54d1030939d14f9b.crate.allocator.o" "-Wl,--gc-sections" "-Wl,-z,relro,-z,now" "-nodefaultlibs" "-L" "/volume/target/x86_64-unknown-linux-musl/debug/deps" "-L" "/volume/target/debug/deps" "-L" "/usr/local/lib/rustlib/x86_64-unknown-linux-musl/lib" "-Wl,-Bstatic" "/usr/local/lib/rustlib/x86_64-unknown-linux-musl/lib/liballoc_jemalloc-ab5831f4fba53ade.rlib" "/volume/target/x86_64-unknown-linux-musl/debug/deps/librand-caa253f168104b0f.rlib" "/volume/target/x86_64-unknown-linux-musl/debug/deps/liblibc-2322a01ee5fd0496.rlib" "/usr/local/lib/rustlib/x86_64-unknown-linux-musl/lib/libstd-1873b4d191d228e8.rlib" "/usr/local/lib/rustlib/x86_64-unknown-linux-musl/lib/libpanic_unwind-fa52c59d2108c1f8.rlib" "/usr/local/lib/rustlib/x86_64-unknown-linux-musl/lib/libunwind-45a286e82269a40e.rlib" "/usr/local/lib/rustlib/x86_64-unknown-linux-musl/lib/liballoc_system-1c88582d9022c1cc.rlib" "/usr/local/lib/rustlib/x86_64-unknown-linux-musl/lib/liblibc-d9d4ae8ab67a6001.rlib" "/usr/local/lib/rustlib/x86_64-unknown-linux-musl/lib/liballoc-d1d3fb714ff1a835.rlib" "/usr/local/lib/rustlib/x86_64-unknown-linux-musl/lib/libstd_unicode-10859fb08aa219d9.rlib" "/usr/local/lib/rustlib/x86_64-unknown-linux-musl/lib/librand-655f47aee8a3420b.rlib" "/usr/local/lib/rustlib/x86_64-unknown-linux-musl/lib/libcore-da02dfafc4660314.rlib" "/usr/local/lib/rustlib/x86_64-unknown-linux-musl/lib/libcompiler_builtins-126bb39b1b53af10.rlib" "-l" "unwind" "-static" "-Wl,-Bdynamic" "/usr/local/lib/rustlib/x86_64-unknown-linux-musl/lib/crtn.o" "-Wl,-)"
  = note: /usr/bin/ld: cannot find -lunwind
          collect2: error: ld returned 1 exit status

Apparently that's needed now. Tried making a new image and add an apt-get install libunwind-dev, but that shifts the error to the more confusing:

error: linking with `cc` failed: exit code: 1
  |
  = note: "cc" "-Wl,--as-needed" "-Wl,-z,noexecstack" "-nostdlib" "-Wl,--eh-frame-hdr" "-Wl,-(" "-m64" "/usr/local/lib/rustlib/x86_64-unknown-linux-musl/lib/crt1.o" "/usr/local/lib/rustlib/x86_64-unknown-linux-musl/lib/crti.o" "-L" "/usr/local/lib/rustlib/x86_64-unknown-linux-musl/lib" "/volume/target/x86_64-unknown-linux-musl/debug/deps/plaincrate-54d1030939d14f9b.0.o" "-o" "/volume/target/x86_64-unknown-linux-musl/debug/deps/plaincrate-54d1030939d14f9b" "/volume/target/x86_64-unknown-linux-musl/debug/deps/plaincrate-54d1030939d14f9b.crate.allocator.o" "-Wl,--gc-sections" "-Wl,-z,relro,-z,now" "-nodefaultlibs" "-L" "/volume/target/x86_64-unknown-linux-musl/debug/deps" "-L" "/volume/target/debug/deps" "-L" "/usr/local/lib/rustlib/x86_64-unknown-linux-musl/lib" "-Wl,-Bstatic" "/usr/local/lib/rustlib/x86_64-unknown-linux-musl/lib/liballoc_jemalloc-ab5831f4fba53ade.rlib" "/volume/target/x86_64-unknown-linux-musl/debug/deps/librand-caa253f168104b0f.rlib" "/volume/target/x86_64-unknown-linux-musl/debug/deps/liblibc-2322a01ee5fd0496.rlib" "/usr/local/lib/rustlib/x86_64-unknown-linux-musl/lib/libstd-1873b4d191d228e8.rlib" "/usr/local/lib/rustlib/x86_64-unknown-linux-musl/lib/libpanic_unwind-fa52c59d2108c1f8.rlib" "/usr/local/lib/rustlib/x86_64-unknown-linux-musl/lib/libunwind-45a286e82269a40e.rlib" "/usr/local/lib/rustlib/x86_64-unknown-linux-musl/lib/liballoc_system-1c88582d9022c1cc.rlib" "/usr/local/lib/rustlib/x86_64-unknown-linux-musl/lib/liblibc-d9d4ae8ab67a6001.rlib" "/usr/local/lib/rustlib/x86_64-unknown-linux-musl/lib/liballoc-d1d3fb714ff1a835.rlib" "/usr/local/lib/rustlib/x86_64-unknown-linux-musl/lib/libstd_unicode-10859fb08aa219d9.rlib" "/usr/local/lib/rustlib/x86_64-unknown-linux-musl/lib/librand-655f47aee8a3420b.rlib" "/usr/local/lib/rustlib/x86_64-unknown-linux-musl/lib/libcore-da02dfafc4660314.rlib" "/usr/local/lib/rustlib/x86_64-unknown-linux-musl/lib/libcompiler_builtins-126bb39b1b53af10.rlib" "-l" "unwind" "-static" "-Wl,-Bdynamic" "/usr/local/lib/rustlib/x86_64-unknown-linux-musl/lib/crtn.o" "-Wl,-)"
  = note: /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libunwind.a(elf64.o): In function `xz_uncompressed_size':
          /build/libunwind-VOtC4T/libunwind-1.1/src/elfxx.c:194: undefined reference to `lzma_stream_footer_decode'
          /build/libunwind-VOtC4T/libunwind-1.1/src/elfxx.c:201: undefined reference to `lzma_index_buffer_decode'
          /build/libunwind-VOtC4T/libunwind-1.1/src/elfxx.c:205: undefined reference to `lzma_index_size'
          /build/libunwind-VOtC4T/libunwind-1.1/src/elfxx.c:210: undefined reference to `lzma_index_end'
          /build/libunwind-VOtC4T/libunwind-1.1/src/elfxx.c:207: undefined reference to `lzma_index_uncompressed_size'
          /build/libunwind-VOtC4T/libunwind-1.1/src/elfxx.c:210: undefined reference to `lzma_index_end'
          /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libunwind.a(elf64.o): In function `_Uelf64_extract_minidebuginfo':
          /build/libunwind-VOtC4T/libunwind-1.1/src/elfxx.c:278: undefined reference to `lzma_stream_buffer_decode'
          collect2: error: ld returned 1 exit status
          

error: aborting due to previous error

This is also on the plain crate which doesn't use lzma. Probably need to compile libunwind with musl?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions