Skip to content

Address sanitizer fails to link on nightly-x86_64-apple-darwin toolchain #74571

Closed
@bonsairobo

Description

@bonsairobo

I tried to build my project here with address sanitizer:

RUSTFLAGS="-Z sanitizer=address" cargo +nightly run --target x86_64-apple-darwin --bin editor

and I got a link error about a bunch of undefined symbols:

error: linking with `cc` failed: exit code: 1
  |
  = note: "cc" "-m64" "-L" "/Users/duncan/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib" "/Users/duncan/handsome-voxels/target/x86_64-apple-darwin/debug/deps/lexical_core-28f3ff8c62cdf737.lexical_core.94sp2ta6-cgu.0.rcgu.o" "/Users/duncan/handsome-voxels/target/x86_64-apple-darwin/debug/deps/lexical_core-28f3ff8c62cdf737.lexical_core.94sp2ta6-cgu.1.rcgu.o" "/Users/duncan/handsome-voxels/target/x86_64-apple-darwin/debug/deps/lexical_core-28f3ff8c62cdf737.lexical_core.94sp2ta6-cgu.10.rcgu.o" "/Users/duncan/handsome-voxels/target/x86_64-apple-darwin/debug/deps/lexical_core-28f3ff8c62cdf737.lexical_core.94sp2ta6-cgu.11.rcgu.o" "/Users/duncan/handsome-voxels/target/x86_64-apple-darwin/debug/deps/lexical_core-28f3ff8c62cdf737.lexical_core.94sp2ta6-cgu.12.rcgu.o" "/Users/duncan/handsome-voxels/target/x86_64-apple-darwin/debug/deps/lexical_core-28f3ff8c62cdf737.lexical_core.94sp2ta6-cgu.13.rcgu.o" "/Users/duncan/handsome-voxels/target/x86_64-apple-darwin/debug/deps/lexical_core-28f3ff8c62cdf737.lexical_core.94sp2ta6-cgu.14.rcgu.o" "/Users/duncan/handsome-voxels/target/x86_64-apple-darwin/debug/deps/lexical_core-28f3ff8c62cdf737.lexical_core.94sp2ta6-cgu.15.rcgu.o" "/Users/duncan/handsome-voxels/target/x86_64-apple-darwin/debug/deps/lexical_core-28f3ff8c62cdf737.lexical_core.94sp2ta6-cgu.2.rcgu.o" "/Users/duncan/handsome-voxels/target/x86_64-apple-darwin/debug/deps/lexical_core-28f3ff8c62cdf737.lexical_core.94sp2ta6-cgu.3.rcgu.o" "/Users/duncan/handsome-voxels/target/x86_64-apple-darwin/debug/deps/lexical_core-28f3ff8c62cdf737.lexical_core.94sp2ta6-cgu.4.rcgu.o" "/Users/duncan/handsome-voxels/target/x86_64-apple-darwin/debug/deps/lexical_core-28f3ff8c62cdf737.lexical_core.94sp2ta6-cgu.5.rcgu.o" "/Users/duncan/handsome-voxels/target/x86_64-apple-darwin/debug/deps/lexical_core-28f3ff8c62cdf737.lexical_core.94sp2ta6-cgu.6.rcgu.o" "/Users/duncan/handsome-voxels/target/x86_64-apple-darwin/debug/deps/lexical_core-28f3ff8c62cdf737.lexical_core.94sp2ta6-cgu.7.rcgu.o" "/Users/duncan/handsome-voxels/target/x86_64-apple-darwin/debug/deps/lexical_core-28f3ff8c62cdf737.lexical_core.94sp2ta6-cgu.8.rcgu.o" "/Users/duncan/handsome-voxels/target/x86_64-apple-darwin/debug/deps/lexical_core-28f3ff8c62cdf737.lexical_core.94sp2ta6-cgu.9.rcgu.o" "-o" "/Users/duncan/handsome-voxels/target/x86_64-apple-darwin/debug/deps/liblexical_core-28f3ff8c62cdf737.dylib" "-Wl,-exported_symbols_list,/var/folders/hq/9pr5dhj171b8dznlltq6h4yh00022_/T/rustcPV8Jog/list" "/Users/duncan/handsome-voxels/target/x86_64-apple-darwin/debug/deps/lexical_core-28f3ff8c62cdf737.1mo5b0mlxxhyrlwt.rcgu.o" "-Wl,-dead_strip" "-dynamiclib" "-Wl,-dylib" "-nodefaultlibs" "-L" "/Users/duncan/handsome-voxels/target/x86_64-apple-darwin/debug/deps" "-L" "/Users/duncan/handsome-voxels/target/debug/deps" "-L" "/Users/duncan/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib" "/Users/duncan/handsome-voxels/target/x86_64-apple-darwin/debug/deps/libryu-7e1b0f2e9d48330a.rlib" "/Users/duncan/handsome-voxels/target/x86_64-apple-darwin/debug/deps/libarrayvec-9cd2750906caba3e.rlib" "/Users/duncan/handsome-voxels/target/x86_64-apple-darwin/debug/deps/libnodrop-900e3a7f2f7679f1.rlib" "/Users/duncan/handsome-voxels/target/x86_64-apple-darwin/debug/deps/libstatic_assertions-04dbb6ec8e2f4e31.rlib" "/Users/duncan/handsome-voxels/target/x86_64-apple-darwin/debug/deps/libcfg_if-dcde3996e9a47bd5.rlib" "/Users/duncan/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libstd-473bfa6649025a67.rlib" "/Users/duncan/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libpanic_unwind-8e1c1c2f3b88fa26.rlib" "/Users/duncan/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libhashbrown-73b777ace327e6f8.rlib" "/Users/duncan/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/librustc_std_workspace_alloc-b666c9c30cd05ed8.rlib" "/Users/duncan/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libbacktrace-13799bdb379be2ce.rlib" "/Users/duncan/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libbacktrace_sys-63abd5899e0d7e6b.rlib" "/Users/duncan/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/librustc_demangle-1b07ed0286619776.rlib" "/Users/duncan/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libunwind-89188c3232051162.rlib" "/Users/duncan/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libcfg_if-caece456e5f78fce.rlib" "/Users/duncan/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/liblibc-628a35dcde52dad2.rlib" "/Users/duncan/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/liballoc-a0fac8d46f97ec7a.rlib" "/Users/duncan/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/librustc_std_workspace_core-ef5998790eeac756.rlib" "/Users/duncan/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libcore-3fe78a4d2924ae43.rlib" "/Users/duncan/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libcompiler_builtins-e166c2d904273814.rlib" "-lSystem" "-lresolv" "-lc" "-lm"
  = note: Undefined symbols for architecture x86_64:
            "___asan_memmove", referenced from:
                core::intrinsics::copy::h982d3f2a1a608020 in lexical_core-28f3ff8c62cdf737.lexical_core.94sp2ta6-cgu.3.rcgu.o
                core::intrinsics::copy::hd2f8d6f0e2a1b9bc in libryu-7e1b0f2e9d48330a.rlib(ryu-7e1b0f2e9d48330a.ryu.364h1osy-cgu.14.rcgu.o)

...etc...

Meta

$ rustc +nightly --version
rustc 1.46.0-nightly (346aec9b0 2020-07-11)

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-sanitizersArea: Sanitizers for correctness and code qualityC-bugCategory: This is a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions