[comp.sys.mac.programmer] MPW Link problem

ra_robert@gsbacd.uchicago.edu (04/22/89)

I recently bought MPW along with TML Pascal II and I'm having a serious problem
getting them to work (at all).  I'm a MPW novice (which is why I bought the
bundle), so I thought I'd build the sample programs which came along with the
set.  TML Pascal automates the build process pretty much.  All goes fine until
I get to the "Link" stage (which I can see from the message box at the lower
left of the worksheet).  Then the beachball spins for a couple of seconds and
stops.  Nada.  I thought maybe it just takes a while to link.  Even after 15
minutes it just sits there.  No disk access, nothing.

The Mac hasn't crashed: I can stop Link by hitting command-period.  And then I
always get this message:

### Link: Resource not found (OS error -192)  
### Link: Error: Resource I/O error, # (Error 6) setting resource attributes.
### Link: Errors prevented normal completion.
### MPW Shell - Execution of FrameWork.projout terminated.
### MPW Shell - Execution of TMLBuildProject terminated.


Maybe it's something in their code, but the same thing happened with two sample
projects.  In fact, I followed along with the manual in trying to build one of
them.  I installed everything correctly, I believe, since the installation
procedure is taken care of with an installation disk.


So, here's the data.  This is the project which TML Pascal uses internally to
to build the app:

Set Echo 1
	TMLPascal Globals.p  
	TMLPascal Printer.p  
	TMLPascal FileIO.p  
	TMLPascal Events.p  
	TMLPascal Framework.p  
	Link -w -t 'APPL' -c 'FRAM' 6
		Framework.p.o 6
		Globals.p.o 6
		Printer.p.o 6
		FileIO.p.o 6
		Events.p.o 6
		"{Libraries}"Runtime.o 6
		"{Libraries}"Interface.o 6
		"{TMLPLibraries}"TMLPasLib.o 6
		-o FrameWork
	Rez -append -o FrameWork 6
		 Framework.r
	SetFile -a B FrameWork


And this is the output I get:

# 22:03:19 ----- Build project: FrameWork.
    TMLPascal Globals.p
    TMLPascal Printer.p
    TMLPascal FileIO.p
    TMLPascal Events.p
    TMLPascal Framework.p
    Link -w -t 'APPL' -c 'FRAM' Framework.p.o Globals.p.o Printer.p.o
FileIO.p.o
Events.p.o "Gandalf:MPW:Libraries:Libraries:"Runtime.o
"Gandalf:MPW:Libraries:Libraries:"Interface.o
"Gandalf:MPW:Libraries:TMLPLibraries:"TMLPasLib.o -o FrameWork
[HERE IS WHERE IT HANGS AND I HAVE TO HIT COMMAND-PERIOD]
### Link: Resource not found (OS error -192)  
### Link: Error: Resource I/O error, # (Error 6) setting resource attributes.
### Link: Errors prevented normal completion.
### MPW Shell - Execution of FrameWork.projout terminated.
### MPW Shell - Execution of TMLBuildProject terminated.

(The link line there got kind of messed up, since it's longer than the screen
width; it's all on one line in the worksheet).

Any help would be VERY MUCH appreciated.  I've re-installed the thing 3 times. 
I'm running System 6.0.2, and have as INITS: TMON, Jasmine,
Guardian,Vaccine,Moire.  I'm running on a Mac II with 2 Megs.

Robert
------
ra_robert@gsbacd.uchicago.edu
------
generic disclaimer: all my opinions are mine

ra_robert@gsbacd.uchicago.edu (04/22/89)

I think I've figured it out: I think it was Vaccine that was doing it (somehow
after 24 hours of thinking about this, it came to me just after I posted to the
net; sorry for any wasted bandwidth).

I think it was I needed to set Vaccine to "always compile MPW inits".  I did
that, and Link seems to work now, although MPW won't run the program from
within the shell (I guess it's not got enough memory), and the program doesn't
function right when run from the desktop.


Robert
------
ra_robert@gsbacd.uchicago.edu
------
generic disclaimer: all my opinions are mine

ra_robert@gsbacd.uchicago.edu (04/22/89)

Thanks to all who sent me very helpful info!  I must say that this net is truly
awesome in its power to spread information.

I think I've got all solved now.  The inability of the built program to run
seems to be some problem with the Rez script (I had to go back and Rez
'manually').  I'll try to tackle that one tomorrow, after a bit of sleep. :->

Robert
------
ra_robert@gsbacd.uchicago.edu
------
generic disclaimer: all my opinions are mine

wb1j+@andrew.cmu.edu (William M. Bumgarner) (04/23/89)

I had the same exact problem you had... you can get Link to dump that error
message by hitting any key on the keyboard after it locks up.

I bet you have Vaccine...

Try booting w/o Vaccine and do the compile/link again, should work just fine.

I tore my hair out on this one, but have had no problems since then.

The Compile MPW INIT's switch has no affect on it.

b.bum
wb1j+@andrew.cmu.edu

keith@uhccux.uhcc.hawaii.edu (Keith Kinoshita) (04/23/89)

In article <cYIGMuy00UofA53pxD@andrew.cmu.edu> wb1j+@andrew.cmu.edu (William M. Bumgarner) writes:
>I bet you have Vaccine...
>Try booting w/o Vaccine and do the compile/link again, should work just fine.
>I tore my hair out on this one, but have had no problems since then.
>The Compile MPW INIT's switch has no affect on it.

	Vaccine does indeed work with MPW when Vaccine's Compile MPW
switch is set.  You just probably forgot to reboot your machine 
after setting the switch.  I work with Vaccine and MPW v3.0 and have
had no incompatibility problems.  

>
>b.bum
>wb1j+@andrew.cmu.edu


-- 
Keith Kinoshita, UHCC Macintosh Programmer & Interactive Systems Assistant
INTERNET: keith@uhccux.UHCC.HAWAII.EDU     ARPA:  uhccux!keith@nosc.MIL
BITNET:   keith@uhccux                     UUCP: ...!ucsd!nosc!uhccux!keith
"Rise, Sir Pooh de Bear, most faithful of all my Knights." -Christopher Robin

thecloud@dhw68k.cts.com (Ken McLeod) (04/24/89)

In article <2849@tank.uchicago.edu> ra_robert@gsbacd.uchicago.edu writes:
>
>I get to the "Link" stage (which I can see from the message box at the lower
>left of the worksheet).  Then the beachball spins for a couple of seconds and
>stops.  Nada.  I thought maybe it just takes a while to link.  Even after 15
>minutes it just sits there.  No disk access, nothing.
>
> [lots of stuff deleted]
>Any help would be VERY MUCH appreciated.  I've re-installed the thing 3 times. 
>I'm running System 6.0.2, and have as INITS: TMON, Jasmine,
>Guardian,Vaccine,Moire.  I'm running on a Mac II with 2 Megs.
          ^^^^^^^

  I experienced Link Hang too, and it took several minutes of serious
head-scratching before I realized that the culprit was Vaccine. Link and
Vaccine don't get along too well together. If Link appears to hang, try
hitting the 'y' key to override Vaccine's "silent check." Better yet,
get rid of Vaccine and use RWatcher or GateKeeper instead.

  Vaccine is great for the general Mac population, but if you spend your
time in MPW and LSC, it'll drive ya nuts!

-ken

-- 
==========     .......     =============================================
Ken McLeod    :.     .:    UUCP: ...{spsd,zardoz,felix}!dhw68k!thecloud
==========   :::.. ..:::   INTERNET: thecloud@dhw68k.cts.com
                ////       =============================================

mueller@inf.ethz.ch (Martin Friedrich Mueller) (01/18/91)

When trying to link a fairly large program including MacApp.lib
and the MacApp Debugger, I got the following error:

### While reading file "MM-80:MPW:MacApp:Libraries:.Debug Files:MacApp.lib"
### Link: Error: Number of Jump Table entries exceeds limit of 4092. (Error 108)

What can I do to avoid this limit?

Martin Mueller
mueller@inf.ethz.ch

anders@verity.com (Anders Wallgren) (01/24/91)

In article <21614@neptune.inf.ethz.ch>, mueller@inf (Martin Friedrich Mueller) writes:
>When trying to link a fairly large program including MacApp.lib
>and the MacApp Debugger, I got the following error:
>
>### While reading file "MM-80:MPW:MacApp:Libraries:.Debug Files:MacApp.lib"
>### Link: Error: Number of Jump Table entries exceeds limit of 4092. (Error 108)
>
>What can I do to avoid this limit?
>
>Martin Mueller
>mueller@inf.ethz.ch


You're not going to enjoy this...

Without going into too much detail, you've basically run into a pretty
hard limitation in the current MPW run-time architecture (which is
being addressed in MPW 3.2 - if you don't have ETO#2, get it NOW).
The jump table is used to vector jumps between code in different
segments.  Due to the architecture of the early Macs, there's a limit
on the number of entries in this table (basically, there's an entry
for each subroutine which is called from a routine in another segment,
each one takes up 8 bytes - 8*4092 = 32K = 15bits.  Since the A5
register is used to get at the jump table, and only 16 bits were
available for register-relative offsets, this was the limit.  (The
other 32K was used for global data)).

Ways to avoid this:
	o Cut down on the number of segments - your segments will be
	  larger, but you might be able to cut down on the number of
	  jump table entries.  This is pretty ugly.
	o If you're not using UPrinting, UGridView, UDialog, don't
	  initialize these units - this cuts down on the amount of
	  code you link in.  I ran into this problem and haven't
	  started implementing any printing yet, so I just took out
	  the UPrinting unit to give myself some time.
	o Compile and link with NoDebug Sym - this will shrink the
	  code size and allow you to keep writing and debugging code
	  as long as you don't need MacApps debugging gear.  This
	  hurts a bit.
	o Wait for MPW 3.2's 32-Bit-Everything, which will remove this
	  limitation.  If you Have the pre-release version of MPW 3.2
	  on ETO#2, it has this ability, although the release notes
	  warn that there are still bugs.
	o The MPW 3.2 linker has a -wrap option which will allow you
	  to use some of your global data space for additional jump
	  table entries.  However, if you're using MacApp, chances are
	  that you already have too much global data to do this.


There's probably some other things you can do, related to how you
segment your code, but this is one of the most annoying 'features' of
the mac right now.  Luckily it is on its way out.

anders