meson build error
In file included from ../src/util/bitscan.h:32:0,
../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’:
../src/gallium/drivers/nouveau/codegen/nv50_ir.cpp:749:19: error: cannot use typeid with -fno-rtti
assert(typeid(*i) == typeid(*this));
You've either added -no-rtti or are using llvm built without rtti. I can make this a hard error.
(In reply to Dylan Baker from comment #1)
> You've either added -no-rtti or are using llvm built without rtti. I can
> make this a hard error.
Out of curiosity, how does the autotools build deal with this?
Also, I think that this only comes up in one assert in nouveau, so when asserts are disabled (e.g. release builds), it wouldn't bring up a compile error.
It would also be fine to add a #ifdef rtti + #warning or something (does one know in the source if rtti is enabled somehow?).
I don't think that the compiler gives you any way to know, we'd have to pass some a #define ourselves.
autotools just adds it to LLVM targets (radeonsi, llvmpipe, etc). That feels really dangerous to me though, as building with/without rtti changes the ABI and my understanding is that there's no requirement for code with rtti to correctly link with code not using rtti.
Marking as FIXED since Dylan made it a meson error to do this:
Author: Dylan Baker <firstname.lastname@example.org>
Date: Mon Dec 31 19:23:52 2018 -0800
meson: Error out if building nouveau and using LLVM without rtti
Nouveau requires rtti. Often LLVM is configured without rtti, and code
with and without cannot be linked safely. Lets just error out if nouveau
is requested and llvm is built without rtti.
("meson: fix builds against LLVM built without rtti")
Reviewed-by: Bas Nieuwenhuizen <email@example.com>