How to write llvm pass on Mac OS X 10.9

I built my pass on Linux and it worked there correctly. Now that I have brought my code in Mac OS X 10.9 on a Mac Airbook, it no longer works. I describe below the steps I took to create my llvm-pass.

My source tree is llvm-3.4 and llv-3.4 / tools / clang-3.4

I ran ./configure --prefix=/some-path --enable-targets=host, which was successful.

Then I started make && make install, which ended without errors.

I exported the bin path export PATH=/some-path/bin:$pathand marked for which clang which opt, and they pointed to my installation.

Now, when I tried to load hello pass opt -load /some-path/lib/LLVMHello.dylib -hello <fac.bc >/dev/null, I get the following error

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'?

Can someone help me fix this problem or at least point in the right direction.

+4
1

LLVM, . , LLVM --enable-shared. -enable-keep-symbols, , . configure, :

./configure --enable-shared --enable-keep-symbols

, , . , . , .

,

+1

All Articles