3

i'm currently building a small JIT compiler. For the language I need a runtime library for some special math functions. I think the best would be to compile the lib to bitcode and link it. The compiler should be integrated in a product and as of this, it must work under windows (VC10, 64bit).

So is it possible to build the math lib with the mingw llvm-gcc build an link it later with the JITed Code? Or are there any problems regarding the portability of the bitcode build with llvm-gcc under mingw? If there are problems, what solution would you suggest?

skaffman
  • 398,947
  • 96
  • 818
  • 769
SteffenG
  • 274
  • 2
  • 12

1 Answers1

0

Bitcode is in a portable format (at least given the same architecture); there is no difference between bitcode generated in Windows and bitcode generated in, for example, Linux or Cygwin.

wump
  • 4,277
  • 24
  • 25
  • Are you sure? I read in the FAQ that bitcode is not platform-independent. – SteffenG May 05 '10 at 21:03
  • They mean that you cannot use bitcode from ARM on your X86 system, or from X86/64 on X86/32 (differently sized longs/ints, other calling conventions, different struct alignments etc) Also they have a comment about include files being different. As long as you only use the win32 and math functions which exist in standard C (nothing cygwin specific), you're safe from that. – wump May 05 '10 at 22:55