Skip to content

Unable to export not mangled symbol in an executable as libraries can do #25057

@Maxxie

Description

@Maxxie

trying something like this:

#[no_mangle]
pub extern "C" fn foo()
{
    //...stuff...
}

foo() seems to get exported if compiled inside a library, but if compiled in a binary crate it doesn't.
I found this out trying to use gtk builder's "gtk_builder_connect_signals", which requires for not mangled symbols to be exported.
Is this behaviour a bug? or is it a design choice? if so, why?

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-linkageArea: linking into static, shared libraries and binariesA-visibilityArea: Visibility / privacyC-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