On Wed, 2004-08-04 at 12:21, John Criswell wrote:> In regards to Misha's comments about the automatic execution of bytecode > files, there are several ways to do it: > > 1) Have bytecode files start with #!<JIT/llee/whatever> (portable) > 2) Encapsulate with ELF > 3) Register the type with the kernel (Linux only) > > I don't really care for the llee approach, as it can be broken with > subsequent LD_PRELOADs, requires that I enter an alternative execution > environment, and requires that I remember to run llee. I believe the > methods above are less error-prone and integrate into the system more > cleanly.Unfortunately, the #!... convention is not supported on all operating systems although it is very common on UNIX. I think we're going to end up with a mixture of things: 1. The llee (llvm-run) approach needs to be maintained for those systems where all you can do is run a program (think OS/390, Windows, etc.) 2. We can do the #! trick now without modifying the bytecode file. We have a convention like this: #!/path/to/llvm-run - llvm......(bytecode) When llvm-run is given the - option, it reads the rest of the file as bytecode. This is how a shell works too. 3. We might want to eventually have an installer that registers the type with the kernel but I think that's a long way off. We should concentrate effort on items 1. and 2. above. I don't think we need to do any encapsulation with ELF to accomplish the same goals. Reid. -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20040804/d8ff9f02/attachment.sig>
Reid Spencer wrote:> On Wed, 2004-08-04 at 12:21, John Criswell wrote: > >>In regards to Misha's comments about the automatic execution of bytecode >>files, there are several ways to do it: >> >>1) Have bytecode files start with #!<JIT/llee/whatever> (portable) >>2) Encapsulate with ELF >>3) Register the type with the kernel (Linux only) >> >>I don't really care for the llee approach, as it can be broken with >>subsequent LD_PRELOADs, requires that I enter an alternative execution >>environment, and requires that I remember to run llee. I believe the >>methods above are less error-prone and integrate into the system more >>cleanly. > > > Unfortunately, the #!... convention is not supported on all operating > systems although it is very common on UNIX. I think we're going to end > up with a mixture of things:Yes, I know. I figured other OS's have some other sort of mechanism to do the same thing.> > 1. The llee (llvm-run) approach needs to be maintained for those systems > where all you can do is run a program (think OS/390, Windows, etc.)Doesn't Windows have some method of associating extensions to executable programs?> 2. We can do the #! trick now without modifying the bytecode file. We > have a convention like this: > #!/path/to/llvm-run - > llvm......(bytecode) > When llvm-run is given the - option, it reads the rest of the file > as bytecode. This is how a shell works too. > 3. We might want to eventually have an installer that registers the type > with the kernel but I think that's a long way off. We should > concentrate effort on items 1. and 2. above. > > I don't think we need to do any encapsulation with ELF to accomplish the > same goals.You are right. ELF encapsulation was more for the second set of goals (i.e. working with pre-existing system tools).> > Reid. > > > ------------------------------------------------------------------------ > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://mail.cs.uiuc.edu/mailman/listinfo/llvmdev-- John T. -- ********************************************************************* * John T. Criswell Email: criswell at uiuc.edu * * Research Programmer * * University of Illinois at Urbana-Champaign * * * * "It's today!" said Piglet. "My favorite day," said Pooh. * *********************************************************************
On Wed, Aug 04, 2004 at 02:50:33PM -0500, John Criswell wrote:> >Unfortunately, the #!... convention is not supported on all operating > >systems although it is very common on UNIX. I think we're going to end > >up with a mixture of things: > > Yes, I know. I figured other OS's have some other sort of mechanism to > do the same thing.They do *something*, the point is adding cruft into the bytecode format will never handle *all* cases, we'll still have platform-specific additional hacks. So it's not worth polluting the bytecode with these hacks.> >1. The llee (llvm-run) approach needs to be maintained for those systems > > where all you can do is run a program (think OS/390, Windows, etc.) > > Doesn't Windows have some method of associating extensions to executable > programs?Certainly, and you can do that TODAY, without modifying the bytecode at all to include #! lines: just associate .bc with lli and you're done. -- Misha Brukman :: http://misha.brukman.net :: http://llvm.cs.uiuc.edu