Monday, April 30, 2012

Writing an LLVM Pass

i'm trying to create an LLVM pass using the guide at http://llvm.org/releases/2.9/docs/WritingAnLLVMPass.html

but i'm having several problems:




  • i haven't many of the folder that are indicated into the guide (lib/Transform/Hello) and (Debug+Asserts), i have created them, is it right? what's the right path?
    i create these: /usr/lib/llvm-2.9/lib/Transforms/Hello and /usr/lib/llvm-2.9/Debug+Asserts


  • when i try to make the file in the guide i have error:




.



# Makefile for hello pass


# Path to top level of LLVM heirarchy
LEVEL = /usr/lib/llvm-2.9/build #*********I MODIFY THIS!!!! ***************

# Name of the library to build
LIBRARYNAME = Hello

# Make the shared library become a loadable module so the tools can
# dlopen/dlsym on the resulting library.
LOADABLE_MODULE = 1

# Tell the build system which LLVM libraries your pass needs. You'll probably
# need at least LLVMSystem.a, LLVMSupport.a, LLVMCore.a but possibly several
# others too.
LLVMLIBS = LLVMCore.a LLVMSupport.a LLVMSystem.a

# Include the makefile implementation stuff
include $(LEVEL)/Makefile.common


and i modify also other lines into Makefile.common:



ifndef LLVM_SRC_ROOT
include $(LEVEL)/Makefile.rules
else
include $(LLVM_SRC_ROOT)/Makefile.rules
endif


because it doesn't find the Makefile.rules (in this way it works)



but now i have this error when i do make into the folder containing my hello.c file (/usr/lib/llvm-2.9/lib/Transforms/Hello):



make: ***  No rule to make target "/configure", needed by "/config.status".  Stop.


what's the problem?!?





No comments:

Post a Comment