Hi, I'm writing a front-end for llvm with java. my front-end produces .ll files. Then I use the following commands to convert these files to an executable file: !. for each .ll file I use 'llvm-as file.ll' to create a bitcode file 2. use 'llvm-ld -o executable my-bitcode-files -L/usr/lib/i386-linux-gnu -lstdc++' to generate an executable file then when I run the executable file, I get the following error: LLVM ERROR: Program used external function '_Znwm' which could not be resolved! what should I do to resolve this issue? Any help would be appreciated -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130112/8545476b/attachment.html>
Hi Ali, > I'm writing a front-end for llvm with java. my front-end produces .ll files.> Then I use the following commands to convert these files to an executable file: > !. for each .ll file I use 'llvm-as file.ll' to create a bitcode file > 2. use 'llvm-ld -o executable my-bitcode-files -L/usr/lib/i386-linux-gnu > -lstdc++' to generate an executable fileadd -native otherwise it doesn't create a real executable, only a wrapper script around the linked bitcode.> then when I run the executable file, I get the following error: > > LLVM ERROR: Program used external function '_Znwm' which could not be resolved! > > what should I do to resolve this issue?An alternative is to use llc to compile each .ll into a .s file, then do: gcc -o executable all-the-.s-files -L/usr/lib/i386-linux-gnu -lstdc++ You could instead use an LLVM aware linker (eg the gold plugin) if you want link time optimization. Ciao, Duncan.
Apparently Analagous Threads
- [LLVMdev] generating executable file from .ll files
- [LLVMdev] linking llvm libraries with bitcode files
- [LLVMdev] [RFC]Extending lib/Linker to support bitcode "shared objects"
- [LLVMdev] [RFC]Extending lib/Linker to support bitcode "shared objects"
- [LLVMdev] [RFC]Extending lib/Linker to support bitcode "shared objects"