Skip to content

Cross does not work on MacOS #137

Closed
Closed
@nbigaouette-eai

Description

@nbigaouette-eai

I'm trying this out on a project of mine (thanks by the way! 👍 ) but cannot compile a static binary.

The project unfortunately does not link with error adding symbols: Archive has no index; run ranlib to add one:

 -> cross build --target=x86_64-unknown-linux-musl
   Compiling runner v0.1.0 (file:///project)
error: linking with `cc` failed: exit code: 1
  |
  = note: "cc" "-Wl,--as-needed" "-Wl,-z,noexecstack" "-nostdlib" "-Wl,--eh-frame-hdr" "-Wl,-(" "-m64" "/rust/lib/rustlib/x86_64-unknown-linux-musl/lib/crt1.o" "/rust/lib/rustlib/x86_64-unknown-linux-musl/lib/crti.o" "-L" "/rust/lib/rustlib/x86_64-unknown-linux-musl/lib" "/target/x86_64-unknown-linux-musl/debug/deps/runner-219b920b8fef3f4d.0.o" "-o" "/target/x86_64-unknown-linux-musl/debug/deps/runner-219b920b8fef3f4d" "/target/x86_64-unknown-linux-musl/debug/deps/runner-219b920b8fef3f4d.crate.allocator.o" "-Wl,--gc-sections" "-nodefaultlibs" "-L" "/target/x86_64-unknown-linux-musl/debug/deps" "-L" "/target/debug/deps" "-L" "/target/x86_64-unknown-linux-musl/debug/build/backtrace-sys-211b7321ac22b1a6/out/.libs" "-L" "/target/x86_64-unknown-linux-musl/debug/build/libgit2-sys-03f537ad6d9f4396/out/lib" "-L" "/target/x86_64-unknown-linux-musl/debug/build/curl-sys-dbd946a6bb81d696/out/lib" "-L" "/target/x86_64-unknown-linux-musl/debug/build/libz-sys-2896f35ae65e1d4b/out/lib" "-L" "/openssl/lib" "-L" "/target/x86_64-unknown-linux-musl/debug/build/libssh2-sys-8dc87c45c366dceb/out/lib" "-L" "/rust/lib/rustlib/x86_64-unknown-linux-musl/lib" "-Wl,-Bstatic" "/rust/lib/rustlib/x86_64-unknown-linux-musl/lib/liballoc_jemalloc-42efcbbdeb607d44.rlib" "/target/x86_64-unknown-linux-musl/debug/deps/librunner-bdc1f17eff19e2b6.rlib" "/target/x86_64-unknown-linux-musl/debug/deps/libsloggers-8cc86e293163dcf9.rlib" "/target/x86_64-unknown-linux-musl/debug/deps/libtrackable-26bb0c9c8e59f723.rlib" "/target/x86_64-unknown-linux-musl/debug/deps/libslog_stdlog-c74d66452d5bda66.rlib" "/target/x86_64-unknown-linux-musl/debug/deps/libslog_term-b0b281c8cbf41d2d.rlib" "/target/x86_64-unknown-linux-musl/debug/deps/libslog_async-7bae3b0c79d483c8.rlib" "/target/x86_64-unknown-linux-musl/debug/deps/libgit2-2ad3a3c7ef24e385.rlib" "/target/x86_64-unknown-linux-musl/debug/deps/libbitflags-fde7fade3dc478b3.rlib" "/target/x86_64-unknown-linux-musl/debug/deps/libglob-ceea5b5a9b2a842c.rlib" "/target/x86_64-unknown-linux-musl/debug/deps/libserde-c29e90fe3a0f30b7.rlib" "/target/x86_64-unknown-linux-musl/debug/deps/libtake_mut-2d9f44e87a807e3b.rlib" "/target/x86_64-unknown-linux-musl/debug/deps/libterm-b200052906de0c88.rlib" "/target/x86_64-unknown-linux-musl/debug/deps/libsubprocess-2c25bc8e4a5ae735.rlib" "/target/x86_64-unknown-linux-musl/debug/deps/liberror_chain-ea8db33d1c98d117.rlib" "/target/x86_64-unknown-linux-musl/debug/deps/libbacktrace-1ff221778b486022.rlib" "/target/x86_64-unknown-linux-musl/debug/deps/libbacktrace_sys-3fc4ded5df59ebc8.rlib" "/target/x86_64-unknown-linux-musl/debug/deps/librustc_demangle-503c967103b34b83.rlib" "/target/x86_64-unknown-linux-musl/debug/deps/libcfg_if-477cae0c47d80bcb.rlib" "/target/x86_64-unknown-linux-musl/debug/deps/liburl-bef7b1270e02620c.rlib" "/target/x86_64-unknown-linux-musl/debug/deps/libpercent_encoding-9a575ddd77bf6448.rlib" "/target/x86_64-unknown-linux-musl/debug/deps/libidna-4844a13b6c5f466e.rlib" "/target/x86_64-unknown-linux-musl/debug/deps/libunicode_normalization-2f2a5462d6e0f026.rlib" "/target/x86_64-unknown-linux-musl/debug/deps/libunicode_bidi-c27968f53c8cec6e.rlib" "/target/x86_64-unknown-linux-musl/debug/deps/libmatches-b6b7f5048ca617af.rlib" "/target/x86_64-unknown-linux-musl/debug/deps/liblibgit2_sys-80beada433340736.rlib" "/target/x86_64-unknown-linux-musl/debug/deps/libcurl_sys-54e02b26a02baa37.rlib" "/target/x86_64-unknown-linux-musl/debug/deps/liblibssh2_sys-9794aa469817a88d.rlib" "/target/x86_64-unknown-linux-musl/debug/deps/liblibz_sys-08a39f93c0b5ed92.rlib" "/target/x86_64-unknown-linux-musl/debug/deps/libopenssl_sys-35fa54d5ab648b33.rlib" "/target/x86_64-unknown-linux-musl/debug/deps/libopenssl_probe-4816e5c431f6a408.rlib" "/target/x86_64-unknown-linux-musl/debug/deps/liblog-a1cd6370c9104261.rlib" "/target/x86_64-unknown-linux-musl/debug/deps/libthread_local-ef13d42eacd47dbb.rlib" "/target/x86_64-unknown-linux-musl/debug/deps/libunreachable-ce06424aca015fc1.rlib" "/target/x86_64-unknown-linux-musl/debug/deps/libvoid-cffa07e23647f651.rlib" "/target/x86_64-unknown-linux-musl/debug/deps/libchrono-a11c55c6e93ba01d.rlib" "/target/x86_64-unknown-linux-musl/debug/deps/libnum-ec8808920f9e77ff.rlib" "/target/x86_64-unknown-linux-musl/debug/deps/libnum_iter-532f1cab1941168b.rlib" "/target/x86_64-unknown-linux-musl/debug/deps/libnum_integer-76c292a71939227c.rlib" "/target/x86_64-unknown-linux-musl/debug/deps/libtime-4e97137489d2e76b.rlib" "/target/x86_64-unknown-linux-musl/debug/deps/libnum_traits-379830a7c273381b.rlib" "/target/x86_64-unknown-linux-musl/debug/deps/libisatty-6147fd76831f5d3a.rlib" "/target/x86_64-unknown-linux-musl/debug/deps/libslog_scope-f885b0acde1d1b9d.rlib" "/target/x86_64-unknown-linux-musl/debug/deps/libcrossbeam-fe512acf8edd5b48.rlib" "/target/x86_64-unknown-linux-musl/debug/deps/liblazy_static-49bad43a35b71269.rlib" "/target/x86_64-unknown-linux-musl/debug/deps/libslog-552fee0455adc0cd.rlib" "/target/x86_64-unknown-linux-musl/debug/deps/librand-d9fe4f804beb4046.rlib" "/target/x86_64-unknown-linux-musl/debug/deps/liblibc-bf6c5b813812285d.rlib" "/rust/lib/rustlib/x86_64-unknown-linux-musl/lib/libstd-881b9fdbdf1d515b.rlib" "/rust/lib/rustlib/x86_64-unknown-linux-musl/lib/liballoc_system-3c10208cdd7e61cb.rlib" "/rust/lib/rustlib/x86_64-unknown-linux-musl/lib/librand-32f648f7f7567c6c.rlib" "/rust/lib/rustlib/x86_64-unknown-linux-musl/lib/libpanic_unwind-9cbadc6554202be9.rlib" "/rust/lib/rustlib/x86_64-unknown-linux-musl/lib/libunwind-618c266cf9124966.rlib" "/rust/lib/rustlib/x86_64-unknown-linux-musl/lib/liblibc-16f3b02b9a976b94.rlib" "/rust/lib/rustlib/x86_64-unknown-linux-musl/lib/liballoc-bc70b4efeaeb398c.rlib" "/rust/lib/rustlib/x86_64-unknown-linux-musl/lib/libstd_unicode-a0ad42dc8f5856aa.rlib" "/rust/lib/rustlib/x86_64-unknown-linux-musl/lib/libcore-21491ce3d14f1ef2.rlib" "/rust/lib/rustlib/x86_64-unknown-linux-musl/lib/libcompiler_builtins-b9713bd7f605c0b2.rlib" "-Wl,-Bdynamic" "/rust/lib/rustlib/x86_64-unknown-linux-musl/lib/crtn.o" "-Wl,-)"
  = note: /target/x86_64-unknown-linux-musl/debug/deps/libisatty-6147fd76831f5d3a.rlib: error adding symbols: Archive has no index; run ranlib to add one
          collect2: error: ld returned 1 exit status


error: aborting due to previous error

error: Could not compile `runner`.

To learn more, run the command again with --verbose.

Seems the problematic crate is isatty. This crate has a single dependency libc.

Not sure how to investigate this further... 🤔

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions