Path: utzoo!attcan!uunet!cbmvax!thomas From: thomas@cbmvax.UUCP (Dave Thomas QA) Newsgroups: comp.sys.amiga.tech Subject: Re: Shared library creation question Message-ID: <6883@cbmvax.UUCP> Date: 16 May 89 13:04:37 GMT References: <9698@watcgl.waterloo.edu> Reply-To: thomas@cbmvax.UUCP (Dave Thomas QA) Organization: Commodore Technology, West Chester, PA Lines: 47 In article <9698@watcgl.waterloo.edu> bmacintyre@watcgl.waterloo.edu (Blair MacIntyre) writes: > I'm in the process of trying to create a shared disk library. The > problem is simple, actually: it doesn't work! :-) > > My question is this: what shouldn't I be doing from a shared library > that I can do from a program that would be calling it? You should probably avoid making most compiler library calls (unless you have source and can check to see what they are doing). They often use global variables which will cause problems if multiple tasks use the library. > If I link the library object directly with the test programs, they > work fine. When I try using the shared lib, things start dying. > I'm getting seemingly random errors ... invalid address, F line > type opcode ( invalid opcode ), invalid instructions ... I can't > really figure it out. > > I followed it through the interface and it is ending up inside the > code, but it is dying somewhere inside ... > > I am using Manx FFP for the math inside the lib. It seems to > work. I am passing in GfxBase, but that isn't relavent (yet! :-) since > it isn't in a routine that used any graphics routines. > > To construct the lib I converted one of my source files to a format > usable my mklib and then took the output as a sample and did the > rest of the interface.asm and link.asm routines by hand. > > Anybody have any pointers about where I can start looking? "Pointers" is exactly right :-) I haven't done Manx in a while, but I think that you are having addressability problems. If you use any global variables or use any compiler provided link library routines, you may need to put a call to geta4() in the front of your routines. You should also disable any stack checking code. I've done a library in Lattice 5.02, but haven't tried it with Manx. It ought to work if your careful... > Blair Dave -- Dave Thomas, Commodore Amiga Test Engineering UUCP ...{allegra,rutgers}!cbmvax!thomas