Barry Kelly
2010-Mar-31 15:22 UTC
[LLVMdev] Getting started with LLVM on Win32 from non-C/C++ language
I'm looking to get started with LLVM as the back end for a compiler that ultimately should self-host.>From an ease of use perspective, the optimum on Windows would be a DLLalong with C header files that I can translate into the front end's language. I read in the FAQ: http://llvm.org/docs/FAQ.html#langs that "the C bindings in include/llvm-c should help a lot". However, looking at the contents of llvm-2.6/Release after I've built it on Cygwin, it looks like I'll have to cobble together a DLL out of the libraries myself. I can't imagine I'm the first to want a pre-packaged DLL containing all the relevant bits, along with DLL exports etc. Has someone else done this work? Thanks, -- Barry -- http://blog.barrkel.com/
Samuel Crow
2010-Mar-31 16:56 UTC
[LLVMdev] Getting started with LLVM on Win32 from non-C/C++ language
Hello Barry, Are you still using Cygwin? Why not try using MinGW instead. I think Cygwin cannot create .DLL files or if it can, the build scripts are not set up to do it from Cygwin. IIRC, Cygwin support is being dropped from later versions of LLVM so you'll have to either use Visual C++ to compile it or MinGW. See http://www.mingw.org for downloads. --Sam ----- Original Message ----> From: Barry Kelly <bkelly.ie at gmail.com> > To: LLVM Developers Mailing List <llvmdev at cs.uiuc.edu> > Sent: Wed, March 31, 2010 10:22:46 AM > Subject: [LLVMdev] Getting started with LLVM on Win32 from non-C/C++ language > > I'm looking to get started with LLVM as the back end for a compiler > thatultimately should self-host.>From an ease of use perspective, > the optimum on Windows would be a DLLalong with C header files that I can> translate into the front end'slanguage. I read in the> FAQ:http://llvm.org/docs/FAQ.html#langs that "the C bindings in> include/llvm-c should help a lot". However,looking at the contents of> llvm-2.6/Release after I've built it onCygwin, it looks like I'll have to> cobble together a DLL out of thelibraries myself. I can't imagine I'm> the first to want a pre-packaged DLL containing allthe relevant bits, along> with DLL exports etc. Has someone else donethis> work?Thanks, -- Barry -->http://blog.barrkel.com/ _______________________________________________ LLVM> Developers mailing list> href="mailto:LLVMdev at cs.uiuc.edu">LLVMdev at cs.uiuc.edu > > http://llvm.cs.uiuc.eduhttp://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Barry Kelly
2010-Mar-31 17:43 UTC
[LLVMdev] Getting started with LLVM on Win32 from non-C/C++ language
Samuel Crow wrote:> Are you still using Cygwin? > Why not try using MinGW instead.It was available. I live in Cygwin; MSYS is a poor alternative. Also generally speaking, open source projects targeting a POSIXy environment have a higher probability of working first time with Cygwin, so it serves well for investigation (e.g. no distribution in the GPL sense).> I think Cygwin cannot create .DLL filesIt can.> or if it can, > the build scripts are not set up to do it from Cygwin.I was able to build a DLL by roughly: cd Release/lib for f in *.a; ar x $f; done rm PluginMain.o g++ -shared --export-all-symbols -o LLVM.dll *.o (Credit to Óscar Fuentes in an old message.) It doesn't link with Cygwin disabled (-mno-cygwin) because the libraries have all been compiled without that switch used, of course. I have yet to try and use the C API directly, however.> IIRC, Cygwin support is being > dropped from later versions of LLVM so you'll have to either use Visual C++ to compile > it or MinGW.If Visual Studio 2008 were supported, I'd consider using it. The current solution and project files work less than optimally when auto-upgraded by VS2008. Are you still working on an LLVM back end for FPC? What integration approach are / were you using for that? -- Barry -- http://blog.barrkel.com/
Samuel Crow
2010-Mar-31 17:50 UTC
[LLVMdev] Getting started with LLVM on Win32 from non-C/C++ language
Hello again Barry, In order to compile LLVM from Visual C++, you should use CMake to create the project file. See http://www.cmake.org/ for downloads. I was going to work on an FPC compatible backend by adding the Borland Fastcall calling convention to the x86 backend but I've run into two snags: 1. I've never used the TableGen utility and I haven't gotten around to figuring it out, and 2. the person who was making the runtime library for the dialect of BASIC that I'm working on (he was using Delphi) has not been in contact with us for some time and we're thinking of dropping that runtime idea and just using a LibC-based solution. I hope this answers your questions, --Sam ----- Original Message ----> From: Barry Kelly <barry.j.kelly at gmail.com> > To: Samuel Crow <samuraileumas at yahoo.com> > Cc: LLVM Developers Mailing List <llvmdev at cs.uiuc.edu> > Sent: Wed, March 31, 2010 12:35:40 PM > Subject: Re: [LLVMdev] Getting started with LLVM on Win32 from non-C/C++ language >If Visual Studio 2008 were> supported, I'd consider using it. The currentsolution and project files work> less than optimally when auto-upgradedby VS2008. Are you still> working on an LLVM back end for FPC? What integrationapproach are / were you> using for that?-- Barry -- http://blog.barrkel.com/
Maybe Matching Threads
- [LLVMdev] Getting started with LLVM on Win32 from non-C/C++ language
- [LLVMdev] Getting started with LLVM on Win32 from non-C/C++ language
- [LLVMdev] Getting started with LLVM on Win32 from non-C/C++ language
- [LLVMdev] Is there someone tried LLVM 2.1 on Visual Studio 2005?
- [PATCH] Cygwin: Change service name to cygsshd