meson: Allow mismatching RTTI for MSVC

This might be safe to relax to all Windows compilers, but I didn't
test Clang or MinGW, so scoping to MSVC for now. For MSVC, this is
safe to mismatch, because the vftables are emitted into all objects
with "pick largest," and the definition with RTTI is larger than the
one without. This is different than the Itanium ABI, which only emits
one copy of the typeinfo in the object which defines the key method.

Acked-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13064>
This commit is contained in:
Jesse Natalie 2021-09-27 07:24:16 -07:00 committed by Marge Bot
parent ad86267412
commit f9a46ad22a

View file

@ -1734,9 +1734,11 @@ if with_llvm
error('SWR requires LLVM draw support.') error('SWR requires LLVM draw support.')
endif endif
if cc.get_id() != 'msvc'
# LLVM can be built without rtti, turning off rtti changes the ABI of C++ # LLVM can be built without rtti, turning off rtti changes the ABI of C++
# programs, so we need to build all C++ code in mesa without rtti as well to # programs, so we need to build all C++ code in mesa without rtti as well to
# ensure that linking works. # ensure that linking works. Note that MSVC does handle mismatching RTTI
# without issues, so only apply this for other compilers.
# #
# In meson 0.51.0 we can use cmake to find LLVM in addittion to meson's # In meson 0.51.0 we can use cmake to find LLVM in addittion to meson's
# builtin llvm-config based finder. A new generic variable getter method # builtin llvm-config based finder. A new generic variable getter method
@ -1754,8 +1756,7 @@ if with_llvm
error('LLVM was built without RTTI, so Mesa must also disable RTTI. Use an LLVM built with LLVM_ENABLE_RTTI or add cpp_rtti=false.') error('LLVM was built without RTTI, so Mesa must also disable RTTI. Use an LLVM built with LLVM_ENABLE_RTTI or add cpp_rtti=false.')
endif endif
endif endif
else
if cc.get_id() == 'msvc'
# Suppress "/DELAYLOAD:ole32.dll/shell32.dll ignored" warnings that LLVM adds # Suppress "/DELAYLOAD:ole32.dll/shell32.dll ignored" warnings that LLVM adds
add_project_link_arguments( add_project_link_arguments(
'/ignore:4199', '/ignore:4199',