----- Original Message ----- From: "Chris Lattner" <sabre at nondot.org> To: "LLVM Developers Mailing List" <llvmdev at cs.uiuc.edu> Sent: Wednesday, October 24, 2007 11:30 AM Subject: Re: [LLVMdev] me being stupid: me vs the llvm codebase...> On Wed, 24 Oct 2007, BGB wrote: >> even more interestingly: if the same compiler were also used for static >> compilation, it could be used as a special feature to make such dynamic >> movability available even for statically compiled and linked code (as >> is, in my case, parts of the app which are statically compiled and >> linked, can't currently be relinked...). > > LLVM handles function pointers currently. It just overwrites the first > instruction of the old code with an unconditional branch to the new > implementation. Thus, any code branching to the old location will still > work. >yes, that works so long as one has write access to the text section (or the code is otherwise in a writable area). at least with typical compilation, afaik this is not the case (I think both linux and windows by default have .text being read only, which may limit applicability of this approach...). so, nearly any option works for dynamic land, but fewer options are around for static linking (this is partly what I was addressing as well, that in some cases one makes available a "universal proxy", and the VM is smart enough to figure this out, for example, by first trying to adjust the proxy before falling back to more drastic measures, such as patching or relinking...).> It would be possible to implement more aggressive solutions, and if you > are interested, llvmdev is a great place to talk about how to do it. >yes, maybe. well, maybe I can fammiliarize myself with the project more, and maybe be able to say something actually useful at some point...> Are you interested in using LLVM for your project? If not, llvmdev isn't > a very appropriate place to talk about your project. If you are, this is > a great place to ask questions or discuss design issues of LLVM itself. >I am still undecided mostly. a major detractor at this point for me and LLVM, is that it is written in C++, and I am not so good with C++, and I am otherwise not so fammiliar with the codebase... (as for myself and my project, well, my issue is partly one of isolation, namely that not really anyone cares about much of this, so I don't have all that many people to talk to...). (not too much interesting goes on on usenet is all...). well, this is among other issues, like homework, lack of female interest, and 'future'... so, I am just some lame hobbyist is all I guess, may stay around or may go away, or may use LLVM or continue using my own compiler (and at some point have to get a job or something, parents want me to be a school teacher, but I had hoped to be a programmer, maybe games or 3D modeling software or something, but they think there is no future in this, or that there is too much competition and no real jobs, or such...). this is life I guess...> -Chris > > -- > http://nondot.org/sabre/ > http://llvm.org/ > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >
>> LLVM handles function pointers currently. It just overwrites the >> first >> instruction of the old code with an unconditional branch to the new >> implementation. Thus, any code branching to the old location will >> still >> work. > > yes, that works so long as one has write access to the text section > (or the > code is otherwise in a writable area). > at least with typical compilation, afaik this is not the case (I > think both > linux and windows by default have .text being read only, which may > limit > applicability of this approach...). >In the LLVM case, it generated the code in the first place, so it obviously had access to write it there. In any case, the JIT can use mprotect to map the page writable if it has to.> a major detractor at this point for me and LLVM, is that it is > written in > C++, and I am not so good with C++, and I am otherwise not so > fammiliar with > the codebase...That sounds like an excellent reason to get more familiar with C++ and the LLVM code base. It's usually better to try to grow your capabilities than to limit what you can do by avoiding learning new things ;-) LLVM has extensive documentation at http://llvm.org/docs> (as for myself and my project, well, my issue is partly one of > isolation, > namely that not really anyone cares about much of this, so I don't > have all > that many people to talk to...).Sure, but that isn't a good reason to fill the in-boxes of people who are interested in LLVM. :)> so, I am just some lame hobbyist is all I guess, may stay around or > may go > away, or may use LLVM or continue using my own compiler.We certainly welcome "lame hobbists"! That is not the point. In fact, one significant goal of LLVM is to make it usable and approachable for people with all sorts of backgrounds. We haven't necessarily done a great job at this, but it is a goal :). I have no problem with discussing technical issues or answering questions on this list, just so long as they stay LLVM-related. Thanks, and welcome to the LLVM community! -Chris
----- Original Message ----- From: "Chris Lattner" <sabre at nondot.org> To: "LLVM Developers Mailing List" <llvmdev at cs.uiuc.edu> Sent: Wednesday, October 24, 2007 1:21 PM Subject: Re: [LLVMdev] me being stupid: me vs the llvm codebase...>>> LLVM handles function pointers currently. It just overwrites the >>> first >>> instruction of the old code with an unconditional branch to the new >>> implementation. Thus, any code branching to the old location will >>> still >>> work. >> >> yes, that works so long as one has write access to the text section >> (or the >> code is otherwise in a writable area). >> at least with typical compilation, afaik this is not the case (I >> think both >> linux and windows by default have .text being read only, which may >> limit >> applicability of this approach...). >> > > In the LLVM case, it generated the code in the first place, so it > obviously had access to write it there. > > In any case, the JIT can use mprotect to map the page writable if it > has to. >yes, ok (yes, on windows VirtualAlloc will probably also work here...). so, yeah, I deal with a mixed case (some code my compiler, much of the rest gcc, some dynamicly linked, much of the rest with ld...). I think this way about things I guess...>> a major detractor at this point for me and LLVM, is that it is >> written in >> C++, and I am not so good with C++, and I am otherwise not so >> fammiliar with >> the codebase... > > That sounds like an excellent reason to get more familiar with C++ > and the LLVM code base. It's usually better to try to grow your > capabilities than to limit what you can do by avoiding learning new > things ;-) >yeah, I have spent enough of my life avoiding C++... (personally, the language never seemed all that worthwhile, and back when I was a lot younger I had a run-in with the pain of writing stuff Java that made me despise OO for years...).> LLVM has extensive documentation at http://llvm.org/docs >yes, may need to look through a lot of this.>> (as for myself and my project, well, my issue is partly one of >> isolation, >> namely that not really anyone cares about much of this, so I don't >> have all >> that many people to talk to...). > > Sure, but that isn't a good reason to fill the in-boxes of people who > are interested in LLVM. :) >ok, ok, good point. if people want to write off-list, that is probably better... I guess I will try to limit my on-list activity to more on-topic pursuits I guess...>> so, I am just some lame hobbyist is all I guess, may stay around or >> may go >> away, or may use LLVM or continue using my own compiler. > > We certainly welcome "lame hobbists"! That is not the point. In > fact, one significant goal of LLVM is to make it usable and > approachable for people with all sorts of backgrounds. We haven't > necessarily done a great job at this, but it is a goal :). I have no > problem with discussing technical issues or answering questions on > this list, just so long as they stay LLVM-related. > > Thanks, and welcome to the LLVM community! >yes, ok.> -Chris > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >
Ralph Corderoy
2007-Oct-24 10:25 UTC
[LLVMdev] me being stupid: me vs the llvm codebase...
Hi BGB,> (as for myself and my project, well, my issue is partly one of > isolation, namely that not really anyone cares about much of this, so > I don't have all that many people to talk to...). (not too much > interesting goes on on usenet is all...).Have you tried comp.compilers? It's moderated and has a mixture of people, from those writing their first lexer to experts in more arcane areas. Pick just one area of your work you want to discuss or ask questions about and write a *concise* :-) post and see how it goes. Cheers, Ralph.
Apparently Analagous Threads
- [LLVMdev] me being stupid: me vs the llvm codebase...
- [LLVMdev] me being stupid: me vs the llvm codebase...
- [LLVMdev] me being stupid: me vs the llvm codebase...
- [LLVMdev] me being stupid: me vs the llvm codebase...
- [LLVMdev] me being stupid: me vs the llvm codebase...