This is an archive of the discontinued LLVM Phabricator instance.

[llvm] Disable linking llvm-exegesis to dylib
ClosedPublic

Authored by mgorny on Jun 16 2020, 3:35 AM.

Details

Summary

Force linking llvm-exegesis to static LLVM libraries instead of dylib
to prevent duplicate symbols due to linking both. Ideally, we'd want
to link to the dylib only here but the target sub-libraries use hidden
symbols from LLVM target libraries and therefore linking the dylib
fails.

Diff Detail

Event Timeline

mgorny created this revision.Jun 16 2020, 3:35 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 16 2020, 3:35 AM
Herald added a subscriber: mstojanovic. · View Herald Transcript
courbet accepted this revision.Jun 16 2020, 3:54 AM
This revision is now accepted and ready to land.Jun 16 2020, 3:54 AM
MaskRay accepted this revision.Jun 16 2020, 7:47 AM

Can you please add some messages about duplicate symbols?

Can you please add some messages about duplicate symbols?

I don't understand what you mean. If you're asking for something that actually fails due to linking both copies of the library, I haven't seen one with llvm-exegesis. I did have problems with clangd, so I'm trying to correct linkage everywhere.

This revision was automatically updated to reflect the committed changes.

Can you please add some messages about duplicate symbols?

When linking with libpfm (set -DLLVM_ENABLE_LIBPFM=ON when configuring), I get an error without this change:

> llvm-exegesis --help
: CommandLine Error: Option 'x86-use-base-pointer' registered more than once!
LLVM ERROR: inconsistency in registered CommandLine options
Aborted (core dumped)

When not linking with libpfm, I can't reliably reproduce it. The functionality of llvm-exegesis is reduced then, and it probably doesn't use any target internals, or at least not enough to cause a problem.