Skip to content

Can't link to an external thread local symbol #30795

Closed
@mneumann

Description

@mneumann

I am trying to link to

extern __thread int errno;

I try it with:

extern "C" {
    #[thread_local]
    #[link_name = "errno"]
    static errno: c_int;
}

But it seem that it omits the thread_local part. Any ideas how to get it to work? The linker tells me that I have both thread-local and non-thread local references to errno defined, so above links to the non-thread local.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions