Linking against libjulia.so v1.6.0 does not link additional dependencies

Hello,

I have code which uses the C-API of Julia.

It used to be that linking with libjulia.so in v1.5.3 (my previous installed version) linked against Julia dependencies.
The output of ldd command on the binaries was for 1.5.3 :

✔ rcaillaud ~/Workspace/localws/nimjl/examples [devel|+1…2]$ ldd bin/dummy_154 
	linux-vdso.so.1 (0x00007ffcb61c7000)
	libm.so.6 => /lib64/libm.so.6 (0x00007ff30615c000)
	librt.so.1 => /lib64/librt.so.1 (0x00007ff305f54000)
	libjulia.so.1 => /home/rcaillaud/Workspace/julia-1.5.3/lib/libjulia.so.1 (0x00007ff305785000)
	libdl.so.2 => /lib64/libdl.so.2 (0x00007ff305581000)
	libc.so.6 => /lib64/libc.so.6 (0x00007ff3051c6000)
	/lib64/ld-linux-x86-64.so.2 (0x00007ff306494000)
	libpthread.so.0 => /lib64/libpthread.so.0 (0x00007ff304fa7000)
	libunwind.so.8 => /home/rcaillaud/Workspace/julia-1.5.3/lib/julia/libunwind.so.8 (0x00007ff304d6e000)
	libLLVM-9jl.so => /home/rcaillaud/Workspace/julia-1.5.3/lib/julia/libLLVM-9jl.so (0x00007ff30160b000)
	libstdc++.so.6 => /home/rcaillaud/Workspace/julia-1.5.3/lib/julia/libstdc++.so.6 (0x00007ff30128d000)
	libgcc_s.so.1 => /home/rcaillaud/Workspace/julia-1.5.3/lib/julia/libgcc_s.so.1 (0x00007ff301075000)

And everything was working flawlessly.

Since switching to v1.6.0 ldd output is :

✘-1 rcaillaud ~/Workspace/localws/nimjl/examples [devel|+1…2]$ ldd bin/dummy_160 
	linux-vdso.so.1 (0x00007ffd5b9c5000)
	libm.so.6 => /lib64/libm.so.6 (0x00007feb38be9000)
	librt.so.1 => /lib64/librt.so.1 (0x00007feb389e1000)
	libjulia.so.1 => /home/rcaillaud/Workspace/julia-1.6.0/lib/libjulia.so.1 (0x00007feb387bb000)
	libdl.so.2 => /lib64/libdl.so.2 (0x00007feb385b7000)
	libc.so.6 => /lib64/libc.so.6 (0x00007feb381fc000)
	/lib64/ld-linux-x86-64.so.2 (0x00007feb38f21000)
	libpthread.so.0 => /lib64/libpthread.so.0 (0x00007feb37fdd000)

And the following are missing compared to 1.5.3

	libunwind.so.8 => /home/rcaillaud/Workspace/julia-1.5.3/lib/julia/libunwind.so.8 (0x00007ff304d6e000)
	libLLVM-9jl.so => /home/rcaillaud/Workspace/julia-1.5.3/lib/julia/libLLVM-9jl.so (0x00007ff30160b000)
	libstdc++.so.6 => /home/rcaillaud/Workspace/julia-1.5.3/lib/julia/libstdc++.so.6 (0x00007ff30128d000)
	libgcc_s.so.1 => /home/rcaillaud/Workspace/julia-1.5.3/lib/julia/libgcc_s.so.1 (0x00007ff301075000)

This cause some undefined error symbols :

/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: warning: type and size of dynamic symbol `jl_symbol' are not defined
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: warning: type and size of dynamic symbol `jl_string_ptr' are not defined
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: warning: type and size of dynamic symbol `jl_atexit_hook' are not defined
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: warning: type and size of dynamic symbol `jl_init__threading' are not defined
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: warning: type and size of dynamic symbol `jl_get_global' are not defined
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: warning: type and size of dynamic symbol `jl_call0' are not defined
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: warning: type and size of dynamic symbol `jl_exception_occurred' are not defined
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: warning: type and size of dynamic symbol `jl_eval_string' are not defined
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: warning: type and size of dynamic symbol `jl_call' are not defined

How can I resolve this ?
Is it necessary for me to link the additionnal dependencies manually from now on or is it a regression introduced in 1.6.0 ?

Precision : this happens on OpenSuse.

I do not see this issues on a CI that run on Ubuntu which seems a bit strange to me. Was there any change in the way Julia is linked in 1.6.0 ?

See https://github.com/JuliaLang/julia/pull/38160 by @staticfloat

Thanks for your answer, I’ve skimmed through the PR.

It is mentionned that all the symbols should be exported in libjulia.so yet I’m getting undefined reference to symbols that previously were in libjulia.so :confused:

Do I now have to manually call load_libjulia_internal() or link libjulia-internal ?

I’m not really an expert here. I’m just trying to point you in the right direction. You may need to link libjulia-internal. What happens when you run ldd on libjulia.so.1? Does it know how to find libjulia-internal ?

You might need to open up an issue.

I’m not really an expert here. I’m just trying to point you in the right direction.

I appreciate the help, I’m just a bit disappointed that somethings that worked out the box previously is now broken.

What happens when you run ldd on libjulia.so.1 ? Does it know how to find libjulia-internal ?

No it doesn’t. Apart from reading the PR is see no link to libjulia-internal

Follow up to this question on github : https://github.com/JuliaLang/julia/issues/40524