Skip to content

tvOS unresolved import crate::sys::thread_local_dtor::register_dtor #116491

Closed

Description

@simlay

Over in #104385, register_dtor was added for iOS and watchOS but not tvOS.

My test cases:

fn main() {
    println!("Hello, world!");
}

Using nightly-2023-09-24-aarch64-apple-darwin expected to see this build succeed:

$ cargo +nightly-2023-09-24-aarch64-apple-darwin build -Zbuild-std --target aarch64-apple-tvos
    Finished dev [unoptimized + debuginfo] target(s) in 0.04s

Using nightly-2023-09-25-aarch64-apple-darwin, we see that it fails with unresolved import crate::sys::thread_local_dtor::register_dtor:

$ cargo +nightly-2023-09-25-aarch64-apple-darwin build -Zbuild-std --target aarch64-apple-tvos
   Compiling compiler_builtins v0.1.101
   Compiling libc v0.2.148
   Compiling cc v1.0.79
   Compiling memchr v2.5.0
   Compiling unwind v0.0.0 (/Users/sebastian.imlay/.rustup/toolchains/nightly-2023-09-25-aarch64-apple-darwin/lib/rustlib/src/rust/library/unwind)
   Compiling std v0.0.0 (/Users/sebastian.imlay/.rustup/toolchains/nightly-2023-09-25-aarch64-apple-darwin/lib/rustlib/src/rust/library/std)
   Compiling alloc v0.0.0 (/Users/sebastian.imlay/.rustup/toolchains/nightly-2023-09-25-aarch64-apple-darwin/lib/rustlib/src/rust/library/alloc)
   Compiling cfg-if v1.0.0
   Compiling adler v1.0.2
   Compiling rustc-demangle v0.1.23
   Compiling rustc-std-workspace-alloc v1.99.0 (/Users/sebastian.imlay/.rustup/toolchains/nightly-2023-09-25-aarch64-apple-darwin/lib/rustlib/src/rust/library/rustc-std-workspace-alloc)
   Compiling panic_abort v0.0.0 (/Users/sebastian.imlay/.rustup/toolchains/nightly-2023-09-25-aarch64-apple-darwin/lib/rustlib/src/rust/library/panic_abort)
   Compiling panic_unwind v0.0.0 (/Users/sebastian.imlay/.rustup/toolchains/nightly-2023-09-25-aarch64-apple-darwin/lib/rustlib/src/rust/library/panic_unwind)
   Compiling gimli v0.28.0
   Compiling hashbrown v0.14.0
   Compiling object v0.32.0
   Compiling miniz_oxide v0.7.1
   Compiling std_detect v0.1.5 (/Users/sebastian.imlay/.rustup/toolchains/nightly-2023-09-25-aarch64-apple-darwin/lib/rustlib/src/rust/library/stdarch/crates/std_detect)
   Compiling addr2line v0.21.0
error[E0432]: unresolved import `crate::sys::thread_local_dtor::register_dtor`
  --> /Users/sebastian.imlay/.rustup/toolchains/nightly-2023-09-25-aarch64-apple-darwin/lib/rustlib/src/rust/library/std/src/sys/common/thread_local/fast_local.rs:3:5
   |
3  | use crate::sys::thread_local_dtor::register_dtor;
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `register_dtor` in `sys::unix::thread_local_dtor`
   |
note: found an item that was configured out
  --> /Users/sebastian.imlay/.rustup/toolchains/nightly-2023-09-25-aarch64-apple-darwin/lib/rustlib/src/rust/library/std/src/sys/unix/thread_local_dtor.rs:15:15
   |
15 | pub unsafe fn register_dtor(t: *mut u8, dtor: unsafe extern "C" fn(*mut u8)) {
   |               ^^^^^^^^^^^^^
note: found an item that was configured out
  --> /Users/sebastian.imlay/.rustup/toolchains/nightly-2023-09-25-aarch64-apple-darwin/lib/rustlib/src/rust/library/std/src/sys/unix/thread_local_dtor.rs:52:15
   |
52 | pub unsafe fn register_dtor(t: *mut u8, dtor: unsafe extern "C" fn(*mut u8)) {
   |               ^^^^^^^^^^^^^
note: found an item that was configured out
  --> /Users/sebastian.imlay/.rustup/toolchains/nightly-2023-09-25-aarch64-apple-darwin/lib/rustlib/src/rust/library/std/src/sys/unix/thread_local_dtor.rs:88:15
   |
88 | pub unsafe fn register_dtor(t: *mut u8, dtor: unsafe extern "C" fn(*mut u8)) {
   |               ^^^^^^^^^^^^^

For more information about this error, try `rustc --explain E0432`.
error: could not compile `std` (lib) due to previous error

Activity

  1. added
    needs-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging
    on Oct 6, 2023
  2. Jules-Bertholet commented on Oct 6, 2023

    @Jules-Bertholet
    Contributor

    @rustbot label O-tvos

  3. added
    O-tvosOperating system: tvOS (including simulator)
    on Oct 6, 2023
  4. workingjubilee commented on Oct 6, 2023

    @workingjubilee
    Member

    Happy to r+ a patch that fixes this, @simlay! I think it was just left out due to the PR being allowed to linger.

  5. added a commit that references this issue on Oct 6, 2023
    4b102b0
  6. added a commit that references this issue on Oct 7, 2023
    04ad778
  7. BlackHoleFox commented on Oct 7, 2023

    @BlackHoleFox
    Contributor

    Yeah oops, my bad. My PR never had any conflicts with the tvOS stdlib changes that merged inbetween so I missed this. Glad it was an easy fix though.

  8. removed
    needs-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging
    on Oct 8, 2023
  9. added a commit that references this issue on Oct 10, 2023
    645abff
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

    C-bugCategory: This is a bug.O-tvosOperating system: tvOS (including simulator)

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions