[LLVMdev] Linker problems with Visual Studio
sabre at nondot.org
Thu Oct 14 11:17:04 CDT 2004
On Thu, 14 Oct 2004, Morten Ofstad wrote:
> I finally managed to compile a working fibonacci example (using the
> interpreter, I'm still working on porting the x86 backend). The final
> problem was that I couldn't find a way to force the linker to include
> the Dominators.obj file since there were no references to it. There is
> an option to the linker to stop it from stripping unreferenced code, but
> it still doesn't pull the object file in from the library unless there
> are some references.
> In the end I opted for the ugly IncludeFile() trick which is used
> elsewhere in the code, I include a patch with this mail. If someone has
> any better suggestions for how to fix this, I am all ears...
Yes, I think this is the only way to do this unfortunately. I too would
be interested in any ideas. :)
The patch is applied, thanks!
> The other areas which have to be resolved is the struct/class debacle
> and also the hash_map usage (I am using the Visual Studio STL library)
> -- my fix for the hash_map thing is too ugly to go in, so I won't even
> bother to submit a patch. Unfortunately I have to link LLVM with our own
> app which is using the MS STL, so resorting to using a STL library more
> similar to GCC is probably not an option.
I'm not really sure what the right way to do this is, but if you can come
up with a non-invasive patch (i.e., just to the Support/hash_* headers), I
think that would be fine. It would be very very nice to be able to use
the standard VC STL.
> There are some other minor things I plan to submit patches for later
> today, when I have cleaned up. If anyone else is interested in obtaining
> my VS project files, please write me an email...
Cool. I'm not sure what the right approach is for the build system, as we
really don't want to maintain two completely separate build systems, one
of which that we don't test. Any ideas are welcome! :)
Thanks for all of the great patches!
More information about the LLVMdev