CommandLine Error: Option 'enable-objc-arc-opts' registered more than once!


I am currently affected by this issue (using trunk)
$ lldb-3.7
: CommandLine Error: Option 'enable-objc-arc-opts' registered more than
LLVM ERROR: inconsistency in registered CommandLine options

Does it ring a bell?


I have seen this error after linking llvm libraries into Polly and then loading polly into clang. Having the same library linked twice yields two global constructors, which both try to register this command line string. The second registration fails.


I also have such error, and I fix it by hacking the build of the program
that uses llvm, by adding -Wl,--as-needed.
And it could help you too, since in most cases programs that linked with
llvm didn't need all llvm shared libraries.

Of course, the proper fix will be to link lldb only libraries that it
uses from llvm (and in case lldb will use library with that global
options I guess that it will be better to split global options out from
common library into separate one).