Skip to content

Base.@ccallable has not the intended effect if it is inside a package and that package has a valid ji file #34076

@KristofferC

Description

@KristofferC

Using --output-o and including a package that has a Base.@ccallable function called julia_main when the package is precompiled from some earlier usage gives the following symbols in the object file:

❯ objdump -t sys.o | grep julia_main
000000000055cfa0 l     F .text  000000000000000f jfptr_julia_main_21728
000000000055ce50 l     F .text  0000000000000144 julia_julia_main_21727

Now, only removing .julia/compiled and regenerating the sysimage, gives:

❯ objdump -t sys.o | grep julia_main
0000000000159680 l     F .text  000000000000000f jfptr_julia_main_5387
0000000000159690 l     F .text  000000000000009f jlcapi_julia_main_5390
0000000000159730 l     F .text  0000000000000098 jlcapi_julia_main_5390_gfthunk
00000000001594f0 l     F .text  0000000000000188 julia_julia_main_5386
0000000000159690 g     F .text  000000000000009f julia_main

(including the unmangled julia_main which is the point of @ccallable AFAIU).

So it seems that when the package gets loaded from the .ji file the @ccallable annotation is lost.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions