[LLVMdev] LLVM out of source pass build: Loadable modules not supported (on Linux)
Alexander Poddey
alexander.poddey at gmx.net
Mon Jan 12 23:03:25 PST 2015
Hi all,
I compiled and installed LLVM from trunk on debian wheezy some weeks ago
(configure & make) and now tried to out of source compile an opt pass
following the cmake out of source pass build instructions from the docu.
When trying to build (cMakeLists appended below)
mkdir build
cd build
cmake -DCMAKE_MODULE_PATH=/usr/local/share/llvm/cmake ../
I get:
-- MyOutOfSourcePass ignored -- Loadable modules not supported on this
platform.
hmm? opt and the loadable passes (at
llvm_trunk/build/Debug+Asserts/lib/xxx.so) are present and work (have been
compiled using configure & make, not cmake).
Any idea? Thx Alex
P.S.:
My questions are user questions and it seems to me the dev list is not
appropriate. Please point me to the correct place if you feel the same and
know where to discuss llvm user questions! Thx!
====================================
APPENDIX
====================================
Dir structure:
project
| MypassDir
project-dir's CMakeLists.txt:
====================================
# following http://llvm.org/docs/CMake.html and llvm-mutate's cmake files
cmake_minimum_required(VERSION 2.8)
set(CMAKE_C_FLAGS "-fPIC") #position independent code genration
set(CMAKE_CXX_FLAGS "-fPIC -Wno-c++11-extensions")
find_package(LLVM REQUIRED CONFIG)
# to be able to merge into LLVM source tree later on
list(APPEND CMAKE_MODULE_PATH "${LLVM_CMAKE_DIR}")
include(AddLLVM)
add_definitions(${LLVM_DEFINITIONS})
include_directories(${LLVM_INCLUDE_DIRS})
link_directories(${LLVM_LIBRARY_DIRS}) #not present in llvm example
add_subdirectory(MypassDir)
Mypass dir's CMakeLists.txt:
====================================
add_llvm_loadable_module(MyPass
MyPass.cpp
)
More information about the llvm-dev
mailing list