Using PCHs for IR coding?

Hello everybody,

My partner and I want to make a parser generator that will generate LLVM bitcode directly so that it can use libraries compiled in any LLVM-based language. Unfortunately we are running into some problems with dependencies on libc since it is different on every operating system. The Mac, for example, defines stdin as a macro in stdio.h.

Is there going to be a collection of precompiled headers for Clang that will abstract away some of the unportabilities of C from a runtime perspective using aliases and inlines in the place of macros? If not, will the proposed type system for LLVM 3.0 solve some of these problems?

I'm hoping to avoid needing the runtime libraries of each programming language we're supporting. I also cannot be allowed to use GNU Classpath or .NET because their runtimes are too large and unwieldy to be easily ported to some of the operating systems I support.

I am in the process of making a wrapper framework for the programming language we plan to write with our parser generator and it should be very limited when compared to Classpath or .NET. Is there interest in joining up forces for an OOP framework wrapper for a higher-level virtual machine? What is OCaml's HLVM like?

I've already decided to try to add Borland Fastcall to the x86 backend for use with the Free Pascal compiler's runtimes but I didn't realize how much I would need their library to escape the unportability of LibC. I knew that C programming was only source-code compatible with other C compilers when I started but I never realized how dependent on LibC our project would become by the time we were ready to start using it.

I'm sorry to bombard you with so many questions at once but I'm hoping to avoid having to hand-convert stdio.h and stdlib.h to bitcodes for each OS.

--Sam