Skip to content

Linking problem with LLVM libraries #57

@ddcc

Description

@ddcc

On a Ubuntu 18.04 machine using Clang/LLVM provided by the package repositories (sudo apt-get install libclang-8-dev), I am able to build Phasar successfully (LLVM_DIR=/usr/lib/llvm-8 CC=clang-8 CXX=clang++-8 cmake ..), but get the following error at runtime:

./phasar
: CommandLine Error: Option 'verify-dom-info' registered more than once!
LLVM ERROR: inconsistency in registered CommandLine options

It looks like the problem is that Phasar links statically against the LLVM components from the repository package, for each of Phasar's plugin libraries. I've managed to fix this locally with a hacky commit that forces shared linking, but an actual fix would probably need to check the build and set some variables/dependencies accordingly: ddcc@7f63698

This doesn't seem to be an uncommon problem when linking with Clang/LLVM, here are some related discussions:
ziglang/zig#67
AnyDSL/impala#63
CastXML/CastXML#102

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions