[LLVMdev] Fix for non-standard variable length array + Visual C X86 specific code
Chris Lattner
sabre at nondot.org
Mon Oct 18 15:27:33 PDT 2004
On Mon, 18 Oct 2004, Morten Ofstad wrote:
> > I'm not sure how your patch fixes it though. The only references added by
> > your change would be within the X86 library. How does this change the
> > situation?
>
> Because I'm including the X86TargetMachine header from the application
> (Fibonacci.cpp) .. I know, I know -- but really, I tried everything to
> get the linker to cooperate.
Ugh! I'm sure you can appreciate the fact that we can't do such a thing.
The X86 backend isn't even linked into the JIT on hosts that are not X86,
and the JIT even allows for target support to be dynamically loaded:
lli -load yourchip.so foo.bc
Adding X86 specific stuff to clients is not going to work.
> I can only generate static libraries (.lib)
> and dynamic libraries (.dll) - there is an option to the linker to force
> symbol references, but it has to be put in the final link for the
> application and then the object X which registers the target has to be
> put in the global namespace with an 'extern "C"' in front to know it's
> name. It's even worse in my opinion.
I think forcing a reference is ok. If you need to add an extern "C"
symbol, that shouldn't be a problem. Alternatively, compiling the X86
support as a dll would also work, have you tried that?
-Chris
--
http://llvm.org/
http://nondot.org/sabre/
More information about the llvm-dev
mailing list