Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Abort on startup: CommandLine Error: Option ... registered more than once! #1855

Open
fbs opened this issue May 23, 2021 · 16 comments
Open

Abort on startup: CommandLine Error: Option ... registered more than once! #1855

fbs opened this issue May 23, 2021 · 16 comments
Labels
build Issues or PRs related to bpftrace building docs Issues related to bpftrace documentation, man page, --help message, and error/warning messages.

Comments

@fbs
Copy link
Contributor

fbs commented May 23, 2021

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 debc79e

Originally posted by @fbs in #251 (comment)


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

@fbs fbs added build Issues or PRs related to bpftrace building docs Issues related to bpftrace documentation, man page, --help message, and error/warning messages. labels May 23, 2021
@danobi danobi changed the title bcc llvm conflicts with ours Abort on startup: CommandLine Error: Option ... registered more than once! Jun 7, 2021
@danobi
Copy link
Member

danobi commented Jun 7, 2021

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

@danobi danobi pinned this issue Jun 7, 2021
leahneukirchen added a commit to void-linux/void-packages that referenced this issue Aug 6, 2021
As a distro, we want this anyway, but static linking also broke, e.g.
bpftrace: bpftrace/bpftrace#1855
atweiden added a commit to atweiden/voidpkgs that referenced this issue Aug 19, 2021
As a distro, we want this anyway, but static linking also broke, e.g.
bpftrace: bpftrace/bpftrace#1855

void-linux/void-packages@85c4ba0
Noodlez1232 pushed a commit to Noodlez1232/void-packages that referenced this issue Aug 27, 2021
As a distro, we want this anyway, but static linking also broke, e.g.
bpftrace: bpftrace/bpftrace#1855
@Rtoax
Copy link
Contributor

Rtoax commented Dec 13, 2021

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.

@brendangregg
Copy link
Contributor

The bcc with -DENABLE_LLVM_SHARED=1 fix worked for me, thanks!

2 similar comments
@Rtoax
Copy link
Contributor

Rtoax commented Jan 29, 2022

The bcc with -DENABLE_LLVM_SHARED=1 fix worked for me, thanks!

@Jongy
Copy link

Jongy commented Feb 1, 2022

The bcc with -DENABLE_LLVM_SHARED=1 fix worked for me, thanks!

keithnoguchi added a commit to keithnoguchi/arch-on-air that referenced this issue Mar 16, 2022
as explained in the following post:

bpftrace/bpftrace#1855

It's almost a year ago...
@ILXR
Copy link

ILXR commented May 26, 2022

Thanks very much! It saved me.

@Rtoax
Copy link
Contributor

Rtoax commented May 26, 2022

Thanks very much! It saved me.

Are you dnf up on centos stream9?

@ILXR
Copy link

ILXR commented May 26, 2022

Thanks very much! It saved me.

Are you dnf up on centos stream9?

No, I use apt on Ubuntu 20

@liutingjieni
Copy link
Contributor

I also encountered this problem when compiling bpftrace after reinstalling bcc. My solution is to delete the build directory of bpftrace and recompile (cmake, make, make install)

@haomi123
Copy link

The bcc with -DENABLE_LLVM_SHARED=1 doesn't solve my problem

: CommandLine Error: Option 'filter' registered more than once!
LLVM ERROR: inconsistency in registered CommandLine options

@NirLevy98
Copy link

The bcc with -DENABLE_LLVM_SHARED=1 doesn't solve my problem

: CommandLine Error: Option 'help-list' registered more than once!

@matthew-olson-intel
Copy link
Contributor

Using Arch with LLVM version:

$ llvm-config --version
14.0.6

Recompiling bcc with -DENABLE_LLVM_SHARED=1 fixed it for me, as well.

@hitzhangjie
Copy link

llvm 17, -DENABLE_LLVM_SHARED=1 not working

@marcosdotps
Copy link

Ubuntu 22.04:

$ llvm-config --version
14.0.0

Recompiling with -DENABLE_LLVM_SHARED=1 has not fixed the problem for me 🤔

@danobi
Copy link
Member

danobi commented Mar 11, 2024

To be clear, -DENABLE_LLVM_SHARED=1 is intended for bcc, not bpftrace.

For development builds, we now suggest folks use nix: https://github.com/bpftrace/bpftrace/blob/master/docs/nix.md . Obviously you don't have to, but keep in mind our bandwidth for debugging build issues outside of nix is pretty limited.

@SergioJun
Copy link

Ubuntu2204, llvm 14.0.0

I built bcc master branch with -DENABLE_LLVM_SHARED=1 following https://github.com/iovisor/bcc/blob/master/INSTALL.md#install-and-compile-bcc-1 , bcc can work.

bpftrace is installed by sudo apt-get install -y bpftrace, but still got the below error

: CommandLine Error: Option 'help-list' registered more than once!
LLVM ERROR: inconsistency in registered CommandLine options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Issues or PRs related to bpftrace building docs Issues related to bpftrace documentation, man page, --help message, and error/warning messages.
Projects
None yet
Development

No branches or pull requests