Hurray! It works now. For anyone curious, I am using LLVM 3.2 (svn, tags/release 3.2). If this is a bug, it may have been fixed since then.
The infrastructure is there in the llvm cmake modules, but the command that adds the "-fno-rtti" flag is skipped over. In LLVMProcessSources.cmake,
if( NOT LLVM_REQUIRES_RTTI )
if( LLVM_COMPILER_IS_GCC_COMPATIBLE )
llvm_replace_compiler_option(CMAKE_CXX_FLAGS "-frtti" "-fno-rtti")
elseif( MSVC )
llvm_replace_compiler_option(CMAKE_CXX_FLAGS "/GR" "/GR-")
endif()
endif()
is skipped because my config has LLVM_COMPILER_IS_GCC_COMPATIBLE unset when I try to build out of source. However, I confirmed that this -is- set when I run a fresh cmake configuration. (I confirmed that I'm not accidentally using the original cmake modules
in the src directory.)
Also, in case anyone has a similar problem as mine (I noticed a few online), I found it helpful to build llvm with autotools, and then build the pass with VERBOSE=1 so I could see the compiler flags, and try a manual build until it worked.