[LLVMdev] Unwinds Gone Wild

Duncan Sands baldrick at free.fr
Tue Sep 30 01:09:06 PDT 2008


Hi,

> On Mon, Sep 29, 2008 at 9:01 AM, Duncan Sands <baldrick at free.fr> wrote:
> > libgcc is also available for windows.
> Really?  What license?  What restrictions?

search for MinGW and Cygwin.  See http://gcc.gnu.org
and http://www.gnu.org for licensing information.

> Any speed impact over the VC runtimes?

I think you are misunderstanding.  For certain
operations, eg 64 bit multiplication on a 32 bit
machine, exception handling, a bunch of others,
llvm emits calls to routines that only exist in
the gcc library.  It does this on windows too!
It does not touch calls made directly by programs,
which in general will be to routines in some
system or VC runtime libraries or whatever.  As
such it is not replacing the VC runtime, it is
enhancing it (maybe pointlessly, if the VC runtime
contains appropriate routines).

There are two main strategies to change this:
(1) create a libllvm, and call the routines in
libllvm instead.  This basically just duplicates
libgcc, adding a maintenance burden without any
great advantage.  This is what I was talking about.

(2) teach llvm to output calls to a range of libraries,
eg windows system libraries, VC runtime etc.  This
sound more worth doing.  It should be easy enough
for 64 bit arithmetic if there are standard routines
for doing that.  However, exception handling (eh) is
harder: on windows eh is SEH (structured exception
handling) which is different to the dwarf eh which
llvm currently targets.  Porting llvm to SEH seems
possible (I have yet another plan for this!) but
would take some time and effort.

Ciao,

Duncan.

PS: Please don't reply to me privately: I prefer it
if the mailing list is CC'd.  That way others can
reply too, and it's archived for the benefit of all
mankind!



More information about the llvm-dev mailing list