Chris Lattner wrote:> If you'd prefer to use GCC, go for it. No one is forcing > you to use LLVM.No, we would prefer to use LLVM, but a missing part in LLVM makes it difficult. It would be wonderful if this missing part could be supplied.> You are seriously ignorant of what LLVM is all about. > Please go inform yourself.Alright, I read some more on llvm.org and it confirmed what I was saying: http://www.llvm.org/docs/GettingStarted.html#tutorial See at the end where it says: ----------- 6.Compile the program to native assembly using the LLC code generator: % llc hello.bc -o hello.s 7.Assemble the native assembly language file into a program: % gcc hello.s -o hello.native 8.Execute the native code program: % ./hello.native ----------- See how gcc is invoked to generate the final executable file. This means LLVM is an incomplete backend, unfortunately. Here are the instructions for MS Win, where the situation is even worse: http://www.llvm.org/docs/GettingStartedVS.html#tutorial ----------- 5. Compile the program to C using the LLC code generator: % llc -march=c hello.bc 6. Compile to binary using Microsoft C: % cl hello.cbe.c 7. Execute the native code program: % hello.cbe.exe ----------- See how nasty that is? Compiling to C source code, and then invoking the Microsoft C compiler! If you are going to do that, then you may as well just use the Microsoft C compiler by itself, and not bother with LLVM. This is a major problem that needs to be resolved. Terence Parr wrote:> GCC is not the only assembler / linker on windoze. I > believe M$ provides assemblers / linkers so people can > develop on windoze.Yes, but if you install the Microsoft development tools, then you may as well just use them to do everything, and not bother with LLVM. But I would prefer to use LLVM. But I can't because LLVM is missing the final stages. LLVM is an incomplete backend. Bill Wendling wrote:> I don't know about your computer, by mine comes with an > assembler.MS Windows does not come with an assembler, AFAIK. So your computer is superior in that area, yes, but we have customers using MS Win, and we have customers using Linux, and we need to support them both. John Criswell wrote:> As other have stated, most systems come with an assembler > (even GCC relies on an assembler to generate native code).Correct me if I am wrong, but MS Windows does not come with an assembler. The Microsoft development tools can be obtained separately and installed, but that is too difficult for an average end-user to do -- we cannot reasonably tell them to first install the Microsoft dev tools before they can use our product. And if installing the Microsoft dev tools is a requirement, then as I said, may as well just use them to do everything and not bother with LLVM, which is a real shame because I would prefer to use LLVM and get the other advantages of LLVM. jlh wrote:> GCC merely generates assembler files which then run > through the assembler to generate object files. Then the > linker is called to generate the final executable. GCC > just can call these steps for your convenience, but it > doesn't do it itself. And there's nothing wrong with > separating those steps. LLVM does exactly the same.Yes there is nothing wrong with separating those steps, but the point is that LLVM does not provide the necessary final steps to make a ready-to-execute .EXE or .DLL, and for this reason unfortunately LLVM fails to appeal over using the normal GCC or MS compiler. But this issue could be solved, and then LLVM would be the better choice.> LLVM only uses GCC as a front-end for languages such as C > and C++.Additionally, LLVM appears to require use of the GCC package or MS compiler (or an assembler provided with the system) as part of the backend as well -- to generate the final ready-to-execute .EXE or .DLL file. LLVM fails to provide a complete backend solution.> However, an own front-end (clang) is in the works, which > will remove this dependency.That doesn't help us. We have a front-end. We need a back-end. But LLVM is an incomplete backend because LLVM by itself cannot generate ready-to-execute .EXE or .DLL file.> You also failed to see all the things that LLVM can do, > but stable GCCs can't. For example > link-time-optimization, but there are many more > advantages.Yes LLVM is an excellent idea and a very worthy project, but this problem of it being an incomplete back-end is a major problem that should be rectified. Mark
Is this thread suposed to be a bad joke? 2008/5/10 kr512 <kr512 at optusnet.com.au>:> > Chris Lattner wrote: >> If you'd prefer to use GCC, go for it. No one is forcing >> you to use LLVM. > > No, we would prefer to use LLVM, but a missing part in LLVM > makes it difficult. It would be wonderful if this missing > part could be supplied. > >> You are seriously ignorant of what LLVM is all about. >> Please go inform yourself. > > Alright, I read some more on llvm.org and it confirmed what > I was saying: > http://www.llvm.org/docs/GettingStarted.html#tutorial > > See at the end where it says: > ----------- > 6.Compile the program to native assembly using the LLC code > generator: > % llc hello.bc -o hello.s > 7.Assemble the native assembly language file into a program: > % gcc hello.s -o hello.native > 8.Execute the native code program: > % ./hello.native > ----------- > > See how gcc is invoked to generate the final executable > file. This means LLVM is an incomplete backend, > unfortunately. > > Here are the instructions for MS Win, where the situation is > even worse: > http://www.llvm.org/docs/GettingStartedVS.html#tutorial > > ----------- > 5. Compile the program to C using the LLC code generator: > % llc -march=c hello.bc > 6. Compile to binary using Microsoft C: > % cl hello.cbe.c > 7. Execute the native code program: > % hello.cbe.exe > ----------- > > See how nasty that is? Compiling to C source code, and then > invoking the Microsoft C compiler! If you are going to do > that, then you may as well just use the Microsoft C compiler > by itself, and not bother with LLVM. This is a major > problem that needs to be resolved. > > Terence Parr wrote: >> GCC is not the only assembler / linker on windoze. I >> believe M$ provides assemblers / linkers so people can >> develop on windoze. > > Yes, but if you install the Microsoft development tools, > then you may as well just use them to do everything, and not > bother with LLVM. But I would prefer to use LLVM. But I > can't because LLVM is missing the final stages. LLVM is an > incomplete backend. > > Bill Wendling wrote: >> I don't know about your computer, by mine comes with an >> assembler. > > MS Windows does not come with an assembler, AFAIK. So your > computer is superior in that area, yes, but we have > customers using MS Win, and we have customers using Linux, > and we need to support them both. > > John Criswell wrote: >> As other have stated, most systems come with an assembler >> (even GCC relies on an assembler to generate native code). > > Correct me if I am wrong, but MS Windows does not come with > an assembler. The Microsoft development tools can be > obtained separately and installed, but that is too difficult > for an average end-user to do -- we cannot reasonably tell > them to first install the Microsoft dev tools before they > can use our product. And if installing the Microsoft dev > tools is a requirement, then as I said, may as well just use > them to do everything and not bother with LLVM, which is a > real shame because I would prefer to use LLVM and get the > other advantages of LLVM. > > jlh wrote: >> GCC merely generates assembler files which then run >> through the assembler to generate object files. Then the >> linker is called to generate the final executable. GCC >> just can call these steps for your convenience, but it >> doesn't do it itself. And there's nothing wrong with >> separating those steps. LLVM does exactly the same. > > Yes there is nothing wrong with separating those steps, but > the point is that LLVM does not provide the necessary final > steps to make a ready-to-execute .EXE or .DLL, and for this > reason unfortunately LLVM fails to appeal over using the > normal GCC or MS compiler. But this issue could be solved, > and then LLVM would be the better choice. > >> LLVM only uses GCC as a front-end for languages such as C >> and C++. > > Additionally, LLVM appears to require use of the GCC package > or MS compiler (or an assembler provided with the system) as > part of the backend as well -- to generate the final > ready-to-execute .EXE or .DLL file. LLVM fails to provide a > complete backend solution. > >> However, an own front-end (clang) is in the works, which >> will remove this dependency. > > That doesn't help us. We have a front-end. We need a > back-end. But LLVM is an incomplete backend because LLVM > by itself cannot generate ready-to-execute .EXE or .DLL > file. > >> You also failed to see all the things that LLVM can do, >> but stable GCCs can't. For example >> link-time-optimization, but there are many more >> advantages. > > Yes LLVM is an excellent idea and a very worthy project, but > this problem of it being an incomplete back-end is a major > problem that should be rectified. > > Mark > > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >-- Emilio Wuerges LAPS - Laboratorio de Automacao de Projeto de Sistemas UFSC - Universidade Federal de Santa Catarina Brasil
Yeah, i'm kinda freaked out as i'm sure it's not a joke. i'm in awe. +1 to kill thread before google spiders it. Ter On May 10, 2008, at 8:41 PM, Emílio Wuerges wrote:> Is this thread suposed to be a bad joke?
On Sunday 11 May 2008 03:55:50 kr512 wrote:> That doesn't help us. We have a front-end. We need a > back-end. But LLVM is an incomplete backend because LLVM > by itself cannot generate ready-to-execute .EXE or .DLL > file.Can you explain why you would like to generate DLLs on the customer's computer rather than using LLVM as a JIT compiler? If you are happy with JIT compilation then the article on LLVM in the OCaml Journal covers everything you need to know to get started. -- Dr Jon D Harrop, Flying Frog Consultancy Ltd. http://www.ffconsultancy.com/products/?e
I think people have already responded to most of your points, but I didn't see this one addressed yet. kr512 wrote:> Chris Lattner wrote: >> However, an own front-end (clang) is in the works, which >> will remove this dependency. > > That doesn't help us. We have a front-end. We need a > back-end. But LLVM is an incomplete backend because LLVM > by itself cannot generate ready-to-execute .EXE or .DLL > file.If you run "llc -help" you'll find this fragment: -filetype - Choose a file type (not all types are supported by all targets): =asm - Emit an assembly ('.s') file =obj - Emit a native object ('.o') file [experimental] =dynlib - Emit a native dynamic library ('.so') file [experimental] It so happens that because LLVM has a JIT, it already knows how to emit actual executable code instead of textual assembly. However, as the [experimental] indicates -- it doesn't entirely work yet. Although we can emit the opcodes in binary form, support for the container formats isn't working properly. Thus far, there's an unfinished ELFWriter and MachOWriter in lib/Codegen/. Those could be finished, and PEWriter could be added for Win32 support. No one has done it yet (we just use 'gas' under the hood like gcc does). If this is blocking you from using LLVM, please consider whether it'd be easier to write this for us than to use something else. Nick Lewycky
On May 10, 2008, at 8:41 PM, Emílio Wuerges wrote:> Is this thread suposed to be a bad joke?I thought jokes were funny? ;-) -Chris
On May 10, 2008, at 7:55 PM, kr512 wrote:>> You are seriously ignorant of what LLVM is all about. >> Please go inform yourself. > > Alright, I read some more on llvm.org and it confirmed what > I was saying: > http://www.llvm.org/docs/GettingStarted.html#tutorial > > See at the end where it says: > ----------- > 6.Compile the program to native assembly using the LLC code > generator: > % llc hello.bc -o hello.s > 7.Assemble the native assembly language file into a program: > % gcc hello.s -o hello.native > 8.Execute the native code program: > % ./hello.native > ----------- > > See how gcc is invoked to generate the final executable > file. This means LLVM is an incomplete backend, > unfortunately. >That's only a convenience. GCC generates assembly code too and calls the assembler and linker as part of it's execution. You are perfectly able to call the assembler & linker yourself.> Bill Wendling wrote: >> I don't know about your computer, by mine comes with an >> assembler. > > MS Windows does not come with an assembler, AFAIK. >You should really learn how to use Google. Got this as the top hit for "Microsoft Assembler": http://www.microsoft.com/downloads/details.aspx?FamilyID=7a1c9da0-0510-44a2-b042-7ef370530c64&displaylang=en>-bw
Not that I sympathize with the OP's manners but... Bill Wendling <isanbard at gmail.com> writes:> On May 10, 2008, at 7:55 PM, kr512 wrote: > >> See how gcc is invoked to generate the final executable >> file. This means LLVM is an incomplete backend, >> unfortunately. >> > That's only a convenience. GCC generates assembly code too and calls > the assembler and linker as part of it's execution. You are perfectly > able to call the assembler & linker yourself.This means that LLVM requires an assembler and linker. Call it GCC or binutils, it is irrelevant. The OP point is that LLVM is not a self-sufficient tool on this aspect. Of course, if this is a serious problem for the OP, the correct way of dealing with it is to take constructive, polite actions for correcting it :-)>> Bill Wendling wrote: >>> I don't know about your computer, by mine comes with an >>> assembler. >> >> MS Windows does not come with an assembler, AFAIK. >> > You should really learn how to use Google. Got this as the top hit for > "Microsoft Assembler": > > http://www.microsoft.com/downloads/details.aspx?FamilyID=7a1c9da0-0510-44a2-b042-7ef370530c64&displaylang=enThis does not *comes* with MS Windows. It is a separate download, which depends on more downloads (Visual C++ Express Edition) and is for non-commercial use only. Furthermore, you can't re-distribute it. OTOH, I'm curious about why the OP needs to produce dlls on the fly. Isn't the JIT ok? -- Oscar
Am Sonntag, den 11.05.2008, 12:55 +1000 schrieb kr512:> Alright, I read some more on llvm.org and it confirmed what > I was saying: > http://www.llvm.org/docs/GettingStarted.html#tutorial > > See at the end where it says: > ----------- > 6.Compile the program to native assembly using the LLC code > generator: > % llc hello.bc -o hello.s > 7.Assemble the native assembly language file into a program: > % gcc hello.s -o hello.native > 8.Execute the native code program: > % ./hello.native > ----------- > > See how gcc is invoked to generate the final executable > file.gcc is called just as a compilation driver here. It looks into various environment variables to check which specific flags need to be passed to gas (assembler), what library paths to use, which flags to use for the linker, and similar stuff. This is valuable a Unixoid platforms where these things can vary, but irrelevant on Windows. So on Windows, you can simply hardcode the calls to assembler and linker and don't need to deliver gcc.> This means LLVM is an incomplete backend, > unfortunately.As is gcc. The difference being that gcc is usually packaged with binutils. You know you can compile binutils in standalone mode? That's the MinGW ports - you need Cygwin to do this compilation, but the binaries that come out at the end are standalone.> Yes, but if you install the Microsoft development tools, > then you may as well just use them to do everything, and not > bother with LLVM. But I would prefer to use LLVM.Why, actually? If we know what you're trying to achieve, we might be able to tell you whether it's possible and how to do that, without calling names.> Bill Wendling wrote: > > I don't know about your computer, by mine comes with an > > assembler. > > MS Windows does not come with an assembler, AFAIK.It didn't when I last developed for Windows (five years ago). I have no reason to believe that this changed. So to roll an installation package that uses LLVM, you'd have to include an assembler (and probably a linker, too). A MinGW port of binutils should fill this gap.> John Criswell wrote: > > As other have stated, most systems come with an assembler > > (even GCC relies on an assembler to generate native code). > > Correct me if I am wrong, but MS Windows does not come with > an assembler.Both are correct, in a sense. Most Unixoid systems do come with an assembler and linker. Most if not all Windows systems don't.> The Microsoft development tools can be > obtained separately and installed, but that is too difficult > for an average end-user to doIndeed. MS toolchains tend to require a large installation. Though I recall that MS unbundled the compiler and linker and made them both easy to install and freely available. I don't know whether you could pass them on as part of your installation package though. Regards, Jo