Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Plugin support removed

29 views
Skip to first unread message

matt...@gmail.com

unread,
Mar 11, 2020, 1:16:37 AM3/11/20
to Clang maintainers
I've been trying to follow the instructions here: https://chromium.googlesource.com/chromium/src/+/master/docs/writing_clang_plugins.md

But I'm running into the following error:

error: unable to load plugin '../../_test/tools/llvm-project/build/lib/PrintFunctionNames.dylib': 'dlopen(../../_test/tools/llvm-project/build/lib/PrintFunctionNames.dylib, 9): Symbol not found: __ZN5clang11ASTConsumer21HandleInterestingDeclENS_12DeclGroupRefE
  Referenced from: ../../_test/tools/llvm-project/build/lib/PrintFunctionNames.dylib
  Expected in: flat namespace
 in ../../_test/tools/llvm-project/build/lib/PrintFunctionNames.dylib'


After reading through the build script I found the line -DCLANG_PLUGIN_SUPPORT=OFF which I assume creates a binary that won't allow `-Xclang -load`?

Is this assumption correct, and how can I move forward with writing a custom plugin? This is for an experiment, not something intended to be committed.

Thanks!

Daniel Cheng

unread,
Mar 11, 2020, 3:09:26 AM3/11/20
to matt...@gmail.com, Clang maintainers
We build the plugins directly into clang now, so we don't need the capability to dynamically load plugins. See https://chromium.googlesource.com/chromium/src/+/25a9c5ec90f0bc3df2fdc827d5b36b83bc8520de and the associated bugs for more details.

Daniel

Daniel Cheng

unread,
Mar 11, 2020, 3:14:04 AM3/11/20
to matt...@gmail.com, Clang maintainers
Oh, sorry for forgetting to answer the second part of your question: if you'd like to write a clang plugin for experimenting, I'd probably just copy //tools/clang/plugins as a starting point. The documentation page you linked to is likely very out of date at this point, but you'll probably want to run tools/clang/plugins/build.py, passing in the new subdirectory as an argument to --extra-tools.

Daniel
Reply all
Reply to author
Forward
0 new messages