mold: mold: fatal: could not open plugin file: Cannot open "/usr/bin/../lib/LLVMgold.so"

This happen on FreeBSD 13 amd64 during try to build svt-av1 with LTO. There is no LLVMgold.so in system and system clang/ld work without this.

I suppose mold should not fail and silently ignore this.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 16 (10 by maintainers)

Most upvoted comments

I recommended you report this issue to FreeBSD because they need a user input to fix the issue once and for all. There’s actually a fix to this issue which I made in May (https://reviews.llvm.org/D125624), but there’s no progress because there’s no one who pushed it other than me. Your problem cannot be solved by filing a bug to mold and pushing me to do something. Please file bugs to FreeBSD and Clang instead and ask them to solve the problem for you.

  1. clang is a part of system
  2. LLVMgold.so not included because of incompatible license
  3. Clang pass -plugin LLVMgold.so if LTO is enabled, if use patch to prevent this then build will fail.
  4. Better to document this case some where in mold man/docs/faq, it is clang specific, not FreeBSD.