LLVM Pass for iOS

I am trying to create an LLVM Pass for iOS and add it to XCODE compilation by setting Other C Flags to "-Xclang -load -Xclang myPass.so". However, at the compilation I got the following error:
Code Block
error: unable to load plugin 'libSkeletonPass.so': 'dlopen(libSkeletonPass.so, 9):
Symbol not found: __ZN4llvm24DisableABIBreakingChecksE
Referenced from:libSkeletonPass.so
Expected in: flat namespace
in /libSkeletonPass.so'
Command CompileC failed with a nonzero exit code


Is there any special way for creating an LLVM Pass for iOS? Any idea how I could add the missing reference?

Replies

The LLVM/clang compiler and Swift compiler provided with Xcode are configured not to load plug-ins for security.
Thanks for the reply. How else can one apply obfuscation at the compilation time?
You should be able to apply an LLVM pass directly to bitcode (or IR) using LLVM's opt tool.

Then after running it through the pass, feed the bitcode into clang for compiling/assembling/linking.
One option would be to obfuscate the embedded bitcode. There is the open-source obfuscator-llvm (which hasn't been updated for a long time).
There's a question involving the same symbol at https://developer.apple.com/forums/thread/121260. From one of the answers there:

Yeah one of the LLVM headers (api-breaking.h) had an extern int that was apparently coming from the linkage to the runtime. We replaced that with a local variable and the review process is fine now. Thanks! @cjserio

The file is abi-breaking.h rather than api-breaking.h though. You may be able to progress further by doing the same thing but you might then run into the issues Developer Tools Engineer is referring to.