我在Linux上构建了我的pass,并且它可以正常工作。现在当我把我的代码带到Mac Airbook上的Mac OS X 10.9时,它就不能正常工作了。下面我描述了构建我的llvm pass所采取的步骤。
我的源树是llvm-3.4和llv-3.4/tools/clang-3.4。
我运行了
然后我运行了
我导出了bin路径
现在当我尝试加载hello pass
我的源树是llvm-3.4和llv-3.4/tools/clang-3.4。
我运行了
./configure --prefix=/some-path --enable-targets=host
,这是成功的。然后我运行了
make && make install
,没有出现任何错误。我导出了bin路径
export PATH=/some-path/bin:$path
并检查了which clang
which opt
,它们指向了我的安装位置。现在当我尝试加载hello pass
opt -load /some-path/lib/LLVMHello.dylib -hello <fac.bc >/dev/null
时,我收到以下错误:
Error opening '/some-path/lib/LLVMHello.dylib': dlopen(/some-path/lib/LLVMHello.dylib, 9): Symbol not found: __ZN4llvm12FunctionPass17assignPassManagerERNS_7PMStackENS_15PassManagerTypeE
Referenced from: /some-path/lib/LLVMHello.dylib
Expected in: flat namespace
in /some-path/lib/LLVMHello.dylib
-load request ignored.
opt: Unknown command line argument '-hello'. Try: '/some-path/bin/opt -help'
opt: Did you mean '-help'?
有人能帮我解决这个问题或者至少指引我正确的方向吗?