I modified a bitcode enabled IPA using the open source LLVM toolchain's opt and ran my own LLVM pass on the bitcode files.
After modifications, I tried to use Apple's LLVM toolchain's clang to rebuild the bitcode files to get the binary but I got the following error
ld: Invalid record (Producer: 'LLVM13.0.0' Reader: 'LLVM APPLE_1_1300.0.29.30_0') for architecture arm64
So it seems I cannot mix and match the tools from the two toolchains? I read online that it was possible to use clang to run an LLVM Pass (compiled as dylib) directly so I tried to do that with Apple's clang but the LLVM Pass did not seem to run and the output from Apple's clang did not mention if the LLVM Pass was successful.
What is the proper command line to use for clang if I want it to run my LLVM Pass for optimization? I am using the new LLVM Pass Manager when writing the code for the LLVM Pass (dylib).