I'm running current and I need llvm to be built with rtti. This is disabled upstream but the packaging advice is that it should be made available with rtti. The standard instructions for this are to set REQUIRES_RTTI=1 in the build environment. But the packaged version doesn't correctly build despite this assignment being provided in MAKE_ENV in the Makefile for the OpenBSD lllvm port.
I still haven't got to the bottom of the question of why the build compiles some code with -fno-rtti, but I've found the build code that does this. It's controlled by another environment variable, LLVM_REQUIRES_RTTI=1, but setting that in the build environment doesn't seem to help. Something is missing. Here's a patch to comment out the offending build code and make the port build clean. It's the best I can do for now. I think this really needs the attention of somebody who understands cmake. $OpenBSD$ --- cmake/modules/LLVMProcessSources.cmake.orig Wed May 11 14:53:08 2011 +++ cmake/modules/LLVMProcessSources.cmake Tue Sep 4 22:54:36 2012 @@ -63,13 +63,13 @@ function(llvm_process_sources OUT_VAR) add_definitions( /D_HAS_EXCEPTIONS=0 ) endif() endif() - 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() + #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() set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}" PARENT_SCOPE ) set( ${OUT_VAR} ${sources} PARENT_SCOPE )