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

linking now fails with unwind failures #16

Closed
clux opened this issue Aug 24, 2017 · 2 comments
Closed

linking now fails with unwind failures #16

clux opened this issue Aug 24, 2017 · 2 comments

Comments

@clux
Copy link
Owner

clux commented Aug 24, 2017

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?

@clux
Copy link
Owner Author

clux commented Aug 24, 2017

Ah, this just merged: rust-lang/rust#40113

bors added a commit to rust-lang/rust that referenced this issue Aug 25, 2017
Do not assume libunwind.a is available on musl

Fixes #40113, #44069, and clux/muslrust#16.

libunwind.a is not copied from musl_root, so it must be integrated into the unwind crate.
@clux
Copy link
Owner Author

clux commented Aug 26, 2017

Latest build passed tests :)

@clux clux closed this as completed Aug 26, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant