bpftrace: Abort on startup: `CommandLine Error: Option ... registered more than once!`

Bcc static links llvm by default, if we then link LLVM again we get llvm command line fatal errors during startup.

We should either:

  • find out whether we can fix this at link time. Maybe if we specify bcc before llvm it grabs most of the stuff it needs from the bcc archive, preventing issues. Although it seems tricky to get right
  • Note in the docs that bcc needs to be built with shared llvm, see:

Did you build bcc yourself, if you did make sure you dynamic link against llvm. See debc79ef9ad4784258705a92ae70f9c7689a9c24

_Originally posted by @fbs in https://github.com/iovisor/bpftrace/issues/251#issuecomment-846424774_


: CommandLine Error: Option ‘openmp-ir-builder-optimistic-attributes’ registered more than once!

About this issue

  • Original URL
  • State: open
  • Created 3 years ago
  • Comments: 16 (8 by maintainers)

Commits related to this issue

Most upvoted comments

This is only known to be an issue with LLVM 12.

The current suggested workaround is to build bcc with: -DENABLE_LLVM_SHARED=1 cmake flag

This is only known to be an issue with LLVM 12.

The current suggested workaround is to build bcc with: -DENABLE_LLVM_SHARED=1 cmake flag

-DENABLE_LLVM_SHARED=1 solve my problem.