Skip to content

-Zprofile and -Clink-dead-code enabled leads to the linking error on macOS #63047

Closed

Description

@svartalf

I'm integrating grcov and have macOS build failures with a linkage error while both -Zprofile and -Clink-dead-code flags enabled.

Consider a cargo project with the following manifest:

[package]
name = "foo"
version = "0.1.0"
authors = ["me"]
edition = "2018"

[dependencies]
core-foundation = "0.6.4"

and the src/main.rs file:

use core_foundation::dictionary::CFMutableDictionary;
use core_foundation::number::CFNumber;

fn main() {
    let mut dict = CFMutableDictionary::new();
    let key = CFNumber::from(1);
    let value = CFNumber::from(2);
    dict.add(&key, &value);

    dbg!(dict.len());
}

Plain cargo run successfully compiles and run the binary (no additional env vars set):

$ cargo run
   Compiling foo v0.1.0 (/Users/apple/Desktop/foo)
    Finished dev [unoptimized + debuginfo] target(s) in 0.41s
     Running `target/debug/foo`
[src/main.rs:10] dict.len() = 1

Now, as described in the gcov readme I add the necessary flags:

$ cargo clean
$ CARGO_INCREMENTAL=0 RUSTFLAGS="-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Zno-landing-pads" cargo run
   Compiling libc v0.2.60
   Compiling core-foundation-sys v0.6.2
   Compiling core-foundation v0.6.4
   Compiling foo v0.1.0 (/Users/apple/Desktop/foo)
error: linking with `cc` failed: exit code: 1
  |
  = note: "cc" "-m64" "-L" "/Users/apple/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib" "/Users/apple/Desktop/foo/target/debug/deps/foo-43971b11e9fc60ca.foo.ayycu2cz-cgu.0.rcgu.o" "-o" "/Users/apple/Desktop/foo/target/debug/deps/foo-43971b11e9fc60ca" "/Users/apple/Desktop/foo/target/debug/deps/foo-43971b11e9fc60ca.8f4xgbrv4jev7ka.rcgu.o" "-nodefaultlibs" "-L" "/Users/apple/Desktop/foo/target/debug/deps" "-L" "/Users/apple/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib" "/Users/apple/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libtest-2f2c545f20952714.rlib" "/Users/apple/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libterm-d31c4cfba4ff2a7a.rlib" "/Users/apple/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libgetopts-2b60fe103d1e455e.rlib" "/Users/apple/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libunicode_width-7d268ed1d33eabb7.rlib" "/Users/apple/Desktop/foo/target/debug/deps/libcore_foundation-19ef10f3e7242abe.rlib" "/Users/apple/Desktop/foo/target/debug/deps/liblibc-5e68c041a34d0eed.rlib" "/Users/apple/Desktop/foo/target/debug/deps/libcore_foundation_sys-6d86f6aead90fb35.rlib" "/Users/apple/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libprofiler_builtins-f8dafa01db4dca39.rlib" "/Users/apple/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libstd-292d8bc6470467ba.rlib" "/Users/apple/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libpanic_unwind-912dbe632ba1cbae.rlib" "/Users/apple/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libbacktrace-ba5714b629684fb4.rlib" "/Users/apple/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libbacktrace_sys-eac4a78ff89c6e87.rlib" "/Users/apple/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/librustc_demangle-ef9b06bfe5cc2531.rlib" "/Users/apple/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libhashbrown-3b7d42ffe20649f3.rlib" "/Users/apple/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/librustc_std_workspace_alloc-4ad9bb4642dcbb0e.rlib" "/Users/apple/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libunwind-2705756291291215.rlib" "/Users/apple/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libcfg_if-4b3e65f59d0d2bb7.rlib" "/Users/apple/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/liblibc-654bf98555d844ff.rlib" "/Users/apple/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/liballoc-46c32f2ea46d194a.rlib" "/Users/apple/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/librustc_std_workspace_core-ce3fd965850830d8.rlib" "/Users/apple/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libcore-46c797561289aff0.rlib" "/Users/apple/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libcompiler_builtins-974d425bd7750373.rlib" "-framework" "CoreFoundation" "-lSystem" "-lresolv" "-lc" "-lm"
  = note: Undefined symbols for architecture x86_64:
            "_CFMutableAttributedStringGetTypeID", referenced from:
                _$LT$core_foundation..attributed_string..CFMutableAttributedString$u20$as$u20$core_foundation..base..TCFType$GT$::type_id::h9cd95ae9d283ffee in libcore_foundation-19ef10f3e7242abe.rlib(core_foundation-19ef10f3e7242abe.core_foundation.bhl000vu-cgu.0.rcgu.o)
          ld: symbol(s) not found for architecture x86_64
          clang: error: linker command failed with exit code 1 (use -v to see invocation)

With a -Clink-dead-code flag removed from RUSTFLAGS build successfully compiles:

$ cargo clean
$ CARGO_INCREMENTAL=0 RUSTFLAGS="-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Coverflow-checks=off -Zno-landing-pads" cargo run
   Compiling libc v0.2.60
   Compiling core-foundation-sys v0.6.2
   Compiling core-foundation v0.6.4
   Compiling foo v0.1.0 (/Users/apple/Desktop/foo)
    Finished dev [unoptimized + debuginfo] target(s) in 3.76s
     Running `target/debug/foo`
[src/main.rs:10] dict.len() = 1

The same behavior applies to cargo test command.

Meta

$ rustc --version --verbose
rustc 1.38.0-nightly (a7f28678b 2019-07-23)
binary: rustc
commit-hash: a7f28678bbf4e16893bb6a718e427504167a9494
commit-date: 2019-07-23
host: x86_64-apple-darwin
release: 1.38.0-nightly
LLVM version: 9.0

$ xcrun --show-sdk-version
10.14.1

$ sw_vers
ProductName:	Mac OS X
ProductVersion:	10.13.6
BuildVersion:	17G65

Activity

  1. added
    A-linkage
    C-bug
    T-compiler
    on Jul 27, 2019
  2. added
    O-macos
    on Oct 5, 2019
  3. wagenet commented on Oct 9, 2019

    @wagenet
    Contributor

    I'm seeing this issue except I get:

    note: Undefined symbols for architecture x86_64:
                "___isPlatformVersionAtLeast", referenced from:
                    _singleipconnect in libcurl.a(libcurl_la-connect.o)
                    _sectransp_connect_common in libcurl.a(libcurl_la-sectransp.o)
                    _sectransp_connect_step2 in libcurl.a(libcurl_la-sectransp.o)
                    _sectransp_version_from_curl in libcurl.a(libcurl_la-sectransp.o)
    

    Unlike in sagebind/curl-rust#279 I only get it when trying to build for grcov with -Zprofile -Clink-dead-code.

  4. jduan commented on Dec 7, 2019

    @jduan

    I'm getting the same error

      = note: Undefined symbols for architecture x86_64:
                "_CFMutableAttributedStringGetTypeID", referenced from:
                    _$LT$core_foundation..attributed_string..CFMutableAttributedString$u20$as$u20$core_foundation..base..TCFType$GT$::type_id::h58cab0fb10c1f89d in libcore_foundation-264aa8cf11fe1e90.rlib(core_foundation-264aa8cf11fe1e90.core_foundation.1egne0i1-cgu.0.rcgu.o)
              ld: symbol(s) not found for architecture x86_64
              clang: error: linker command failed with exit code 1 (use -v to see invocation)
    

    and I'm on nightly as well:

    nightly-x86_64-apple-darwin (default)
    rustc 1.41.0-nightly (ae1b871cc 2019-12-06)
    
  5. wagenet commented on Jan 24, 2020

    @wagenet
    Contributor

    I'm also seeing a similar issue in an Ubuntu-based Docker container:

    error: linking with `cc` failed: exit code: 1
      |
      = note: "cc" "-Wl,--as-needed" "-Wl,-z,noexecstack" "-m64" "-L" "/usr/local/rustup/toolchains/nightly-2020-01-21-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "/project/target/debug/deps/skylight-b16259e4e61f6fd1.skylight.384cbiki-cgu.0.rcgu.o" "-o" "/project/target/debug/deps/skylight-b16259e4e61f6fd1" "/project/target/debug/deps/skylight-b16259e4e61f6fd1.28i8qis0u3yk7bvn.rcgu.o" "-pie" "-Wl,-zrelro" "-Wl,-znow" "-nodefaultlibs" "-L" "/project/target/debug/deps" "-L" "deps/x86_64-linux" "-L" "/usr/lib/x86_64-linux-gnu" "-L" "/project/deps/x86_64-linux/lib" "-L" "/usr/local/rustup/toolchains/nightly-2020-01-21-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-Wl,-Bstatic" "/project/target/debug/deps/libcurl-af0fb6c764673d16.rlib" "/project/target/debug/deps/libsocket2-2961fab338b70973.rlib" "/project/target/debug/deps/libcurl_sys-6bb174e487a3b5f6.rlib" "/usr/local/rustup/toolchains/nightly-2020-01-21-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libtest-589e8731323ee536.rlib" "/usr/local/rustup/toolchains/nightly-2020-01-21-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libterm-f19c446aea8afe57.rlib" "/usr/local/rustup/toolchains/nightly-2020-01-21-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libgetopts-60229cb5a4d83162.rlib" "/usr/local/rustup/toolchains/nightly-2020-01-21-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libunicode_width-dc535a59a874e08d.rlib" "/usr/local/rustup/toolchains/nightly-2020-01-21-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_std-6e69174eaf0d10a8.rlib" "/project/target/debug/deps/libslab-0e5169b0fa9dc45f.rlib" "/project/target/debug/deps/libmio_extras-8dbbe4d46043ed32.rlib" "/project/target/debug/deps/liblazycell-d26a110cec625dcd.rlib" "/project/target/debug/deps/libbytes-223909e0fc55cf73.rlib" "/project/target/debug/deps/libbyteorder-d87a5caa6531b0f0.rlib" "/project/target/debug/deps/libtempfile-e450a0141f8c9f7c.rlib" "/project/target/debug/deps/librand-93c7a37df2ab6599.rlib" "/project/target/debug/deps/librand_chacha-b7d7fc4cd5b9cb15.rlib" "/project/target/debug/deps/libc2_chacha-32c31ca297fd176c.rlib" "/project/target/debug/deps/libppv_lite86-683d6c4f0db0ca82.rlib" "/project/target/debug/deps/librand_core-deb7567b74364c86.rlib" "/project/target/debug/deps/libgetrandom-cbce369a23047747.rlib" "/project/target/debug/deps/libremove_dir_all-9cbeaf41f02bb348.rlib" "/project/target/debug/deps/libmio_uds-6f2ee5ecb50a9367.rlib" "/project/target/debug/deps/libmio-9a0970157657be0c.rlib" "/project/target/debug/deps/libslab-0537c06633a4abc9.rlib" "/project/target/debug/deps/libnet2-ecc6df404c3eadbb.rlib" "/project/target/debug/deps/libiovec-7c7512359b4d0a0b.rlib" "/project/target/debug/deps/libglob-1ba296cdcf0e01b9.rlib" "/project/target/debug/deps/libunix_socket-2fb58c0b8fd15d7a.rlib" "/project/target/debug/deps/librand-0d039ae8d8aea6af.rlib" "/project/target/debug/deps/librand_xorshift-9c9d826cc0de32e7.rlib" "/project/target/debug/deps/librand_pcg-d31e74e9908596f7.rlib" "/project/target/debug/deps/librand_hc-f814ccc9684acc55.rlib" "/project/target/debug/deps/librand_chacha-298f4925e39045d7.rlib" "/project/target/debug/deps/librand_isaac-a0a67e8a09e5017d.rlib" "/project/target/debug/deps/librand_core-73ada910099d71e8.rlib" "/project/target/debug/deps/librand_os-8a020002bc373844.rlib" "/project/target/debug/deps/librand_jitter-f0a9036cfebb833e.rlib" "/project/target/debug/deps/librand_core-82d5e96b6bc6a3fd.rlib" "/project/target/debug/deps/liblog4rs-8b92055510bcf8df.rlib" "/project/target/debug/deps/libtypemap-2bfdbd17724bc420.rlib" "/project/target/debug/deps/libunsafe_any-3e684ac4059a451d.rlib" "/project/target/debug/deps/libtraitobject-8a03022144c096bf.rlib" "/project/target/debug/deps/libthread_id-f78e213313ef3a9e.rlib" "/project/target/debug/deps/libserde_yaml-a660bc8499e84ebe.rlib" "/project/target/debug/deps/libdtoa-d56afc5a0f8ea498.rlib" "/project/target/debug/deps/libyaml_rust-0d992a63b4e9fbd6.rlib" "/project/target/debug/deps/liblinked_hash_map-ad81973f5cb83fed.rlib" "/project/target/debug/deps/libserde_value-c3495b725241042e.rlib" "/project/target/debug/deps/libordered_float-81df153054b4260d.rlib" "/project/target/debug/deps/liblog_mdc-3ebfff32d747017d.rlib" "/project/target/debug/deps/libfnv-db31bc8a14ceaafe.rlib" "/project/target/debug/deps/libflate2-85278b5770c1daeb.rlib" "/project/target/debug/deps/libminiz_oxide-9909ad042a9c9894.rlib" "/project/target/debug/deps/libadler32-43a566967e17fb29.rlib" "/project/target/debug/deps/libcrc32fast-1d1e5f713046710b.rlib" "/project/target/debug/deps/libchrono-f6cf678184b3e8fd.rlib" "/project/target/debug/deps/libnum_integer-70c5c2cfd73e7c66.rlib" "/project/target/debug/deps/libnum_traits-ab5d64efb4d1de5a.rlib" "/project/target/debug/deps/libarc_swap-f12b2f4d9eb2705e.rlib" "/project/target/debug/deps/libantidote-d1300fd4e41b7300.rlib" "/project/target/debug/deps/libnix-bb380732871eb4e6.rlib" "/project/target/debug/deps/libbitflags-87a64b28e4c93fa7.rlib" "/project/target/debug/deps/libbloomfilter-39694116dba9ce09.rlib" "/project/target/debug/deps/libsiphasher-76f1c433e1da5d58.rlib" "/project/target/debug/deps/librand-879a54245f237008.rlib" "/project/target/debug/deps/librand-df16d4b7a7dfff86.rlib" "/project/target/debug/deps/libbit_vec-cef18d491377605f.rlib" "/project/target/debug/deps/libpidfile-14227934404ede6a.rlib" "/project/target/debug/deps/liblog-bf7a31298b860d16.rlib" "/project/target/debug/deps/libnix-f2ad7472ae7fa5a5.rlib" "/project/target/debug/deps/libvoid-beb033ed00d89924.rlib" "/project/target/debug/deps/libbitflags-2d516e7f00201bec.rlib" "/project/target/debug/deps/libdocopt-729355d582495ce3.rlib" "/project/target/debug/deps/libstrsim-fb46177850682edf.rlib" "/project/target/debug/deps/libbuffoon-a31af420092a8f91.rlib" "/project/target/debug/deps/libsemver-9d5f04eeeb4cdcbc.rlib" "/project/target/debug/deps/libsemver_parser-ac9b4c719761673f.rlib" "/project/target/debug/deps/liburl-c1801a4cff106351.rlib" "/project/target/debug/deps/libpercent_encoding-35dbc3d881e553ce.rlib" "/project/target/debug/deps/libidna-f90c9f080a00d499.rlib" "/project/target/debug/deps/libunicode_normalization-27c042e472a056d0.rlib" "/project/target/debug/deps/libsmallvec-b0d47fef0ce4e6be.rlib" "/project/target/debug/deps/libunicode_bidi-278b71400887702d.rlib" "/project/target/debug/deps/libmatches-3e46d2bd749c1a05.rlib" "/project/target/debug/deps/libtime-8e5a3591786dc0b0.rlib" "/project/target/debug/deps/libsql_lexer-cfb8ea13a94fa676.rlib" "/project/target/debug/deps/liblalrpop_util-81b9f0e52c902db2.rlib" "/project/target/debug/deps/libenv_logger-70592c63808fd818.rlib" "/project/target/debug/deps/libtermcolor-771d66e06b83ef38.rlib" "/project/target/debug/deps/libatty-601bb16a39a7fdc2.rlib" "/project/target/debug/deps/libhumantime-21f37323cb7869dc.rlib" "/project/target/debug/deps/libquick_error-019894261f1f0347.rlib" "/project/target/debug/deps/libregex-766996c96720bda4.rlib" "/project/target/debug/deps/libthread_local-4ff3b91ef8ffb5e7.rlib" "/project/target/debug/deps/liblazy_static-fe9ad5d9a04c4ee2.rlib" "/project/target/debug/deps/libregex_syntax-af25017c0adc159d.rlib" "/project/target/debug/deps/libaho_corasick-64de71e23333f7bb.rlib" "/project/target/debug/deps/libmemchr-fd3c645d60c8da01.rlib" "/project/target/debug/deps/liblibc-86ded2db986cd877.rlib" "/project/target/debug/deps/liblog-de205a072af13734.rlib" "/project/target/debug/deps/libcfg_if-5a2eba7d9e1d582d.rlib" "/project/target/debug/deps/libserde_json-50c59c6a8cdb9028.rlib" "/project/target/debug/deps/libryu-6ce698c492f354ef.rlib" "/project/target/debug/deps/libitoa-c879c1c76ef2ad14.rlib" "/project/target/debug/deps/libserde-b6f4f434facd9e3c.rlib" "/usr/local/rustup/toolchains/nightly-2020-01-21-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libprofiler_builtins-c95e10c81e17a8c3.rlib" "-Wl,--start-group" "/usr/local/rustup/toolchains/nightly-2020-01-21-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-87194af682396769.rlib" "/usr/local/rustup/toolchains/nightly-2020-01-21-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libpanic_unwind-af80e10d728d9fa0.rlib" "/usr/local/rustup/toolchains/nightly-2020-01-21-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libhashbrown-dc72808411834d6e.rlib" "/usr/local/rustup/toolchains/nightly-2020-01-21-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_alloc-fa9dccc2dd30bed7.rlib" "/usr/local/rustup/toolchains/nightly-2020-01-21-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libbacktrace-1556888cccf238af.rlib" "/usr/local/rustup/toolchains/nightly-2020-01-21-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libbacktrace_sys-f2d71e6a92ac1aa5.rlib" "/usr/local/rustup/toolchains/nightly-2020-01-21-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_demangle-d875430891f9ff56.rlib" "/usr/local/rustup/toolchains/nightly-2020-01-21-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libunwind-30a3a0ef179b2cb8.rlib" "/usr/local/rustup/toolchains/nightly-2020-01-21-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcfg_if-d227b879b21a33f0.rlib" "/usr/local/rustup/toolchains/nightly-2020-01-21-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liblibc-140f5d932e2c4290.rlib" "/usr/local/rustup/toolchains/nightly-2020-01-21-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc-f2c6c629baadf366.rlib" "/usr/local/rustup/toolchains/nightly-2020-01-21-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_core-6d0d8b33b8f7527c.rlib" "/usr/local/rustup/toolchains/nightly-2020-01-21-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore-a0edec241ec339ce.rlib" "-Wl,--end-group" "/usr/local/rustup/toolchains/nightly-2020-01-21-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins-4948ad4bea52b2b6.rlib" "-Wl,-Bdynamic" "-lutil" "-lutil" "-ldl" "-lrt" "-lpthread" "-lgcc_s" "-lc" "-lm" "-lrt" "-lpthread" "-lutil" "-lutil"
      = note: /project/target/debug/deps/libcurl-af0fb6c764673d16.rlib(curl-af0fb6c764673d16.curl.biyx96j4-cgu.0.rcgu.o): In function `_$LT$curl..error..Error$u20$as$u20$std..error..Error$GT$::description::h784aa74a27071602':
              /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/curl-0.4.25/src/error.rs:335: undefined reference to `curl_easy_strerror'
              /project/target/debug/deps/libcurl-af0fb6c764673d16.rlib(curl-af0fb6c764673d16.curl.biyx96j4-cgu.0.rcgu.o): In function `_$LT$curl..error..ShareError$u20$as$u20$std..error..Error$GT$::description::h2a22e51c4016fd6a':
              /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/curl-0.4.25/src/error.rs:407: undefined reference to `curl_share_strerror'
              /project/target/debug/deps/libcurl-af0fb6c764673d16.rlib(curl-af0fb6c764673d16.curl.biyx96j4-cgu.0.rcgu.o): In function `_$LT$curl..error..MultiError$u20$as$u20$std..error..Error$GT$::description::hd7b7696ecc2d1f01':
              /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/curl-0.4.25/src/error.rs:494: undefined reference to `curl_multi_strerror'
              /project/target/debug/deps/libcurl-af0fb6c764673d16.rlib(curl-af0fb6c764673d16.curl.biyx96j4-cgu.0.rcgu.o): In function `curl::version::Version::num::he5775daefcae7a6c':
              /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/curl-0.4.25/src/version.rs:27: undefined reference to `curl_version'
              /project/target/debug/deps/libcurl-af0fb6c764673d16.rlib(curl-af0fb6c764673d16.curl.biyx96j4-cgu.0.rcgu.o): In function `curl::version::Version::get::h9cda8f878f2e86c3':
              /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/curl-0.4.25/src/version.rs:35: undefined reference to `curl_version_info'
              /project/target/debug/deps/libcurl-af0fb6c764673d16.rlib(curl-af0fb6c764673d16.curl.biyx96j4-cgu.0.rcgu.o): In function `_$LT$curl..easy..form..Form$u20$as$u20$core..ops..drop..Drop$GT$::drop::h840280cba5b6b6af':
              /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/curl-0.4.25/src/easy/form.rs:72: undefined reference to `curl_formfree'
              /project/target/debug/deps/libcurl-af0fb6c764673d16.rlib(curl-af0fb6c764673d16.curl.biyx96j4-cgu.0.rcgu.o): In function `curl::easy::form::Part::add::h15d584fd09939428':
              /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/curl-0.4.25/src/easy/form.rs:316: undefined reference to `curl_formadd'
              /project/target/debug/deps/libcurl-af0fb6c764673d16.rlib(curl-af0fb6c764673d16.curl.biyx96j4-cgu.0.rcgu.o): In function `curl::easy::handler::Easy2$LT$H$GT$::new::h5556842d8101872c':
              /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/curl-0.4.25/src/easy/handler.rs:610: undefined reference to `curl_easy_init'
              /project/target/debug/deps/libcurl-af0fb6c764673d16.rlib(curl-af0fb6c764673d16.curl.biyx96j4-cgu.0.rcgu.o): In function `curl::easy::handler::Easy2$LT$H$GT$::reset::h2265ecaaa01b7e99':
              /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/curl-0.4.25/src/easy/handler.rs:634: undefined reference to `curl_easy_reset'
              /project/target/debug/deps/libcurl-af0fb6c764673d16.rlib(curl-af0fb6c764673d16.curl.biyx96j4-cgu.0.rcgu.o): In function `curl::easy::handler::Easy2$LT$H$GT$::cookies::hdc82f36de1e1c15c':
              /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/curl-0.4.25/src/easy/handler.rs:2564: undefined reference to `curl_easy_getinfo'
              /project/target/debug/deps/libcurl-af0fb6c764673d16.rlib(curl-af0fb6c764673d16.curl.biyx96j4-cgu.0.rcgu.o): In function `curl::easy::handler::Easy2$LT$H$GT$::perform::hc54ec8909b1f3750':
              /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/curl-0.4.25/src/easy/handler.rs:2624: undefined reference to `curl_easy_perform'
              /project/target/debug/deps/libcurl-af0fb6c764673d16.rlib(curl-af0fb6c764673d16.curl.biyx96j4-cgu.0.rcgu.o): In function `curl::easy::handler::Easy2$LT$H$GT$::unpause_read::hf954754948760006':
              /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/curl-0.4.25/src/easy/handler.rs:2645: undefined reference to `curl_easy_pause'
              /project/target/debug/deps/libcurl-af0fb6c764673d16.rlib(curl-af0fb6c764673d16.curl.biyx96j4-cgu.0.rcgu.o): In function `curl::easy::handler::Easy2$LT$H$GT$::unpause_write::h113b260b264e7a22':
              /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/curl-0.4.25/src/easy/handler.rs:2666: undefined reference to `curl_easy_pause'
              /project/target/debug/deps/libcurl-af0fb6c764673d16.rlib(curl-af0fb6c764673d16.curl.biyx96j4-cgu.0.rcgu.o): In function `curl::easy::handler::Easy2$LT$H$GT$::url_encode::h6d38c599b5f16355':
              /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/curl-0.4.25/src/easy/handler.rs:2677: undefined reference to `curl_easy_escape'
              /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/curl-0.4.25/src/easy/handler.rs:2685: undefined reference to `curl_free'
              /project/target/debug/deps/libcurl-af0fb6c764673d16.rlib(curl-af0fb6c764673d16.curl.biyx96j4-cgu.0.rcgu.o): In function `curl::easy::handler::Easy2$LT$H$GT$::url_decode::hce7d0338fc734e17':
              /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/curl-0.4.25/src/easy/handler.rs:2710: undefined reference to `curl_easy_unescape'
              /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/curl-0.4.25/src/easy/handler.rs:2719: undefined reference to `curl_free'
              /project/target/debug/deps/libcurl-af0fb6c764673d16.rlib(curl-af0fb6c764673d16.curl.biyx96j4-cgu.0.rcgu.o): In function `curl::easy::handler::Easy2$LT$H$GT$::recv::h8ae7e08849b1b67b':
              /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/curl-0.4.25/src/easy/handler.rs:2759: undefined reference to `curl_easy_recv'
              /project/target/debug/deps/libcurl-af0fb6c764673d16.rlib(curl-af0fb6c764673d16.curl.biyx96j4-cgu.0.rcgu.o): In function `curl::easy::handler::Easy2$LT$H$GT$::send::h9d957d0e2f63cebd':
              /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/curl-0.4.25/src/easy/handler.rs:2780: undefined reference to `curl_easy_send'
              /project/target/debug/deps/libcurl-af0fb6c764673d16.rlib(curl-af0fb6c764673d16.curl.biyx96j4-cgu.0.rcgu.o): In function `curl::easy::handler::Easy2$LT$H$GT$::setopt_long::hd2176641597aff61':
              /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/curl-0.4.25/src/easy/handler.rs:2812: undefined reference to `curl_easy_setopt'
              /project/target/debug/deps/libcurl-af0fb6c764673d16.rlib(curl-af0fb6c764673d16.curl.biyx96j4-cgu.0.rcgu.o): In function `curl::easy::handler::Easy2$LT$H$GT$::setopt_ptr::h5f74f34e93eaeb8e':
              /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/curl-0.4.25/src/easy/handler.rs:2820: undefined reference to `curl_easy_setopt'
              /project/target/debug/deps/libcurl-af0fb6c764673d16.rlib(curl-af0fb6c764673d16.curl.biyx96j4-cgu.0.rcgu.o): In function `curl::easy::handler::Easy2$LT$H$GT$::setopt_off_t::hb98bb1a5556639a9':
              /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/curl-0.4.25/src/easy/handler.rs:2829: undefined reference to `curl_easy_setopt'
              /project/target/debug/deps/libcurl-af0fb6c764673d16.rlib(curl-af0fb6c764673d16.curl.biyx96j4-cgu.0.rcgu.o): In function `curl::easy::handler::Easy2$LT$H$GT$::getopt_ptr::hc4f958828b2192fd':
              /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/curl-0.4.25/src/easy/handler.rs:2848: undefined reference to `curl_easy_getinfo'
              /project/target/debug/deps/libcurl-af0fb6c764673d16.rlib(curl-af0fb6c764673d16.curl.biyx96j4-cgu.0.rcgu.o): In function `curl::easy::handler::Easy2$LT$H$GT$::getopt_long::hc73d68d94e2499b5':
              /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/curl-0.4.25/src/easy/handler.rs:2868: undefined reference to `curl_easy_getinfo'
              /project/target/debug/deps/libcurl-af0fb6c764673d16.rlib(curl-af0fb6c764673d16.curl.biyx96j4-cgu.0.rcgu.o): In function `curl::easy::handler::Easy2$LT$H$GT$::getopt_double::hdb6f3176b16d4228':
              /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/curl-0.4.25/src/easy/handler.rs:2877: undefined reference to `curl_easy_getinfo'
              /project/target/debug/deps/libcurl-af0fb6c764673d16.rlib(curl-af0fb6c764673d16.curl.biyx96j4-cgu.0.rcgu.o): In function `_$LT$curl..easy..handler..Easy2$LT$H$GT$$u20$as$u20$core..ops..drop..Drop$GT$::drop::hecaba7b25a0ae8f6':
              /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/curl-0.4.25/src/easy/handler.rs:2932: undefined reference to `curl_easy_cleanup'
              /project/target/debug/deps/libcurl-af0fb6c764673d16.rlib(curl-af0fb6c764673d16.curl.biyx96j4-cgu.0.rcgu.o): In function `curl::easy::list::List::append::hc26ebe80e3eb7260':
              /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/curl-0.4.25/src/easy/list.rs:39: undefined reference to `curl_slist_append'
              /project/target/debug/deps/libcurl-af0fb6c764673d16.rlib(curl-af0fb6c764673d16.curl.biyx96j4-cgu.0.rcgu.o): In function `_$LT$curl..easy..list..List$u20$as$u20$core..ops..drop..Drop$GT$::drop::h3d625851a8e9b64d':
              /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/curl-0.4.25/src/easy/list.rs:74: undefined reference to `curl_slist_free_all'
              /project/target/debug/deps/libcurl-af0fb6c764673d16.rlib(curl-af0fb6c764673d16.curl.biyx96j4-cgu.0.rcgu.o): In function `curl::multi::Multi::new::h14803c7481a40ba3':
              /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/curl-0.4.25/src/multi.rs:100: undefined reference to `curl_multi_init'
              /project/target/debug/deps/libcurl-af0fb6c764673d16.rlib(curl-af0fb6c764673d16.curl.biyx96j4-cgu.0.rcgu.o): In function `curl::multi::Multi::assign::h6eb26b1313cfebfc':
              /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/curl-0.4.25/src/multi.rs:197: undefined reference to `curl_multi_assign'
              /project/target/debug/deps/libcurl-af0fb6c764673d16.rlib(curl-af0fb6c764673d16.curl.biyx96j4-cgu.0.rcgu.o): In function `curl::multi::Multi::setopt_long::h4bc8e600ec583f47':
              /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/curl-0.4.25/src/multi.rs:343: undefined reference to `curl_multi_setopt'
              /project/target/debug/deps/libcurl-af0fb6c764673d16.rlib(curl-af0fb6c764673d16.curl.biyx96j4-cgu.0.rcgu.o): In function `curl::multi::Multi::setopt_ptr::hc7059e5b38f0c00f':
              /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/curl-0.4.25/src/multi.rs:351: undefined reference to `curl_multi_setopt'
              /project/target/debug/deps/libcurl-af0fb6c764673d16.rlib(curl-af0fb6c764673d16.curl.biyx96j4-cgu.0.rcgu.o): In function `curl::multi::Multi::add::he67b5705adb640de':
              /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/curl-0.4.25/src/multi.rs:379: undefined reference to `curl_multi_add_handle'
              /project/target/debug/deps/libcurl-af0fb6c764673d16.rlib(curl-af0fb6c764673d16.curl.biyx96j4-cgu.0.rcgu.o): In function `curl::multi::Multi::remove::h746e149ad309bdd2':
              /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/curl-0.4.25/src/multi.rs:411: undefined reference to `curl_multi_remove_handle'
              /project/target/debug/deps/libcurl-af0fb6c764673d16.rlib(curl-af0fb6c764673d16.curl.biyx96j4-cgu.0.rcgu.o): In function `curl::multi::Multi::_messages::h43cd721b9bb8311e':
              /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/curl-0.4.25/src/multi.rs:447: undefined reference to `curl_multi_info_read'
              /project/target/debug/deps/libcurl-af0fb6c764673d16.rlib(curl-af0fb6c764673d16.curl.biyx96j4-cgu.0.rcgu.o): In function `curl::multi::Multi::action::h1fbb2ecea83e4660':
              /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/curl-0.4.25/src/multi.rs:483: undefined reference to `curl_multi_socket_action'
              /project/target/debug/deps/libcurl-af0fb6c764673d16.rlib(curl-af0fb6c764673d16.curl.biyx96j4-cgu.0.rcgu.o): In function `curl::multi::Multi::timeout::h41235987c530c44c':
              /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/curl-0.4.25/src/multi.rs:511: undefined reference to `curl_multi_socket_action'
              /project/target/debug/deps/libcurl-af0fb6c764673d16.rlib(curl-af0fb6c764673d16.curl.biyx96j4-cgu.0.rcgu.o): In function `curl::multi::Multi::get_timeout::h13bd31e994e4ec74':
              /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/curl-0.4.25/src/multi.rs:541: undefined reference to `curl_multi_timeout'
              /project/target/debug/deps/libcurl-af0fb6c764673d16.rlib(curl-af0fb6c764673d16.curl.biyx96j4-cgu.0.rcgu.o): In function `curl::multi::Multi::wait::h344ef1c8a9e85a81':
              /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/curl-0.4.25/src/multi.rs:587: undefined reference to `curl_multi_wait'
              /project/target/debug/deps/libcurl-af0fb6c764673d16.rlib(curl-af0fb6c764673d16.curl.biyx96j4-cgu.0.rcgu.o): In function `curl::multi::Multi::perform::hf633d99e197fc20b':
              /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/curl-0.4.25/src/multi.rs:641: undefined reference to `curl_multi_perform'
              /project/target/debug/deps/libcurl-af0fb6c764673d16.rlib(curl-af0fb6c764673d16.curl.biyx96j4-cgu.0.rcgu.o): In function `curl::multi::Multi::fdset2::h69db902c41f168fd':
              /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/curl-0.4.25/src/multi.rs:688: undefined reference to `curl_multi_fdset'
              /project/target/debug/deps/libcurl-af0fb6c764673d16.rlib(curl-af0fb6c764673d16.curl.biyx96j4-cgu.0.rcgu.o): In function `curl::multi::Multi::close::h4d24639d5b8d9e60':
              /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/curl-0.4.25/src/multi.rs:705: undefined reference to `curl_multi_cleanup'
              /project/target/debug/deps/libcurl-af0fb6c764673d16.rlib(curl-af0fb6c764673d16.curl.biyx96j4-cgu.0.rcgu.o): In function `curl::multi::EasyHandle::set_token::hdb3209c9f5835eff':
              /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/curl-0.4.25/src/multi.rs:795: undefined reference to `curl_easy_setopt'
              /project/target/debug/deps/libcurl-af0fb6c764673d16.rlib(curl-af0fb6c764673d16.curl.biyx96j4-cgu.0.rcgu.o): In function `curl::multi::Message::token::h04b2b85dbfc5caaf':
              /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/curl-0.4.25/src/multi.rs:985: undefined reference to `curl_easy_getinfo'
              /project/target/debug/deps/libcurl-af0fb6c764673d16.rlib(curl-af0fb6c764673d16.curl.biyx96j4-cgu.0.rcgu.o): In function `curl::init::_$u7b$$u7b$closure$u7d$$u7d$::h2a664f675a467dcd':
              /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/curl-0.4.25/src/lib.rs:88: undefined reference to `curl_global_init'
              collect2: error: ld returned 1 exit status
    
  6. gilescope commented on Feb 18, 2020

    @gilescope
    Contributor

    Interesting. Is there an example project that this fails for? It just works for me on a 2017 mbp with latest nightly (I'm using it on a small project though..).

  7. wagenet commented on Feb 18, 2020

    @wagenet
    Contributor

    @gilescope unfortunately, I don't currently have a simplified project. I suspect it may be related to some of the way curl-rust is set up. But I can't say for certain.

  8. gilescope commented on Feb 18, 2020

    @gilescope
    Contributor

    Ok so this could be a somewhat idiosyncratic error rather than being a general error affecting all osx users of grcov...

    Sent with GitHawk

  9. wagenet commented on Feb 18, 2020

    @wagenet
    Contributor

    @gilescope definitely not unique to macOS since I saw something very similar in an Ubuntu Docker container.

  10. added a commit that references this issue on Feb 21, 2020
  11. vbadanov commented on Feb 21, 2020

    @vbadanov

    This issue was fixed in servo/core-foundation-rs#357 so now we should wait for a new release of core-foundation crate and all dependent crates tree (security-framework, native-tls, etc)

  12. jduan commented on Feb 21, 2020

    @jduan

    @vbadanov that's great news. Thanks for the fix!

  13. avnerbarr commented on Nov 2, 2020

    @avnerbarr

    I'm getting this issue now as well

      = note: Undefined symbols for architecture x86_64:
                "_CFMutableAttributedStringGetTypeID", referenced from:
                    _$LT$core_foundation..attributed_string..CFMutableAttributedString$u20$as$u20$core_foundation..base..TCFType$GT$::type_id::h34814b711ea45d36 in libcore_foundation-a5a0f887432b6bbe.rlib(core_foundation-a5a0f887432b6bbe.core_foundation.2kp1ivj9-cgu.0.rcgu.o)
    

    active toolchain

    stable-x86_64-apple-darwin (default)
    rustc 1.46.0 (04488af 2020-08-24)

  14. dupu222 commented on Jan 5, 2021

    @dupu222
      = note: Undefined symbols for architecture x86_64:
                "_CFMutableAttributedStringGetTypeID", referenced from:
                    _$LT$core_foundation..attributed_string..CFMutableAttributedString$u20$as$u20$core_foundation..base..TCFType$GT$::type_id::h5e9b5accdb7d85cb in libcore_foundation-3fe28be0eb571159.rlib(core_foundation-3fe28be0eb571159.core_foundation.77blwz1k-cgu.0.rcgu.o)
    

    Environment

    macOS Big Sur 11.1
    stable-x86_64-apple-darwin (default)
    rustc 1.49.0 (e1884a8 2020-12-29)

  15. vbadanov commented on May 15, 2021

    @vbadanov

    There are still a lot of crates which depend on older version of core-foundation (e.g. 0.7).

    Test code (see above) with core-foundation = "0.9.1" and rustc 1.54.0-nightly works as expected without errors, coverage report is generated successfully.

    If you see errors, please check your crates dependencies, there should be an old core-foundation version somewhere in the tree.

  16. seanpianka commented on May 15, 2021

    @seanpianka

    @vbadanov Does this mean that crates which depend on core-foundation should upgrade to the latest now? I imagine the situation will be similar to when Tokio went from 0.3 to 1.0, and it took a while for crates to upgrade.

  17. vbadanov commented on May 15, 2021

    @vbadanov

    Does this mean that crates which depend on core-foundation should upgrade to the latest now?

    @seanpianka Yes.

  18. madsmtm commented on Oct 10, 2024

    @madsmtm
    Member

    Triage: This was a bug in the core-foundation crate that was fixed years ago, so I believe this can be closed.

  19. added
    A-code-coverage
    and removed
    T-compiler
    on Nov 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-code-coverageA-linkageC-bugO-macos

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions