[llvm-dev] [LLVMdev] Ideas for making llvm-config --cxxflags more useful
David Chisnall via llvm-dev
llvm-dev at lists.llvm.org
Thu Aug 6 12:04:21 PDT 2015
[Ooops, sent to the old list address by mistake]
On 30 Jul 2015, at 21:04, tom at stellard.net wrote:
> For flags like -fno-rtti (are there others?) that are required in some cases
> (I think -fno-rtti is required only if you sub-class LLVM objects), I would propose
> adding a separate flag like --uses-rtti. This would give users more fine-grained
> control over which flags they use, and also would let them choose the correct
> flag since, for example, -fno-rtti is not understood by MSVC.
There appears to be a regression in LLVM 3.7, which means that you must compile with -fno-rtti if you include llvm’s Instructions.h. The issue is that a few of the classes (ICmpInst, GetElementPtrInst and PHINode) are now defined entirely in the header, so every compilation unit that includes the header will emit them. These classes all inherit from Instruction (indirectly via CmpInst in the case of ICmpInst) and so fail to link if compiled with -fno-rtti, because they can’t find the vtable for ICmpInst.
It would be nice to see this fixed before 3.7 is pushed out, but if it isn’t then we will still need to keep it in mind for llvm-config.
More information about the llvm-dev