Bug 106391 - Noveau fails to compile when using meson and LLVM without RTTI
Summary: Noveau fails to compile when using meson and LLVM without RTTI
Status: RESOLVED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Drivers/DRI/nouveau (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Nouveau Project
QA Contact: Nouveau Project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-05-03 20:08 UTC by Rasmus Thomsen
Modified: 2019-02-14 22:19 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Rasmus Thomsen 2018-05-03 20:08:13 UTC
When building mesa without RTTI support nouveau fails to compile because NDBUG isn't defined by meson. src/gallium/drivers/nouveau/codegen/nv50_ir.cpp has the following snippet in it:

#ifndef NDEBUG // non-conformant assert, so this is required
  assert(typeid(*i) == typeid(*this));
#endif

which results in:

[1581/1667] x86_64-pc-linux-gnu-c++ -Isrc/gallium/drivers/nouveau/src@gallium@drivers@nouveau@@nouveau@sta -Isrc/gallium/drivers/nouveau -I../mesa-18.0.2/src/gallium/drivers/nouveau -Isrc -I../mesa-18.0.2/src -Iinclude -I../mesa-18.0.2/include -I../mesa-18.0.2/src/gallium/include -Isrc/gallium/auxiliary -I../mesa-18.0.2/src/gallium/auxiliary -I/usr/x86_64-pc-linux-gnu/include/libdrm -I/usr/x86_64-pc-linux-gnu/include/libdrm/nouveau -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wnon-virtual-dtor -std=c++11 -O2 -g -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS '-DVERSION="18.0.2"' -DPACKAGE_VERSION=VERSION '-DPACKAGE_BUGREPORT="https://bugs.freedesktop.org/enter_bug.cgi?product=Mesa"' -DTEXTURE_FLOAT_ENABLED -DGLX_USE_TLS -DHAVE_X11_PLATFORM -DGLX_INDIRECT_RENDERING -DGLX_DIRECT_RENDERING -DGLX_USE_DRM -DHAVE_DRM_PLATFORM -DHAVE_SURFACELESS_PLATFORM -DENABLE_SHADER_CACHE -DHAVE___BUILTIN_BSWAP32 -DHAVE___BUILTIN_BSWAP64 -DHAVE___BUILTIN_CLZ -DHAVE___BUILTIN_CLZLL -DHAVE___BUILTIN_CTZ -DHAVE___BUILTIN_EXPECT -DHAVE___BUILTIN_FFS -DHAVE___BUILTIN_FFSLL -DHAVE___BUILTIN_POPCOUNT -DHAVE___BUILTIN_POPCOUNTLL -DHAVE___BUILTIN_UNREACHABLE -DHAVE_FUNC_ATTRIBUTE_CONST -DHAVE_FUNC_ATTRIBUTE_FLATTEN -DHAVE_FUNC_ATTRIBUTE_MALLOC -DHAVE_FUNC_ATTRIBUTE_PURE -DHAVE_FUNC_ATTRIBUTE_UNUSED -DHAVE_FUNC_ATTRIBUTE_WARN_UNUSED_RESULT -DHAVE_FUNC_ATTRIBUTE_WEAK -DHAVE_FUNC_ATTRIBUTE_FORMAT -DHAVE_FUNC_ATTRIBUTE_PACKED -DHAVE_FUNC_ATTRIBUTE_RETURNS_NONNULL -DHAVE_FUNC_ATTRIBUTE_VISIBILITY -DHAVE_FUNC_ATTRIBUTE_ALIAS -DHAVE_FUNC_ATTRIBUTE_NORETURN -D_GNU_SOURCE -DUSE_SSE41 -DUSE_GCC_ATOMIC_BUILTINS -DUSE_X86_64_ASM -DMAJOR_IN_SYSMACROS -DHAVE_SYS_SYSCTL_H -DHAVE_LINUX_FUTEX_H -DHAVE_ENDIAN_H -DHAVE_STRTOF -DHAVE_MKOSTEMP -DHAVE_POSIX_MEMALIGN -DHAVE_TIMESPEC_GET -DHAVE_MEMFD_CREATE -DHAVE_STRTOD_L -DHAVE_DLADDR -DHAVE_DL_ITERATE_PHDR -DHAVE_LIBDRM -DHAVE_ZLIB -DHAVE_PTHREAD -DHAVE_LLVM=0x0500 -DMESA_LLVM_VERSION_PATCH=1 -DHAVE_WAYLAND_PLATFORM -DWL_HIDE_DEPRECATED -DHAVE_DRI3 -Wall -fno-math-errno -fno-trapping-math -Wno-non-virtual-dtor -fno-rtti -march=native -O2 -march=native -O2 -fPIC -fvisibility=hidden  -MD -MQ 'src/gallium/drivers/nouveau/src@gallium@drivers@nouveau@@nouveau@sta/codegen_nv50_ir.cpp.o' -MF 'src/gallium/drivers/nouveau/src@gallium@drivers@nouveau@@nouveau@sta/codegen_nv50_ir.cpp.o.d' -o 'src/gallium/drivers/nouveau/src@gallium@drivers@nouveau@@nouveau@sta/codegen_nv50_ir.cpp.o' -c ../mesa-18.0.2/src/gallium/drivers/nouveau/codegen/nv50_ir.cpp
FAILED: src/gallium/drivers/nouveau/src@gallium@drivers@nouveau@@nouveau@sta/codegen_nv50_ir.cpp.o 
x86_64-pc-linux-gnu-c++ -Isrc/gallium/drivers/nouveau/src@gallium@drivers@nouveau@@nouveau@sta -Isrc/gallium/drivers/nouveau -I../mesa-18.0.2/src/gallium/drivers/nouveau -Isrc -I../mesa-18.0.2/src -Iinclude -I../mesa-18.0.2/include -I../mesa-18.0.2/src/gallium/include -Isrc/gallium/auxiliary -I../mesa-18.0.2/src/gallium/auxiliary -I/usr/x86_64-pc-linux-gnu/include/libdrm -I/usr/x86_64-pc-linux-gnu/include/libdrm/nouveau -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wnon-virtual-dtor -std=c++11 -O2 -g -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS '-DVERSION="18.0.2"' -DPACKAGE_VERSION=VERSION '-DPACKAGE_BUGREPORT="https://bugs.freedesktop.org/enter_bug.cgi?product=Mesa"' -DTEXTURE_FLOAT_ENABLED -DGLX_USE_TLS -DHAVE_X11_PLATFORM -DGLX_INDIRECT_RENDERING -DGLX_DIRECT_RENDERING -DGLX_USE_DRM -DHAVE_DRM_PLATFORM -DHAVE_SURFACELESS_PLATFORM -DENABLE_SHADER_CACHE -DHAVE___BUILTIN_BSWAP32 -DHAVE___BUILTIN_BSWAP64 -DHAVE___BUILTIN_CLZ -DHAVE___BUILTIN_CLZLL -DHAVE___BUILTIN_CTZ -DHAVE___BUILTIN_EXPECT -DHAVE___BUILTIN_FFS -DHAVE___BUILTIN_FFSLL -DHAVE___BUILTIN_POPCOUNT -DHAVE___BUILTIN_POPCOUNTLL -DHAVE___BUILTIN_UNREACHABLE -DHAVE_FUNC_ATTRIBUTE_CONST -DHAVE_FUNC_ATTRIBUTE_FLATTEN -DHAVE_FUNC_ATTRIBUTE_MALLOC -DHAVE_FUNC_ATTRIBUTE_PURE -DHAVE_FUNC_ATTRIBUTE_UNUSED -DHAVE_FUNC_ATTRIBUTE_WARN_UNUSED_RESULT -DHAVE_FUNC_ATTRIBUTE_WEAK -DHAVE_FUNC_ATTRIBUTE_FORMAT -DHAVE_FUNC_ATTRIBUTE_PACKED -DHAVE_FUNC_ATTRIBUTE_RETURNS_NONNULL -DHAVE_FUNC_ATTRIBUTE_VISIBILITY -DHAVE_FUNC_ATTRIBUTE_ALIAS -DHAVE_FUNC_ATTRIBUTE_NORETURN -D_GNU_SOURCE -DUSE_SSE41 -DUSE_GCC_ATOMIC_BUILTINS -DUSE_X86_64_ASM -DMAJOR_IN_SYSMACROS -DHAVE_SYS_SYSCTL_H -DHAVE_LINUX_FUTEX_H -DHAVE_ENDIAN_H -DHAVE_STRTOF -DHAVE_MKOSTEMP -DHAVE_POSIX_MEMALIGN -DHAVE_TIMESPEC_GET -DHAVE_MEMFD_CREATE -DHAVE_STRTOD_L -DHAVE_DLADDR -DHAVE_DL_ITERATE_PHDR -DHAVE_LIBDRM -DHAVE_ZLIB -DHAVE_PTHREAD -DHAVE_LLVM=0x0500 -DMESA_LLVM_VERSION_PATCH=1 -DHAVE_WAYLAND_PLATFORM -DWL_HIDE_DEPRECATED -DHAVE_DRI3 -Wall -fno-math-errno -fno-trapping-math -Wno-non-virtual-dtor -fno-rtti -march=native -O2 -march=native -O2 -fPIC -fvisibility=hidden  -MD -MQ 'src/gallium/drivers/nouveau/src@gallium@drivers@nouveau@@nouveau@sta/codegen_nv50_ir.cpp.o' -MF 'src/gallium/drivers/nouveau/src@gallium@drivers@nouveau@@nouveau@sta/codegen_nv50_ir.cpp.o.d' -o 'src/gallium/drivers/nouveau/src@gallium@drivers@nouveau@@nouveau@sta/codegen_nv50_ir.cpp.o' -c ../mesa-18.0.2/src/gallium/drivers/nouveau/codegen/nv50_ir.cpp
In file included from ../mesa-18.0.2/src/util/bitscan.h:32:0,
                 from ../mesa-18.0.2/src/gallium/auxiliary/util/u_math.h:49,
                 from ../mesa-18.0.2/src/gallium/auxiliary/util/u_box.h:5,
                 from ../mesa-18.0.2/src/gallium/auxiliary/util/u_inlines.h:40,
                 from ../mesa-18.0.2/src/gallium/drivers/nouveau/codegen/nv50_ir_util.h:36,
                 from ../mesa-18.0.2/src/gallium/drivers/nouveau/codegen/nv50_ir.h:34,
                 from ../mesa-18.0.2/src/gallium/drivers/nouveau/codegen/nv50_ir.cpp:23:
../mesa-18.0.2/src/gallium/drivers/nouveau/codegen/nv50_ir.cpp: In member function 'virtual nv50_ir::Instruction* nv50_ir::Instruction::clone(nv50_ir::ClonePolicy<nv50_ir::Function>&, nv50_ir::Instruction*) const':
../mesa-18.0.2/src/gallium/drivers/nouveau/codegen/nv50_ir.cpp:740:19: error: cannot use typeid with -fno-rtti
    assert(typeid(*i) == typeid(*this));
                   ^
../mesa-18.0.2/src/gallium/drivers/nouveau/codegen/nv50_ir.cpp:740:33: error: cannot use typeid with -fno-rtti
    assert(typeid(*i) == typeid(*this));
                                 ^
Comment 1 Dylan Baker 2019-02-14 22:19:35 UTC
This should be fixed now, please re-open if it's not.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.