[Mesa-dev] [PATCH] build: remove forced -fno-rtti
Alexander von Gluck IV
kallisti5 at unixzen.com
Thu Oct 17 18:43:08 CEST 2013
On Thu, 17 Oct 2013 18:11:07 +0200
Johannes Obermayr <johannesobermayr at gmx.de> wrote:
>
> Simply make llvm devs to push this fix to all branches (again my words: "Sth. like [...]):
Yeah, I can't make anyone do anything... you have to ask them nicely.
> diff --git a/tools/llvm-config/CMakeLists.txt b/tools/llvm-config/CMakeLists.txt
> index c651833..da90a67 100644
> --- a/tools/llvm-config/CMakeLists.txt
> +++ b/tools/llvm-config/CMakeLists.txt
> @@ -1,3 +1,5 @@
> +include(LLVMProcessSources)
> +
> set(LLVM_LINK_COMPONENTS support)
>
> set(BUILDVARIABLES_SRCPATH ${CMAKE_CURRENT_SOURCE_DIR}/BuildVariables.inc.in)
> @@ -20,6 +22,21 @@ set(LLVM_LDFLAGS ${CMAKE_SHARED_LINKER_FLAGS})
> set(LLVM_BUILDMODE ${CMAKE_BUILD_TYPE})
> set(LLVM_SYSTEM_LIBS ${SYSTEM_LIBS})
> string(REPLACE ";" " " LLVM_TARGETS_BUILT "${LLVM_TARGETS_TO_BUILD}")
> +
> +# Set common compiler options:
> +if( NOT LLVM_REQUIRES_EH )
> + if( MSVC )
> + llvm_replace_compiler_option(LLVM_CXXFLAGS "/EHsc" "/EHs-c-")
> + endif()
> +endif()
> +if( NOT LLVM_REQUIRES_RTTI )
> + if( LLVM_COMPILER_IS_GCC_COMPATIBLE )
> + llvm_replace_compiler_option(LLVM_CXXFLAGS "-frtti" "-fno-rtti")
> + elseif( MSVC )
> + llvm_replace_compiler_option(LLVM_CXXFLAGS "/GR" "/GR-")
> + endif()
> +endif()
> +
> configure_file(${BUILDVARIABLES_SRCPATH} ${BUILDVARIABLES_OBJPATH} @ONLY)
>
> # Add the llvm-config tool.
>
>
> The result is LLVM_CXXFLAGS contain "-fno-rtti" in tools/llvm-config/BuildVariables.inc which is used in tools/llvm-config/llvm-config.cpp:
> #define LLVM_CXXFLAGS "-fomit-frame-pointer -fmessage-length=0 -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -g -fPIC -fvisibility-inlines-hidden -Wall -W -Wno-unused-parameter -Wwrite-strings -Wno-missing-field-initializers -pedantic -Wno-long-long -Wno-maybe-uninitialized -Wnon-virtual-dtor -O2 -g -DNDEBUG -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -fno-rtti"
Great, you should submit that fix to the llvm bug mentioned earlier.
http://llvm.org/bugs/show_bug.cgi?id=14200
More information about the mesa-dev
mailing list