Skip to content

Commit

Permalink
Do not list LLVM_LIBS in the target_link_libraries.
Browse files Browse the repository at this point in the history
When using various prepackaged versions of LLVM 6.0, I was seeing fatal
errors like this when I ran `clang_delta`:

```
$ clang_delta --help
: CommandLine Error: Option 'disable-symbolication' registered more than once!
LLVM ERROR: inconsistency in registered CommandLine options
```

In some way that I do not understand, removing `LLVM_LIBS` from the call
to `target_link_libraries` seems to avoid this problem.  The LLVM
libraries end up in the link line anyway, also for reasons that I do not
understand.

Did I mention that I do not understand the current LLVM CMake magic?
  • Loading branch information
eeide committed Jun 25, 2018
1 parent 3e9e455 commit b5da960
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion clang_delta/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,11 @@ add_executable(clang_delta
git_version.h
)

target_link_libraries(clang_delta ${CLANG_LIBS} ${LLVM_LIBS})
# ENE, LLVM 6.0: LLVM_LIBS end up in the link command line anyway. I'm not
# quite sure why! But if you list LLVM_LIBS here, the `clang_delta' binary
# can end up with dynamic link errors when it runs (multiply defined symbols).
#
target_link_libraries(clang_delta ${CLANG_LIBS})

# Custom target for running clang_delta tests
#
Expand Down

0 comments on commit b5da960

Please sign in to comment.