Hello there,
I try to develop llvm pass under OSX, but it won’t work.
I (mostly) follow the tutorial at http://llvm.org/docs/CMake.html
When I try to produce the Makefile for my pass with cmake, I get this message:
…
-- HelloPass ignored -- Loadable modules not supported on this platform.
…
This is my CMakeList.txt of my pass:
—
cmake_minimum_required(VERSION 2.8)
find_package(LLVM REQUIRED CONFIG)
list(APPEND CMAKE_MODULE_PATH "${LLVM_CMAKE_DIR}")
include(AddLLVM)
message(STATUS "Found LLVM ${LLVM_PACKAGE_VERSION}")
message(STATUS "Using LLVMConfig.cmake in: ${LLVM_DIR}")
add_definitions(${LLVM_DEFINITIONS})
include_directories(${LLVM_INCLUDE_DIRS})
add_llvm_loadable_module(HelloPass
HelloPass.cpp)
—
Did I forget something??
Cheers,
Willy
PS:
My installation of llvm is a fresh install from “release_36“ svn branch.
make check logs:
Testing Time: 283.81s
********************
Failing Tests (4):
LLVM :: Transforms/LoopUnroll/unroll-pragmas.ll
LLVM :: Transforms/SLPVectorizer/X86/ordering.ll
LLVM :: Transforms/SLPVectorizer/X86/phi.ll
LLVM :: Transforms/SLPVectorizer/X86/phi3.ll
Expected Passes : 12174
Expected Failures : 92
Unsupported Tests : 55
Unexpected Failures: 4
make[3]: *** [test/CMakeFiles/check-llvm] Error 1
make[2]: *** [test/CMakeFiles/check-llvm.dir/all] Error 2
make[1]: *** [test/CMakeFiles/check.dir/rule] Error 2
make: *** [check] Error 2
and the hello pass example in llvm source is working correctly
On 2 May 2015 at 07:31, Willy WOLFF <willy.mh.wolff at gmail.com> wrote:> include(AddLLVM)This is including a CMake file from, which depends on (in this case) LLVM_ENABLE_PLUGINS being defined from HandleLLVMOptions.cmake. Probably other things too, I don't know enough about LLVM's CMake build system to say what the preferred or most likely to work solution is, but a couple of ideas are: 1. include(HandleLLVMOptions) 2. Add LLVM_ENABLE_PLUGINS to cmake/modules/LLVMConfig.cmake.in and rebuild LLVM 3.6, then try again. 3. Hacky substitute for 2: just define LLVM_ENABLE_PLUGINS yourself before include(AddLLVM). 1 might fail if HandleLLVMOptions depends on other variables being defined (seems likely), the 2 & 3 might fail if AddLLVM depends on other variables being defined (also seems likely). Tim.