Path: utzoo!attcan!uunet!lll-winken!lll-lcc!lll-tis!helios.ee.lbl.gov!pasteur!ucbvax!decwrl!labrea!rutgers!iuvax!pur-ee!j.cc.purdue.edu!ain
From: ain@j.cc.purdue.edu (Patrick White)
Newsgroups: comp.sources.amiga
Subject: REZ (sources)
Keywords: Manx 3.4b/3.6, patch, rez, untested
Message-ID: <7200@j.cc.purdue.edu>
Date: 5 Jun 88 23:00:12 GMT
Organization: PUCC Land, USA
Lines: 98
Approved: ain@j.cc.purdue.edu	(Patrick White)

Submitted by:	kim@amdahl.uts.amdahl.com  (Kim DeVaughn)
Summary:	make programs resident in memory.
Poster Boy:	Patrick White	(ain@j.cc.purdue.edu)
Archive Name:	sources/amiga/volume5/rez.ccpatch.sh.Z
Tested.
 
NOTES:
   This was an arc that I separated.
   It was Submitted by Kim DeVaughn, but written by Jim Goodnow.
   The patch program is a patch to Manx 3.4b and 3.6 C compilers that allows
the C compiler to become resident (dosen't work otherwise).
   Rob ran into a version of Rez that needed to access the workbench disk
everytime it ran a program -- this version does *not* do that.
   rez will rez a name without stripping the path part of it off -- so one
can rez "c:cd" and "cd" -- rez thinks they are different, but "cd" is the
one that gets run in all cases.  So, if you use rez to load the programs,
cd into the directory first -- otherwise you load "c:cd" but run "cd".
 
 
-- Pat White   (co-moderator comp.sources/binaries.amiga)
ARPA/UUCP: j.cc.purdue.edu!ain  BITNET: PATWHITE@PURCCVM  PHONE: (317) 743-8421
U.S.  Mail:  320 Brown St. apt. 406,    West Lafayette, IN 47906
[How do you get to heaven?   Go to Pluto and hang a left.]
 
========================================
 
#	This is a shell archive.
#	Remove everything above and including the cut line.
#	Then run the rest of the file through sh.
#----cut here-----cut here-----cut here-----cut here----#
#!/bin/sh
# shar:	Shell Archiver
#	Run the following text with /bin/sh to create:
#	IF.AZTEC
#	patch.c
# This archive created: Fri Jun  3 11:10:50 1988
# By:	Patrick White (PUCC Land, USA)
echo shar: extracting IF.AZTEC '(1054 characters)'
cat << \SHAR_EOF > IF.AZTEC
Once REZ started working I discovered a number of programs that were not
shareable even though they were using the Aztec small model. In particular,
the compiler and make fall into these categories. The problem in the
compiler was that there was a section that went like:

	char *bra;

	bra = "bxx";
	strcpy(bra+1, branches[index]);

Unfortunately, this meant that the "bxx" was stored in the code segment
and modified by the program while executing. The new (3.6b?, 4.1a?) version
looks like:

	char bra[] = "bxx";

which is just fine. In the meantime, the included patch program will fix
this problem in either 3.6a or 3.4b. All it needs is for the compiler to
be in the current directory and to be called either "cc34b" or "cc36a".

The problem with make is more severe and invlolves my fexec() function which
needed to save the stack someplace while running the sub-process. It stored
it in the code segment making it non-shareable. For the time being, the
safest thing to do is to do "rez -n make" till I have a patch or a new
version of fexec().


SHAR_EOF
if test 1054 -ne "`wc -c IF.AZTEC`"
then
echo shar: error transmitting IF.AZTEC '(should have been 1054 characters)'
fi
echo shar: extracting patch.c '(334 characters)'
cat << \SHAR_EOF > patch.c
main()
{
	int i;

	if ((i = open("cc34b", 2)) >= 0) {
		lseek(i, 0x2e50L, 0);
		write(i, "bxx", 4);
		lseek(i, 0xc278L, 0);
		write (i, "\x47\xec\x87\x0e", 4);
		close(i);
	}
	if ((i = open("cc36a", 2)) >= 0) {
		lseek(i, 0x2f0cL, 0);
		write(i, "bxx", 4);
		lseek(i, 0xc68cL, 0);
		write (i, "\x47\xec\x87\x32", 4);
		close(i);
	}
}
SHAR_EOF
if test 334 -ne "`wc -c patch.c`"
then
echo shar: error transmitting patch.c '(should have been 334 characters)'
fi
#	End of shell archive
exit 0