Closed jkammerland closed 1 year ago
I can reproduce this on master, this is related to a C-API change in Julia 1.8+, warning does not appear with the 1.7.x releases.
I'll investigate but I don't think this hints at an actual bug, it's just bad practice to force the copy of the isbitstype types, which I assume are statically allocated and shouldn't be copied
MWE:
int main()
{
jl_init();
jl_value_t* proxy = jl_nothing;
return 0;
}
warning: copy relocation against non-copyable protected symbol `jl_nothing' in `/lib64/libjulia.so.1'
Process finished with exit code 0
This has nothing to do with jluna, I'll open an issue on the Julia GitHub on how to avoid this, this assignment doesn't feel like it should cause a warning.
Adding
target_compile_options(<your_executable> PRIVATE "-fpic")
Fixed it for me. Can you confirm this? <your_executable>
is your library or executable in your own CMakeLists.txt
, not jluna.
Fixed by https://github.com/Clemapfel/jluna/pull/39/commits/4c21434b965567223687585e0c9839d521a8a92a
I merged it into the 1.0.0 PR because I want to test this on another machine, I'm not positive that -fpic
is supported by all compiler versions
Indeed it resolves the warning output, only tested for gcc 12.2 and clang 15. I think the support for this flag go back quite far for gcc, clang and icc. Not sure about msvc though. Doesn't seem like code is generated the same way for windows "shared libraries", so there may not be an equivalent flag.
Thanks for help and great library btw!
Thank you for confirming, I added a section to the troubleshooting section, c.f. https://github.com/Clemapfel/jluna/commit/e55427170f5e3a695669926895753600bdaaeef2
with GCC 12 and clang 15 the code
Produce these warnings before program output:
Do I need to add some compiler flags ?