Skip to content

Build failure on macOS 10.9 with "dyld: Symbol not found: _linkat" #2036

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

Closed
RandomInsano opened this issue Jan 17, 2021 · 1 comment
Closed
Labels
C-bug Category: bug

Comments

@RandomInsano
Copy link

RandomInsano commented Jan 17, 2021

Hitting a build-time error with "dyld: Symbol not found: _linkat" on an old Mac. Rust itself should support back to 10.7 but without the libc crate supporting it, you're only able to do no_std work.

Though, this version of macOS is ancient and really shouldn't be used. This is all just for fun.

Target triple:

$ rustup default
stable-x86_64-apple-darwin (default)

Rust version:

$ rustup --version
rustup 1.23.1 (3df2264a9 2020-11-30)
info: This is the version for the rustup toolchain manager, not the rustc compiler.
info: The currently active `rustc` version is `rustc 1.49.0 (e1884a8e3 2020-12-29)`

Here's the macOS version:

Darwin edwins-mbp.enet.local 13.4.0 Darwin Kernel Version 13.4.0: Mon Jan 11 18:17:34 PST 2016; root:xnu-2422.115.15~1/RELEASE_X86_64 x86_64

Here's the minimal test and output:

$ cargo new --bin test_libc
     Created binary (application) `test_libc` package
$ cd test_libc/
$ cargo build -v
   Compiling test_libc v0.1.0 (/Users/me/Documents/Code/rust/test_libc)
     Running `rustc --crate-name test_libc --edition=2018 src/main.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type bin --emit=dep-info,link -C embed-bitcode=no -C debuginfo=2 -C metadata=83ef5ef9eed072b6 --out-dir /Users/me/Documents/Code/rust/test_libc/target/debug/deps -C incremental=/Users/me/Documents/Code/rust/test_libc/target/debug/incremental -L dependency=/Users/me/Documents/Code/rust/test_libc/target/debug/deps`
dyld: lazy symbol binding failed: Symbol not found: _linkat
  Referenced from: /Users/me/.rustup/toolchains/stable-x86_64-apple-darwin/bin/../lib/libstd-518979da66993550.dylib
  Expected in: /usr/lib/libSystem.B.dylib

dyld: Symbol not found: _linkat
  Referenced from: /Users/me/.rustup/toolchains/stable-x86_64-apple-darwin/bin/../lib/libstd-518979da66993550.dylib
  Expected in: /usr/lib/libSystem.B.dylib

error: could not compile `test_libc`

Caused by:
  process didn't exit successfully: `rustc --crate-name test_libc --edition=2018 src/main.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type bin --emit=dep-info,link -C embed-bitcode=no -C debuginfo=2 -C metadata=83ef5ef9eed072b6 --out-dir /Users/me/Documents/Code/rust/test_libc/target/debug/deps -C incremental=/Users/me/Documents/Code/rust/test_libc/target/debug/incremental -L dependency=/Users/me/Documents/Code/rust/test_libc/target/debug/deps` (signal: 5, SIGTRAP: trace/breakpoint trap)
@RandomInsano RandomInsano added the C-bug Category: bug label Jan 17, 2021
@RandomInsano RandomInsano changed the title Build failure on macOS 10.9 with "dyld: Symbol not found: _linkat Build failure on macOS 10.9 with "dyld: Symbol not found: _linkat" Jan 17, 2021
@JohnTitor
Copy link
Member

This isn't a libc issue but std's, see rust-lang/rust#80804.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: bug
Projects
None yet
Development

No branches or pull requests

2 participants