[LLVMdev] Exception handling with the LLVM makefile system

Sebastian Redl sebastian.redl at getdesigned.at
Mon May 16 08:11:54 PDT 2011


On 16.05.2011, at 08:44, Pablo Barrio wrote:

> Hi all,
> 
> I'm having trouble when trying to reuse some functions that use 
> Boost::Exception into my LLVM-based application. As far as I know, LLVM 
> turns off Exception handling (apparently for performance reasons), so I 
> get the following link-time error in a few places:
> 
> "undefined reference to `boost::throw_exception(std::exception const&)"
> 
> When I compile the external code from outside the LLVM Makefile system, 
> everything goes well. Is it possible to enable exception handling for 
> some parts of the compilation? Just like turning on RTTI with 
> "REQUIRES_RTTI=1" ? Removing exception handling from the functions is 
> not an option, since I would have to tweak the Boost library internals.

Whatever the LLVM side of things, boost::throw_exception is a function that you, the user, have to implement when disabling exceptions. It's basically the "I want to throw an exception, so what should I really do?" callback.

Sebastian



More information about the llvm-dev mailing list