Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
General
GeneralPortable MacsHardwareNetworking
Applications
Mac ApplicationsEudoraFirefox / MozillaInternet ExplorerOutlook ExpressMS OfficeEntourageExcelPowerPointWordVirtual PCMedia PlayerOther MS Products
Programming
Mac ProgrammingCodeWarriorPerl
Country Specific
Australian Mac GroupUK Mac Group

Mac Forum / Programming / CodeWarrior / July 2006



Tip: Looking for answers? Try searching our database.

Any idea what __restore_fpr_23 is?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
RogueWarrior - 02 Jul 2006 01:05 GMT
I'm getting the following link errors when following the Codewarrior to
XCode conversion preparation.  Anyone know what the story is here?

Link Error   : undefined: '__restore_fpr_23' (code)
Referenced from 'Noise' in Noise.c

Link Error   : undefined: '__save_fpr_23' (code)
Referenced from 'Noise' in Noise.c

Link Error   : undefined: '__restore_fpr_21' (code)
Referenced from 'DNoise2' in Noise.c

Link Error   : undefined: '__save_fpr_21' (code)
Referenced from 'DNoise2' in Noise.c

I've search the newsgroup for this and all I find are things to do with
link order which I've tried and to use the MSL library which I'm not
supposed to do.
Paul - 03 Jul 2006 14:46 GMT
> I'm getting the following link errors when following the Codewarrior to
> XCode conversion preparation.  Anyone know what the story is here?
[quoted text clipped - 14 lines]
> link order which I've tried and to use the MSL library which I'm not
> supposed to do.

IIRC, there were a bunch of those that saved and restored assorted registers
from the stack. I even remember seeing them: they're written in assembler
and buried somewhere in the MSL sources. I don't know if they're MW specific
or defined in some PPC ABI document and implemented by MW:  they do fill a
need that any runtime library would have.

It would be interesting to know where they're being called. If the runtime
is using them internally they should be available. Is it possible that you
have some inline assembly that used them to manage stack frames, or a static
library compiled with CW?
RogueWarrior - 04 Jul 2006 02:13 GMT
Well I've started chopping out huge section of the code.  Basically I
started with nothing and uncommented one line at a time.  When I found
the offending line I thought I had it but no luck.  It's only a big
list of simple calculations:

    float x0, x1, x2, y0, y1, y2, z0, z1, z2;
    long xa, xb, xc, ya, yb, yc, za, zb, zc;
    long aa, ab, ac, ba, bb, bc, ca, cb, cc;
    long xi, yi, zi;

    x -= xi;
    y -= yi;
    z -= zi;

    x1 = x * x;
    y1 = y * y;
    z1 = z * z;

    x2 = 0.5 * x1;
    y2 = 0.5 * y1;
    z2 = 0.5 * z1;

    x1 = 0.5 + x - x1;
    y1 = 0.5 + y - y1;
    z1 = 0.5 + z - z1;

    x0 = 0.5 - x + x2;

It seems like its related to how many lines of code I've got.  This is
such a pain in the permanent vertical smile.  I'm trying to convert
projects to XCode and everybody's procedures suck.  They totally omit
the critical #define __CF_USE_FRAMEWORK_INCLUDES__ prefix line which I
just happened to find in the CW release notes.  Now this garbage.
*Sigh* where is MW Ron when you need him?
RogueWarrior - 04 Jul 2006 04:02 GMT
Well, I figured it out.  There are a whole bunch of restore_fpr
routines defined in runtime.c which is part of the Mac OSX Support MSL
libraries.  However for some reason it's not enough to just add it to
the project.  I got compile errors.  But if I took the MSL Runtime
project, copied it, and removed everything but runtime.c, compiled a
new library, added that to my project, it compiles, links and runs no
problem.  YAY!
Now to see if the damn thing works in XCode.
Paul - 05 Jul 2006 16:28 GMT
> Well I've started chopping out huge section of the code.  Basically I
> started with nothing and uncommented one line at a time.  When I found
[quoted text clipped - 30 lines]
> just happened to find in the CW release notes.  Now this garbage.
> *Sigh* where is MW Ron when you need him?

Not how many lines of code, how many fp registers it uses. MW supplied these
functions to save and restore nonvolatile registers in a function call. The
runtime library is trying to do that and not finding the function it needs.
A different compiler might even do it internally (generate the load/save
code itself) and not need a canned solution, though it would likely generate
a larger program by effectively inlining it.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.