rust-lang / rust-lang/rust

Profiler runtime fails to build on tvOS and watchOS

Open
#152,426 2 comments 0 reactions 1 assignee View on GitHub

@madsmtm is already working on this.

Since Feb 10, 2026.

A-profile-rt C-bug C-external-bug O-tvos O-watchos S-waiting-on-LLVM T-infra
Dominant language
Rust
Stars
119k
Forks
16.2k
PR merge metrics
PR metrics pending

Description

Running ./x build --target aarch64-apple-tvos --set build.profiler=true fails with:

Compiling profiler_builtins v0.0.0 (/Users/runner/work/rust/rust/library/profiler_builtins)
/Users/runner/work/rust/rust/src/llvm-project/compiler-rt/lib/profile/GCDAProfiling.c:596:15: error: 'fork' is unavailable: not available on tvOS
  596 |   pid_t pid = fork();
      |               ^
/Applications/Xcode_26.2.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS26.2.sdk/usr/include/unistd.h:459:8: note: 'fork' has been explicitly marked unavailable here
  459 | pid_t    fork(void) __WATCHOS_PROHIBITED __TVOS_PROHIBITED;
      |          ^
1 error generated.
error: failed to run custom build command for `profiler_builtins v0.0.0 (/Users/runner/work/rust/rust/library/profiler_builtins)`

See the full build log in https://github.com/rust-lang/rust/pull/152021#issuecomment-3875952179.

This can probably be fixed fairly easily in the profiler runtime by just not trying to build __gcov_fork on these platforms, I'll submit a PR upstream, opening this mostly for tracking re-enabling in CI after https://github.com/rust-lang/rust/pull/152021.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.