Skip to content

Commit

Permalink
Restore some ABI compatibility with Julia 1.6 (JuliaLang#40851)
Browse files Browse the repository at this point in the history
In Julia <= 1.6, the C API function `jl_init` and `jl_init_with_image` were
exported on the ABI level under the names `jl_init__threading` and
`jl_init_with_image__threading`. This was changed during development of Julia
1.7, but unfortunately that broke ABI compatibility with binaries build
against Julia <= 1.6.

Add back and export two simple wrapper functions to restore this aspect of ABI
compatibility.
  • Loading branch information
fingolfin authored and johanmon committed Jul 5, 2021
1 parent 0e5a85e commit 2ee4071
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/jl_exported_funcs.inc
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,8 @@
XX(jl_init_restored_modules) \
XX(jl_init) \
XX(jl_init_with_image) \
XX(jl_init__threading) \
XX(jl_init_with_image__threading) \
XX(jl_install_sigint_handler) \
XX(jl_instantiate_type_in_env) \
XX(jl_instantiate_unionall) \
Expand Down
13 changes: 13 additions & 0 deletions src/jlapi.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,19 @@ JL_DLLEXPORT void jl_init(void)
free(libbindir);
}

// HACK: remove this for Julia 1.8 (see <https://github.com/JuliaLang/julia/issues/40730>)
JL_DLLEXPORT void jl_init__threading(void)
{
jl_init();
}

// HACK: remove this for Julia 1.8 (see <https://github.com/JuliaLang/julia/issues/40730>)
JL_DLLEXPORT void jl_init_with_image__threading(const char *julia_bindir,
const char *image_relative_path)
{
jl_init_with_image(julia_bindir, image_relative_path);
}

JL_DLLEXPORT jl_value_t *jl_eval_string(const char *str)
{
jl_value_t *r;
Expand Down

0 comments on commit 2ee4071

Please sign in to comment.