我在Linux上构建了通行证,并且在那儿可以正常工作。现在,当我将代码导入Mac Airbook上的Mac OS X 10.9时,它不再起作用。我在下面描述构建llvm传递所采取的步骤。
我的源代码树是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'?
有人可以帮助我解决此问题,或者至少指出正确的方向。
就我而言,缺少动态加载的通行证所需的动态LLVM库。我通过使用--enable-shared配置LLVM解决了该问题。我还设置了--enable-keep-symbols,但我认为这不是必需的。我使用的完整配置命令:
./configure --enable-shared --enable-keep-symbols
我知道我的答案有点晚了,但是最近我遇到了同样的问题。而且由于我花了很多时间解决问题,所以我想转告我的发现。希望能帮助到你。
干杯,马库斯
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句