[comp.lang.perl] unexec

stickler@rc.nokia.fi (Patrick Stickler RC 910) (11/22/90)

Has anyone already patched perl with the GNU Emacs unexec()
function in place of abort(). It seems that this would be the
thing to do for the perl dist itself - it saves us from having
to mess with undump!

If someone has already incorporated unexec() into perl and can
post the patches (or the instructions how to patch it ourselves), 
I'm sure that there would be lots of interested and grateful 
people (well, at least one person! ;-)



///////////////////////////////////////////////////////////////////////
  Patrick Stickler   University of Helsinki   stickler@cc.Helsinki.FI
///////////////////////////////////////////////////////////////////////

tchrist@convex.COM (Tom Christiansen) (11/22/90)

In article <312@pepper.rc.nokia.fi> stickler@rc.nokia.fi (Patrick Stickler RC 910) writes:
>Has anyone already patched perl with the GNU Emacs unexec()
>function in place of abort(). It seems that this would be the
>thing to do for the perl dist itself - it saves us from having
>to mess with undump!

I have, and have run this way for maybe a year.

If you look at PL40, if you -DUNEXEC you will get a function defined
called myunexec(), which is the code I wrote as a front end for unexec()
Whether it really sets things up right for YOUR architecture I don't know.
You will have to add unexec.c from the GNU distribution.  It works for
me.  I'm interested in hearing from others on their experiences.

--tom

gorpong@ping.uucp (Gordon C. Galligher) (11/28/90)

In article <109153@convex.convex.com> tchrist@convex.COM (Tom Christiansen) writes:
>In article <312@pepper.rc.nokia.fi> stickler@rc.nokia.fi (Patrick Stickler RC 910) writes:
>>Has anyone already patched perl with the GNU Emacs unexec()
>>function in place of abort(). It seems that this would be the
>>thing to do for the perl dist itself - it saves us from having
>>to mess with undump!
>
>I have, and have run this way for maybe a year.
>
>If you look at PL40, if you -DUNEXEC you will get a function defined
>called myunexec(), which is the code I wrote as a front end for unexec()
>Whether it really sets things up right for YOUR architecture I don't know.
>You will have to add unexec.c from the GNU distribution.  It works for
>me.  I'm interested in hearing from others on their experiences.

I have not tried this, but I have some concerns about doing this.  As soon
as any code from GNU stuff is included, the entire work is forced to become
under the GPL.  Some of you are saying:  "That is OK, it already is."
Actually, no, it is not.  Larry uses the wording, but his interpretation of
the GPL in the README file makes some clarifications, which I believe Richard
Stallman would object to; mainly the fact that when you undump and get an 
executable you do not have to give it away (only have to give away the virgin
PERL source code; your own stuff is your own).  

I see nothing wrong with this way of looking at things and I do not think
that Richard Stallman or anyone else in FSF can complain to Larry.  But,
if you start using their code, that puts the entire work under GPL, THEIR
interpretation.  You are no longer "free" to interpret the license how you
want to.  You are FORCED to interpret it THEIR way (kind of like what
happened to the Puritans in Salem, but I digress).

I would love to have something portable to undump the a.out/core files, but
doing so at the risk of losing Larry's open-minded approach and broad 
interpretation of his license, is not worth it, IMHO.

		-- Gordon.

-- 
Gordon C. Galligher	9127 Potter Rd. #2E	Des Plaines, IL    60016-4881
		     ...!{uupsi,uu.psi.com}!ping!gorpong

tchrist@convex.COM (Tom Christiansen) (11/29/90)

In article <1990Nov28.122908.25542@ping.uucp> gorpong@ping.uucp 
(Gordon C. Galligher) writes some very good points about what
using unexec from GNU means to perl.

Bear in mind that Larry does not himself distribute perl with 
any GNU code in it.  It's up to you to do the linking.

--tom

stickler@cc.helsinki.fi (11/30/90)

In article <109153@convex.convex.com>, tchrist@convex.COM (Tom Christiansen) writes:
> In article <312@pepper.rc.nokia.fi> stickler@rc.nokia.fi (Patrick Stickler RC 910) writes:
>>Has anyone already patched perl with the GNU Emacs unexec()
>>function in place of abort(). It seems that this would be the
>>thing to do for the perl dist itself - it saves us from having
>>to mess with undump!
> 
> I have, and have run this way for maybe a year.
> 
> If you look at PL40, if you -DUNEXEC you will get a function defined
> called myunexec(), which is the code I wrote as a front end for unexec()
> Whether it really sets things up right for YOUR architecture I don't know.
> You will have to add unexec.c from the GNU distribution.  It works for
> me.  I'm interested in hearing from others on their experiences.
> 
> --tom

One problem that arises is that anything later than PL37 won't compile
under SCO XENIX/286. There are just too many changes after PL37 that
haven't had time to sort themselves out on all platforms.

Another problem is that I am no hacker. Could you (pleeeeease) suggest
what steps would be necessary to incorporate your myunexec() function,
the GNU unexec.c and PL37??

I have the PL40 dist, so I guess I'll just need to copy your myunexec()
function to the PL37 dist, add the neccessary preprocessing commands
for -DUNEXEC, and compile/link the GNU unexec.c into perl, right?

I really wish Larry Wall would incorporate this 'stand-alone' feature
as an official part of perl. It seems that *alot* of people want it.

If you can help me (just a little) with this, I will be *very* grateful.


//////////////////////////////////////////////////////////////////////
  Patrick Stickler  University of Helsinki   stickler@cc.helsinki.fi
//////////////////////////////////////////////////////////////////////

tchrist@convex.COM (Tom Christiansen) (12/01/90)

In article <4116.275642e9@cc.helsinki.fi> stickler@cc.helsinki.fi writes:
>Another problem is that I am no hacker. Could you (pleeeeease) suggest
>what steps would be necessary to incorporate your myunexec() function,
>the GNU unexec.c and PL37??

The myunexec() function, which I've used since around PL12 or so, was
built by looking into GNU emacs source (not something I normally do before
breakfast) and seeing how unexec was invoked, and setting up args in
myunexec to make it work.  If you don't have a working unexec() for your
platform, you're out of luck.  If you do, then you should be able to copy
in unexec.c from the emacs directory and link it in with perl, after
compiling with -DUNEXEC.  If special tweaks are required, you're going to
have to become a hacker to deal with them, or find one who has.

--tom