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
- bcc: link LLVM dynamically. As a distro, we want this anyway, but static linking also broke, e.g. bpftrace: https://github.com/iovisor/bpftrace/issues/1855 — committed to void-linux/void-packages by leahneukirchen 3 years ago
- bcc: link LLVM dynamically. As a distro, we want this anyway, but static linking also broke, e.g. bpftrace: https://github.com/iovisor/bpftrace/issues/1855 https://github.com/void-linux/void-package... — committed to atweiden/voidpkgs by atweiden 3 years ago
- bcc: link LLVM dynamically. As a distro, we want this anyway, but static linking also broke, e.g. bpftrace: https://github.com/iovisor/bpftrace/issues/1855 — committed to Noodlez1232/void-packages by leahneukirchen 3 years ago
- tasks/bcc: Make bcc runnable as explained in the following post: https://github.com/iovisor/bpftrace/issues/1855 It's almost a year ago... — committed to keithnoguchi/arch-on-air by keithnoguchi 2 years ago
This is only known to be an issue with LLVM 12.
The current suggested workaround is to build bcc with:
-DENABLE_LLVM_SHARED=1cmake flag-DENABLE_LLVM_SHARED=1solve my problem.