[LLVMdev] statically linked passes

Theresia Hansson theresia.hansson at gmail.com
Thu Oct 21 00:45:30 PDT 2010


Hi,

I am trying to create a pass that should get statically linked into
opt (since I'm on both mac and native win32 and win32 does not support
LOADED_MODULEs, at least I get errors while trying to create one).

So I have it working with CMake on windows but when I try to run the
same code base on mac I get unresolved externals. Here is what I have
done so far in the build system:

Within lib/Transforms/MyPass I have:

Makefile:
LEVEL = ../../..
LIBRARYNAME = LLVMMyPass
BUILD_ARCHIVE = 1
include $(LEVEL)/Makefile.common

CMakeLists.txt
add_llvm_library(LLVMMyPass MyPass.cpp)

And within the Transforms directory I added my directory to the list
of PARALLEL_DIRS within the Makefile there.

In the root llvm directory's CMakeLists.txt I added a call to
add_subdirectory(lib/Transforms/MyPass)

And I added create functions to LinkAllPasses.h.

Now when I build visual studio projects with cmake I have to manually
set up dependencies in the generated projects. But I though, fine.

But when running configure + make on mac the dependencies are missing.

So to my big question: Where do I set up dependencies? I tried
searching and searching for the other libraries to see how they'd done
it, but didn't find anything...



More information about the llvm-dev mailing list