SpecialFunctions fails to build

Hi everyone!

On my system (ArchLinux, my own build Julia 1.0) the package SpecialFunctions fails to build. The problem seems to be the creation of libopenspecfun.a and the relevant part of the build log is the following (note that /usr/lib/julia/libLLVM-6.0.so exists)

ar: /usr/lib/julia/libLLVM-6.0.so: version `LLVM_6.0' not found (required by /usr/bin/../bin/../lib/bfd-plugins/LLVMgold.so)

Is this behaviour related to something I did wrong in the build/installation process or is it an actual issue?

Thanks in advance.

Looks like your linker is trying to load LLVM for LTO, but finds julia’s LLVM copy instead.

Thanks for the hint! However, I am still confused (I am not familiar with several technical details):

  1. I deduce that the problem is ld not ar; I was mislead by ar: ...
  2. ld tries to load julia LLVM copy instead of system one (on ArchLinux, at the time of writing, shipped with the package llvm-libs 6.0.1-4), why is that an issue?
  3. How can I force the linker to load the right version of LLVM?

After some trial and error, I discovered that SpecialFunctions succeeds to build if I temporary uninstall llvm-libs. Is it possible that the problem is the other way around, that is, that Julia loads the system LLVM copy instead of its own?

I suspect removing the system llvm also removed the linker plugin, such that it didn’t attempt to LTO upon build.

Thanks for your help. Do you think I should open an issue on GitHub?

Only if this also happens with the official binaries. Since you installed it yourself, putting in a place where it interferes with the linker is on you ;).